diff --git a/src/Contracts/Event/EntityLifecycleEventInterface.php b/src/Contracts/Event/EntityLifecycleEventInterface.php index 621ceec960..852ce2eb57 100644 --- a/src/Contracts/Event/EntityLifecycleEventInterface.php +++ b/src/Contracts/Event/EntityLifecycleEventInterface.php @@ -10,9 +10,7 @@ interface EntityLifecycleEventInterface { /** - * @return object - * * @phpstan-return TEntity */ - public function getEntityInstance(); + public function getEntityInstance(): object; } diff --git a/src/Dto/ActionDto.php b/src/Dto/ActionDto.php index cea98cbf90..e312aaceca 100644 --- a/src/Dto/ActionDto.php +++ b/src/Dto/ActionDto.php @@ -241,7 +241,7 @@ public function setRouteName(string $routeName): void /** * @return array|callable */ - public function getRouteParameters()/* : array|callable */ + public function getRouteParameters(): array|callable { return $this->routeParameters; } @@ -254,10 +254,7 @@ public function setRouteParameters(array|callable $routeParameters): void $this->routeParameters = $routeParameters; } - /** - * @return string|callable|null - */ - public function getUrl() + public function getUrl(): callable|string|null { return $this->url; } diff --git a/src/Dto/CrudDto.php b/src/Dto/CrudDto.php index 6ba6789696..5b51f7147c 100644 --- a/src/Dto/CrudDto.php +++ b/src/Dto/CrudDto.php @@ -149,11 +149,7 @@ public function setEntityFqcn(string $entityFqcn): void $this->entityFqcn = $entityFqcn; } - /** - * @param object|null $entityInstance - * @param string|null $pageName - */ - public function getEntityLabelInSingular(/* ?object */ $entityInstance = null, /* ?string */ $pageName = null): TranslatableInterface|string|null + public function getEntityLabelInSingular(?object $entityInstance = null, ?string $pageName = null): TranslatableInterface|string|null { if (null === $this->entityLabelInSingular) { return null; @@ -174,11 +170,7 @@ public function setEntityLabelInSingular(TranslatableInterface|string|callable|n $this->entityLabelInSingular = $label; } - /** - * @param object|null $entityInstance - * @param string|null $pageName - */ - public function getEntityLabelInPlural(/* ?object */ $entityInstance = null, /* ?string */ $pageName = null): TranslatableInterface|string|null + public function getEntityLabelInPlural(?object $entityInstance = null, ?string $pageName = null): TranslatableInterface|string|null { if (null === $this->entityLabelInPlural) { return null; @@ -200,10 +192,9 @@ public function setEntityLabelInPlural(TranslatableInterface|string|callable|nul } /** - * @param object|null $entityInstance * @param array $translationParameters */ - public function getCustomPageTitle(?string $pageName = null, /* ?object */ $entityInstance = null, array $translationParameters = [], ?string $domain = null): ?TranslatableInterface + public function getCustomPageTitle(?string $pageName = null, ?object $entityInstance = null, array $translationParameters = [], ?string $domain = null): ?TranslatableInterface { $title = $this->customPageTitles[$pageName ?? $this->pageName]; if (\is_callable($title)) { diff --git a/src/Dto/DashboardDto.php b/src/Dto/DashboardDto.php index 93b446fa3e..8a9e6492fd 100644 --- a/src/Dto/DashboardDto.php +++ b/src/Dto/DashboardDto.php @@ -10,13 +10,11 @@ */ final class DashboardDto { - /** @var string */ - private $routeName; + private string $routeName; private string $faviconPath = 'data:image/svg+xml,'; private string $title = 'EasyAdmin'; private string $translationDomain = 'messages'; - /** @var string|null */ - private $textDirection; + private ?string $textDirection = null; private string $contentWidth = Crud::LAYOUT_CONTENT_DEFAULT; private string $sidebarWidth = Crud::LAYOUT_SIDEBAR_DEFAULT; private bool $absoluteUrls = true; diff --git a/src/Dto/FieldDto.php b/src/Dto/FieldDto.php index 6beb12bc84..42edd88d0a 100644 --- a/src/Dto/FieldDto.php +++ b/src/Dto/FieldDto.php @@ -31,16 +31,14 @@ final class FieldDto private mixed $formattedValue = null; /** @var callable|null */ private $formatValueCallable; - /** @var TranslatableInterface|string|false|null */ - private $label; + private TranslatableInterface|string|false|null $label = null; private ?string $formType = null; private KeyValueStore $formTypeOptions; private ?bool $sortable = null; private ?bool $virtual = null; private string|Expression|null $permission = null; private ?string $textAlign = null; - /** @var TranslatableInterface|string|null */ - private $help; + private TranslatableInterface|string|null $help = null; private string $cssClass = ''; // how many columns the field takes when rendering // (defined as Bootstrap 5 grid classes; e.g. 'col-md-6 col-xxl-3') @@ -58,10 +56,8 @@ final class FieldDto private KeyValueStore $doctrineMetadata; /** * @internal - * - * @var string|Ulid */ - private $uniqueId; + private Ulid|string $uniqueId; private KeyValueStore $displayedOn; /** @var array */ private array $htmlAttributes = []; diff --git a/src/Dto/FilterDataDto.php b/src/Dto/FilterDataDto.php index cf8163eb21..829e21894a 100644 --- a/src/Dto/FilterDataDto.php +++ b/src/Dto/FilterDataDto.php @@ -10,8 +10,7 @@ final class FilterDataDto private int $index; private string $entityAlias; private FilterDto $filterDto; - /** @var string */ - private $comparison; + private string $comparison; private mixed $value; private mixed $value2; diff --git a/src/Dto/FilterDto.php b/src/Dto/FilterDto.php index 32c6cdac42..e053dd3ce1 100644 --- a/src/Dto/FilterDto.php +++ b/src/Dto/FilterDto.php @@ -16,8 +16,7 @@ final class FilterDto private KeyValueStore $formTypeOptions; private KeyValueStore $customOptions; private ?string $propertyName = null; - /** @var TranslatableInterface|string|false|null */ - private $label; + private TranslatableInterface|string|false|null $label = null; /** @var callable */ private $applyCallable; diff --git a/src/Form/DataTransformer/StringToFileTransformer.php b/src/Form/DataTransformer/StringToFileTransformer.php index f0b1c31530..9d2480fe79 100644 --- a/src/Form/DataTransformer/StringToFileTransformer.php +++ b/src/Form/DataTransformer/StringToFileTransformer.php @@ -30,7 +30,10 @@ public function __construct( $this->uploadValidate = $uploadValidate; } - public function transform(mixed $value): mixed + /** + * @return array|File|FlysystemFile|null + */ + public function transform(mixed $value): array|File|FlysystemFile|null { if (null === $value || [] === $value) { return null; @@ -47,7 +50,10 @@ public function transform(mixed $value): mixed return array_map([$this, 'doTransform'], $value); } - public function reverseTransform(mixed $value): mixed + /** + * @return array|string|null + */ + public function reverseTransform(mixed $value): array|string|null { if (null === $value || [] === $value) { return $this->multiple ? [] : ''; diff --git a/src/Intl/IntlFormatter.php b/src/Intl/IntlFormatter.php index c1a8bfc247..bf0bec0ae2 100644 --- a/src/Intl/IntlFormatter.php +++ b/src/Intl/IntlFormatter.php @@ -262,10 +262,7 @@ private function createNumberFormatter(?string $locale, string $style, array $at return $this->numberFormatters[$hash]; } - /** - * @param \DateTimeZone|string|bool|null $timezone - */ - private function convertDate(?\DateTimeInterface $date, $timezone = null): ?\DateTimeInterface + private function convertDate(?\DateTimeInterface $date, bool|\DateTimeZone|string|null $timezone = null): ?\DateTimeInterface { if (null === $date) { return null;