diff --git a/src/Controller/AdminPages/BaseAdminController.php b/src/Controller/AdminPages/BaseAdminController.php index 02bfb5ef..2ef1bc12 100644 --- a/src/Controller/AdminPages/BaseAdminController.php +++ b/src/Controller/AdminPages/BaseAdminController.php @@ -74,10 +74,11 @@ abstract class BaseAdminController extends AbstractController protected string $route_base = ''; protected string $attachment_class = ''; protected ?string $parameter_class = ''; + /** * @var EventDispatcher|EventDispatcherInterface */ - protected $eventDispatcher; + protected EventDispatcher|EventDispatcherInterface $eventDispatcher; public function __construct(protected TranslatorInterface $translator, protected UserPasswordHasherInterface $passwordEncoder, protected AttachmentSubmitHandler $attachmentSubmitHandler, diff --git a/src/Controller/InfoProviderController.php b/src/Controller/InfoProviderController.php index f130209c..730083f7 100644 --- a/src/Controller/InfoProviderController.php +++ b/src/Controller/InfoProviderController.php @@ -31,7 +31,6 @@ use App\Services\Attachments\AttachmentSubmitHandler; use App\Services\InfoProviderSystem\PartInfoRetriever; use App\Services\InfoProviderSystem\ProviderRegistry; use App\Services\LogSystem\EventCommentHelper; -use App\Services\Parts\PartFormHelper; use Doctrine\ORM\EntityManagerInterface; use Psr\Log\LoggerInterface; use Symfony\Bridge\Doctrine\Attribute\MapEntity; diff --git a/src/Controller/LogController.php b/src/Controller/LogController.php index afa32f7a..9a0d73c7 100644 --- a/src/Controller/LogController.php +++ b/src/Controller/LogController.php @@ -22,7 +22,6 @@ declare(strict_types=1); namespace App\Controller; -use App\DataTables\Column\LogEntryTargetColumn; use App\DataTables\Filters\LogFilter; use App\DataTables\LogDataTable; use App\Entity\Base\AbstractDBElement; @@ -48,7 +47,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; #[Route(path: '/log')] class LogController extends AbstractController diff --git a/src/Controller/PartController.php b/src/Controller/PartController.php index 0c5be411..bc6a8d06 100644 --- a/src/Controller/PartController.php +++ b/src/Controller/PartController.php @@ -50,7 +50,6 @@ use DateTime; use Doctrine\ORM\EntityManagerInterface; use Exception; use Omines\DataTablesBundle\DataTableFactory; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Bridge\Doctrine\Attribute\MapEntity; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\FormInterface; diff --git a/src/Controller/RedirectController.php b/src/Controller/RedirectController.php index b125b95d..65bd78f5 100644 --- a/src/Controller/RedirectController.php +++ b/src/Controller/RedirectController.php @@ -73,6 +73,7 @@ class RedirectController extends AbstractController * Check if mod_rewrite is available (URL rewriting is possible). * If this is true, we can redirect to /en, otherwise we have to redirect to index.php/en. * When the PHP is not used via Apache SAPI, we just assume that URL rewriting is available. + * @noinspection PhpUndefinedFunctionInspection */ public function checkIfModRewriteAvailable(): bool { diff --git a/src/Controller/UserSettingsController.php b/src/Controller/UserSettingsController.php index a70efbff..af673ef8 100644 --- a/src/Controller/UserSettingsController.php +++ b/src/Controller/UserSettingsController.php @@ -60,10 +60,7 @@ use Symfony\Component\Validator\Constraints\Length; #[Route(path: '/user')] class UserSettingsController extends AbstractController { - /** - * @var EventDispatcher|EventDispatcherInterface - */ - protected $eventDispatcher; + protected EventDispatcher|EventDispatcherInterface $eventDispatcher; public function __construct(protected bool $demo_mode, EventDispatcherInterface $eventDispatcher) { diff --git a/src/DataTables/Adapters/FetchResultsAtOnceORMAdapter.php b/src/DataTables/Adapters/FetchResultsAtOnceORMAdapter.php index 182dcbda..fc48d8a8 100644 --- a/src/DataTables/Adapters/FetchResultsAtOnceORMAdapter.php +++ b/src/DataTables/Adapters/FetchResultsAtOnceORMAdapter.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace App\DataTables\Adapters; -use App\DataTables\Events\ORMPostQueryEvent; use Doctrine\ORM\AbstractQuery; use Doctrine\ORM\QueryBuilder; use Omines\DataTablesBundle\Adapter\AdapterQuery; @@ -45,7 +44,7 @@ class FetchResultsAtOnceORMAdapter extends ORMAdapter $state = $query->getState(); // Apply definitive view state for current 'page' of the table - foreach ($state->getOrderBy() as list($column, $direction)) { + foreach ($state->getOrderBy() as [$column, $direction]) { /** @var AbstractColumn $column */ if ($column->isOrderable()) { $builder->addOrderBy($column->getOrderField(), $direction); diff --git a/src/DataTables/Adapters/TwoStepORMAdapter.php b/src/DataTables/Adapters/TwoStepORMAdapter.php index 03ab0663..89416a86 100644 --- a/src/DataTables/Adapters/TwoStepORMAdapter.php +++ b/src/DataTables/Adapters/TwoStepORMAdapter.php @@ -157,7 +157,7 @@ class TwoStepORMAdapter extends ORMAdapter $state = $query->getState(); // Apply definitive view state for current 'page' of the table - foreach ($state->getOrderBy() as list($column, $direction)) { + foreach ($state->getOrderBy() as [$column, $direction]) { /** @var AbstractColumn $column */ if ($column->isOrderable()) { $builder->addOrderBy($column->getOrderField(), $direction); diff --git a/src/DataTables/Column/EntityColumn.php b/src/DataTables/Column/EntityColumn.php index 2facdc81..54ae3fb3 100644 --- a/src/DataTables/Column/EntityColumn.php +++ b/src/DataTables/Column/EntityColumn.php @@ -42,7 +42,7 @@ class EntityColumn extends AbstractColumn * @param mixed $value The single value of the column * @return mixed */ - public function normalize($value): mixed + public function normalize(mixed $value): mixed { /** @var AbstractNamedDBElement $value */ return $value; diff --git a/src/DataTables/Column/MarkdownColumn.php b/src/DataTables/Column/MarkdownColumn.php index 9160c0d4..41f62649 100644 --- a/src/DataTables/Column/MarkdownColumn.php +++ b/src/DataTables/Column/MarkdownColumn.php @@ -37,7 +37,7 @@ class MarkdownColumn extends AbstractColumn * @param mixed $value The single value of the column * @return string */ - public function normalize($value): string + public function normalize(mixed $value): string { return $this->markdown->markForRendering($value, true); } diff --git a/src/DataTables/Column/PartAttachmentsColumn.php b/src/DataTables/Column/PartAttachmentsColumn.php index df3389ca..7b209028 100644 --- a/src/DataTables/Column/PartAttachmentsColumn.php +++ b/src/DataTables/Column/PartAttachmentsColumn.php @@ -43,7 +43,7 @@ class PartAttachmentsColumn extends AbstractColumn * @param mixed $value The single value of the column * @return mixed */ - public function normalize($value): mixed + public function normalize(mixed $value): mixed { return $value; } diff --git a/src/DataTables/Column/TagsColumn.php b/src/DataTables/Column/TagsColumn.php index 49ed89c7..f98a3900 100644 --- a/src/DataTables/Column/TagsColumn.php +++ b/src/DataTables/Column/TagsColumn.php @@ -37,7 +37,7 @@ class TagsColumn extends AbstractColumn * @param mixed $value The single value of the column * @return mixed */ - public function normalize($value): mixed + public function normalize(mixed $value): mixed { if (empty($value)) { return []; diff --git a/src/DataTables/Filters/Constraints/EntityConstraint.php b/src/DataTables/Filters/Constraints/EntityConstraint.php index 7365890b..671b743f 100644 --- a/src/DataTables/Filters/Constraints/EntityConstraint.php +++ b/src/DataTables/Filters/Constraints/EntityConstraint.php @@ -40,14 +40,14 @@ class EntityConstraint extends AbstractConstraint * @param class-string $class * @param string $property * @param string|null $identifier - * @param null|T $value + * @param T|null $value * @param string|null $operator */ public function __construct(protected ?NodesListBuilder $nodesListBuilder, protected string $class, string $property, string $identifier = null, - protected $value = null, + protected ?AbstractDBElement $value = null, protected ?string $operator = null) { if (!$nodesListBuilder instanceof NodesListBuilder && $this->isStructural()) { diff --git a/src/Entity/Attachments/PartAttachment.php b/src/Entity/Attachments/PartAttachment.php index d2314dd3..0873b3c5 100644 --- a/src/Entity/Attachments/PartAttachment.php +++ b/src/Entity/Attachments/PartAttachment.php @@ -24,7 +24,6 @@ namespace App\Entity\Attachments; use App\Entity\Parts\Part; use App\Serializer\APIPlatform\OverrideClassDenormalizer; -use App\Serializer\TypeOverride\TypeOverridableSerializer; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Serializer\Attribute\Context; diff --git a/src/Entity/Parts/PartLot.php b/src/Entity/Parts/PartLot.php index 184562f1..9bf5178f 100644 --- a/src/Entity/Parts/PartLot.php +++ b/src/Entity/Parts/PartLot.php @@ -37,7 +37,6 @@ use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Post; use ApiPlatform\Serializer\Filter\PropertyFilter; use App\ApiPlatform\Filter\LikeFilter; -use App\Repository\PartLotRepository; use Doctrine\DBAL\Types\Types; use App\Entity\Base\AbstractDBElement; use App\Entity\Base\TimestampTrait; diff --git a/src/EventListener/ConsoleEnsureWebserverUserListener.php b/src/EventListener/ConsoleEnsureWebserverUserListener.php index f6deec02..dbd164c4 100644 --- a/src/EventListener/ConsoleEnsureWebserverUserListener.php +++ b/src/EventListener/ConsoleEnsureWebserverUserListener.php @@ -75,6 +75,7 @@ class ConsoleEnsureWebserverUserListener } } + /** @noinspection PhpUndefinedFunctionInspection */ private function isRunningAsRoot(): bool { //If we are on windows, we can't run as root @@ -96,6 +97,7 @@ class ConsoleEnsureWebserverUserListener * Determines the username of the user who started the current script if possible. * Returns null if the username could not be determined. * @return string|null + * @noinspection PhpUndefinedFunctionInspection */ private function getRunningUser(): ?string { @@ -126,6 +128,7 @@ class ConsoleEnsureWebserverUserListener if (PHP_OS_FAMILY === 'Windows') { //If we have the COM extension available, we can use it to determine the owner if (extension_loaded('com_dotnet')) { + /** @noinspection PhpUndefinedClassInspection */ $su = new \COM("ADsSecurityUtility"); // Call interface //@phpstan-ignore-next-line $securityInfo = $su->GetSecurityDescriptor($path_to_check, 1, 1); // Call method diff --git a/src/Form/Permissions/PermissionsMapper.php b/src/Form/Permissions/PermissionsMapper.php index 2163b26f..d4b937bc 100644 --- a/src/Form/Permissions/PermissionsMapper.php +++ b/src/Form/Permissions/PermissionsMapper.php @@ -47,7 +47,7 @@ final class PermissionsMapper implements DataMapperInterface * @param mixed $viewData View data of the compound form being initialized * @param Traversable $forms A list of {@link FormInterface} instances */ - public function mapDataToForms($viewData, \Traversable $forms): void + public function mapDataToForms(mixed $viewData, \Traversable $forms): void { foreach ($forms as $form) { if ($this->inherit) { @@ -94,7 +94,7 @@ final class PermissionsMapper implements DataMapperInterface * @param mixed $viewData The compound form's view data that get mapped * its children model data */ - public function mapFormsToData(\Traversable $forms, &$viewData): void + public function mapFormsToData(\Traversable $forms, mixed &$viewData): void { if ($this->inherit) { throw new RuntimeException('The permission type is readonly when it is showing read only data!'); diff --git a/src/Form/Type/SIUnitType.php b/src/Form/Type/SIUnitType.php index 2f0138f0..52bcaa3d 100644 --- a/src/Form/Type/SIUnitType.php +++ b/src/Form/Type/SIUnitType.php @@ -153,7 +153,7 @@ final class SIUnitType extends AbstractType implements DataMapperInterface * * @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported */ - public function mapDataToForms($viewData, \Traversable $forms): void + public function mapDataToForms(mixed $viewData, \Traversable $forms): void { $forms = iterator_to_array($forms); @@ -204,7 +204,7 @@ final class SIUnitType extends AbstractType implements DataMapperInterface * * @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported */ - public function mapFormsToData(\Traversable $forms, &$viewData): void + public function mapFormsToData(\Traversable $forms, mixed &$viewData): void { //Convert both fields to a single float value. diff --git a/src/Form/Type/TriStateCheckboxType.php b/src/Form/Type/TriStateCheckboxType.php index df4b0f3a..7d1e1c7c 100644 --- a/src/Form/Type/TriStateCheckboxType.php +++ b/src/Form/Type/TriStateCheckboxType.php @@ -101,7 +101,7 @@ final class TriStateCheckboxType extends AbstractType implements DataTransformer * * @throws TransformationFailedException when the transformation fails */ - public function transform($value) + public function transform(mixed $value) { if (true === $value) { return 'true'; @@ -145,7 +145,7 @@ final class TriStateCheckboxType extends AbstractType implements DataTransformer * * @throws TransformationFailedException when the transformation fails */ - public function reverseTransform($value) + public function reverseTransform(mixed $value) { return match ($value) { 'true' => true, diff --git a/src/Repository/LogEntryRepository.php b/src/Repository/LogEntryRepository.php index 8d1f2d8e..82e4bdd8 100644 --- a/src/Repository/LogEntryRepository.php +++ b/src/Repository/LogEntryRepository.php @@ -162,10 +162,10 @@ class LogEntryRepository extends DBElementRepository /** * Gets the last log entries ordered by timestamp. * - * @param int|null $limit - * @param int|null $offset + * @param int|null $limit + * @param int|null $offset */ - public function getLogsOrderedByTimestamp(string $order = 'DESC', $limit = null, $offset = null): array + public function getLogsOrderedByTimestamp(string $order = 'DESC', int $limit = null, int $offset = null): array { return $this->findBy([], ['timestamp' => $order], $limit, $offset); } diff --git a/src/Security/Voter/AttachmentVoter.php b/src/Security/Voter/AttachmentVoter.php index 3a576ff2..c2b17053 100644 --- a/src/Security/Voter/AttachmentVoter.php +++ b/src/Security/Voter/AttachmentVoter.php @@ -135,7 +135,7 @@ final class AttachmentVoter extends Voter * * @return bool True if the attribute and subject are supported, false otherwise */ - protected function supports(string $attribute, $subject): bool + protected function supports(string $attribute, mixed $subject): bool { if (is_a($subject, Attachment::class, true)) { //These are the allowed attributes diff --git a/src/Security/Voter/GroupVoter.php b/src/Security/Voter/GroupVoter.php index af6adeaa..bea33291 100644 --- a/src/Security/Voter/GroupVoter.php +++ b/src/Security/Voter/GroupVoter.php @@ -57,7 +57,7 @@ final class GroupVoter extends Voter * * @return bool True if the attribute and subject are supported, false otherwise */ - protected function supports(string $attribute, $subject): bool + protected function supports(string $attribute, mixed $subject): bool { if (is_a($subject, Group::class, true)) { return $this->helper->isValidOperation('groups', $attribute); diff --git a/src/Security/Voter/PermissionVoter.php b/src/Security/Voter/PermissionVoter.php index e7a1caed..937b7ece 100644 --- a/src/Security/Voter/PermissionVoter.php +++ b/src/Security/Voter/PermissionVoter.php @@ -62,7 +62,7 @@ final class PermissionVoter extends Voter * * @return bool True if the attribute and subject are supported, false otherwise */ - protected function supports(string $attribute, $subject): bool + protected function supports(string $attribute, mixed $subject): bool { //Check if the attribute has the form @permission.operation if (preg_match('#^@\\w+\\.\\w+$#', $attribute)) { diff --git a/src/Security/Voter/StructureVoter.php b/src/Security/Voter/StructureVoter.php index 24f4d04f..37b261ae 100644 --- a/src/Security/Voter/StructureVoter.php +++ b/src/Security/Voter/StructureVoter.php @@ -68,7 +68,7 @@ final class StructureVoter extends Voter * * @return bool True if the attribute and subject are supported, false otherwise */ - protected function supports(string $attribute, $subject): bool + protected function supports(string $attribute, mixed $subject): bool { if (is_object($subject) || is_string($subject)) { $permission_name = $this->instanceToPermissionName($subject); @@ -87,11 +87,11 @@ final class StructureVoter extends Voter /** * Maps an instance type to the permission name. * - * @param object|string $subject The subject for which the permission name should be generated + * @param object|string $subject The subject for which the permission name should be generated * * @return string|null the name of the permission for the subject's type or null, if the subject is not supported */ - protected function instanceToPermissionName($subject): ?string + protected function instanceToPermissionName(object|string $subject): ?string { $class_name = is_string($subject) ? $subject : $subject::class; diff --git a/src/Security/Voter/UserVoter.php b/src/Security/Voter/UserVoter.php index e6bfd5fb..b41c1a40 100644 --- a/src/Security/Voter/UserVoter.php +++ b/src/Security/Voter/UserVoter.php @@ -47,7 +47,7 @@ final class UserVoter extends Voter * * @return bool True if the attribute and subject are supported, false otherwise */ - protected function supports(string $attribute, $subject): bool + protected function supports(string $attribute, mixed $subject): bool { if (is_a($subject, User::class, true)) { return in_array($attribute, diff --git a/src/Services/InfoProviderSystem/Providers/DigikeyProvider.php b/src/Services/InfoProviderSystem/Providers/DigikeyProvider.php index 31b9cb41..4d3e6189 100644 --- a/src/Services/InfoProviderSystem/Providers/DigikeyProvider.php +++ b/src/Services/InfoProviderSystem/Providers/DigikeyProvider.php @@ -175,8 +175,7 @@ class DigikeyProvider implements InfoProviderInterface null => null, 'Active' => ManufacturingStatus::ACTIVE, 'Obsolete' => ManufacturingStatus::DISCONTINUED, - 'Discontinued at Digi-Key' => ManufacturingStatus::EOL, - 'Last Time Buy' => ManufacturingStatus::EOL, + 'Discontinued at Digi-Key', 'Last Time Buy' => ManufacturingStatus::EOL, 'Not For New Designs' => ManufacturingStatus::NRFND, 'Preliminary' => ManufacturingStatus::ANNOUNCED, default => ManufacturingStatus::NOT_SET, diff --git a/src/Services/InfoProviderSystem/Providers/Element14Provider.php b/src/Services/InfoProviderSystem/Providers/Element14Provider.php index b1b0668f..26914130 100644 --- a/src/Services/InfoProviderSystem/Providers/Element14Provider.php +++ b/src/Services/InfoProviderSystem/Providers/Element14Provider.php @@ -190,41 +190,20 @@ class Element14Provider implements InfoProviderInterface { //Decide based on the shop ID return match ($this->store_id) { - 'bg.farnell.com' => 'EUR', + 'bg.farnell.com', 'at.farnell.com', 'si.farnell.com', 'sk.farnell.com', 'ro.farnell.com', 'pt.farnell.com', 'nl.farnell.com', 'be.farnell.com', 'lv.farnell.com', 'lt.farnell.com', 'it.farnell.com', 'fr.farnell.com', 'fi.farnell.com', 'ee.farnell.com', 'es.farnell.com', 'ie.farnell.com', 'cpcireland.farnell.com', 'de.farnell.com' => 'EUR', 'cz.farnell.com' => 'CZK', 'dk.farnell.com' => 'DKK', - 'at.farnell.com' => 'EUR', 'ch.farnell.com' => 'CHF', - 'de.farnell.com' => 'EUR', - 'cpc.farnell.com' => 'GBP', - 'cpcireland.farnell.com' => 'EUR', - 'export.farnell.com' => 'GBP', - 'onecall.farnell.com' => 'GBP', - 'ie.farnell.com' => 'EUR', - 'il.farnell.com' => 'USD', - 'uk.farnell.com' => 'GBP', - 'es.farnell.com' => 'EUR', - 'ee.farnell.com' => 'EUR', - 'fi.farnell.com' => 'EUR', - 'fr.farnell.com' => 'EUR', + 'cpc.farnell.com', 'uk.farnell.com', 'onecall.farnell.com', 'export.farnell.com' => 'GBP', + 'il.farnell.com', 'www.newark.com' => 'USD', 'hu.farnell.com' => 'HUF', - 'it.farnell.com' => 'EUR', - 'lt.farnell.com' => 'EUR', - 'lv.farnell.com' => 'EUR', - 'be.farnell.com' => 'EUR', - 'nl.farnell.com' => 'EUR', 'no.farnell.com' => 'NOK', 'pl.farnell.com' => 'PLN', - 'pt.farnell.com' => 'EUR', - 'ro.farnell.com' => 'EUR', 'ru.farnell.com' => 'RUB', - 'sk.farnell.com' => 'EUR', - 'si.farnell.com' => 'EUR', 'se.farnell.com' => 'SEK', 'tr.farnell.com' => 'TRY', 'canada.newark.com' => 'CAD', 'mexico.newark.com' => 'MXN', - 'www.newark.com' => 'USD', 'cn.element14.com' => 'CNY', 'au.element14.com' => 'AUD', 'nz.element14.com' => 'NZD', diff --git a/src/Services/InfoProviderSystem/Providers/MouserProvider.php b/src/Services/InfoProviderSystem/Providers/MouserProvider.php index 22da8f3e..b0bde55c 100644 --- a/src/Services/InfoProviderSystem/Providers/MouserProvider.php +++ b/src/Services/InfoProviderSystem/Providers/MouserProvider.php @@ -296,9 +296,8 @@ class MouserProvider implements InfoProviderInterface null => null, "New Product" => ManufacturingStatus::ANNOUNCED, "Not Recommended for New Designs" => ManufacturingStatus::NRFND, - "Factory Special Order" => ManufacturingStatus::DISCONTINUED, + "Factory Special Order", "Obsolete" => ManufacturingStatus::DISCONTINUED, "End of Life" => ManufacturingStatus::EOL, - "Obsolete" => ManufacturingStatus::DISCONTINUED, default => ManufacturingStatus::ACTIVE, }; } diff --git a/src/Services/Misc/ConsoleInfoHelper.php b/src/Services/Misc/ConsoleInfoHelper.php index f529f74a..98de5e07 100644 --- a/src/Services/Misc/ConsoleInfoHelper.php +++ b/src/Services/Misc/ConsoleInfoHelper.php @@ -36,6 +36,7 @@ class ConsoleInfoHelper /** * Returns the username of the user who started the current script if possible. * @return string|null the username of the user who started the current script if possible, null otherwise + * @noinspection PhpUndefinedFunctionInspection */ public function getCLIUser(): ?string { diff --git a/src/Twig/TwigCoreExtension.php b/src/Twig/TwigCoreExtension.php index b77ff28b..94b067d5 100644 --- a/src/Twig/TwigCoreExtension.php +++ b/src/Twig/TwigCoreExtension.php @@ -69,6 +69,7 @@ final class TwigCoreExtension extends AbstractExtension throw new \InvalidArgumentException(sprintf('The given class "%s" is not an enum!', $enum_class)); } + /** @noinspection PhpUndefinedMethodInspection */ return ($enum_class)::cases(); } diff --git a/src/Validator/Constraints/NoLockoutValidator.php b/src/Validator/Constraints/NoLockoutValidator.php index 9d51d81e..f3998188 100644 --- a/src/Validator/Constraints/NoLockoutValidator.php +++ b/src/Validator/Constraints/NoLockoutValidator.php @@ -44,7 +44,7 @@ class NoLockoutValidator extends ConstraintValidator * @param mixed $value The value that should be validated * @param Constraint $constraint The constraint for the validation */ - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof NoLockout) { throw new UnexpectedTypeException($constraint, NoLockout::class); diff --git a/src/Validator/Constraints/NoneOfItsChildrenValidator.php b/src/Validator/Constraints/NoneOfItsChildrenValidator.php index 3846c2cc..2220e664 100644 --- a/src/Validator/Constraints/NoneOfItsChildrenValidator.php +++ b/src/Validator/Constraints/NoneOfItsChildrenValidator.php @@ -39,7 +39,7 @@ class NoneOfItsChildrenValidator extends ConstraintValidator * @param mixed $value The value that should be validated * @param Constraint $constraint The constraint for the validation */ - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof NoneOfItsChildren) { throw new UnexpectedTypeException($constraint, NoneOfItsChildren::class); diff --git a/src/Validator/Constraints/Selectable.php b/src/Validator/Constraints/Selectable.php index f65cb685..c26e47fa 100644 --- a/src/Validator/Constraints/Selectable.php +++ b/src/Validator/Constraints/Selectable.php @@ -31,5 +31,5 @@ use Symfony\Component\Validator\Constraint; #[\Attribute(\Attribute::TARGET_PROPERTY)] class Selectable extends Constraint { - public $message = 'validator.isSelectable'; + public string $message = 'validator.isSelectable'; } diff --git a/src/Validator/Constraints/SelectableValidator.php b/src/Validator/Constraints/SelectableValidator.php index 8519d230..dfe8eba8 100644 --- a/src/Validator/Constraints/SelectableValidator.php +++ b/src/Validator/Constraints/SelectableValidator.php @@ -39,7 +39,7 @@ class SelectableValidator extends ConstraintValidator * @param mixed $value The value that should be validated * @param Constraint $constraint The constraint for the validation */ - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Selectable) { throw new UnexpectedTypeException($constraint, Selectable::class); diff --git a/src/Validator/Constraints/ValidFileFilterValidator.php b/src/Validator/Constraints/ValidFileFilterValidator.php index d591a968..2a90a010 100644 --- a/src/Validator/Constraints/ValidFileFilterValidator.php +++ b/src/Validator/Constraints/ValidFileFilterValidator.php @@ -42,7 +42,7 @@ class ValidFileFilterValidator extends ConstraintValidator * @param mixed $value The value that should be validated * @param Constraint $constraint The constraint for the validation */ - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof ValidFileFilter) { throw new UnexpectedTypeException($constraint, ValidFileFilter::class); diff --git a/src/Validator/Constraints/ValidPartLotValidator.php b/src/Validator/Constraints/ValidPartLotValidator.php index 880bd5b3..316fedea 100644 --- a/src/Validator/Constraints/ValidPartLotValidator.php +++ b/src/Validator/Constraints/ValidPartLotValidator.php @@ -42,7 +42,7 @@ class ValidPartLotValidator extends ConstraintValidator * @param mixed $value The value that should be validated * @param Constraint $constraint The constraint for the validation */ - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof ValidPartLot) { throw new UnexpectedTypeException($constraint, ValidPartLot::class); diff --git a/src/Validator/Constraints/ValidPermissionValidator.php b/src/Validator/Constraints/ValidPermissionValidator.php index b7c43492..b1a5b623 100644 --- a/src/Validator/Constraints/ValidPermissionValidator.php +++ b/src/Validator/Constraints/ValidPermissionValidator.php @@ -46,7 +46,7 @@ class ValidPermissionValidator extends ConstraintValidator * @param mixed $value The value that should be validated * @param Constraint $constraint The constraint for the validation */ - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof ValidPermission) { throw new UnexpectedTypeException($constraint, ValidPermission::class);