Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Contracts/Event/EntityLifecycleEventInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
interface EntityLifecycleEventInterface
{
/**
* @return object
*
* @phpstan-return TEntity
*/
public function getEntityInstance();
public function getEntityInstance(): object;
}
7 changes: 2 additions & 5 deletions src/Dto/ActionDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function setRouteName(string $routeName): void
/**
* @return array<string, mixed>|callable
*/
public function getRouteParameters()/* : array|callable */
public function getRouteParameters(): array|callable
{
return $this->routeParameters;
}
Expand All @@ -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;
}
Expand Down
15 changes: 3 additions & 12 deletions src/Dto/CrudDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -200,10 +192,9 @@ public function setEntityLabelInPlural(TranslatableInterface|string|callable|nul
}

/**
* @param object|null $entityInstance
* @param array<string, mixed> $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)) {
Expand Down
6 changes: 2 additions & 4 deletions src/Dto/DashboardDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
*/
final class DashboardDto
{
/** @var string */
private $routeName;
private string $routeName;
private string $faviconPath = 'data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⬛</text></svg>';
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;
Expand Down
10 changes: 3 additions & 7 deletions src/Dto/FieldDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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<string, bool|int|float|string> */
private array $htmlAttributes = [];
Expand Down
3 changes: 1 addition & 2 deletions src/Dto/FilterDataDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 1 addition & 2 deletions src/Dto/FilterDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
10 changes: 8 additions & 2 deletions src/Form/DataTransformer/StringToFileTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ public function __construct(
$this->uploadValidate = $uploadValidate;
}

public function transform(mixed $value): mixed
/**
* @return array<File|FlysystemFile|null>|File|FlysystemFile|null
*/
public function transform(mixed $value): array|File|FlysystemFile|null
{
if (null === $value || [] === $value) {
return null;
Expand All @@ -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>|string|null
*/
public function reverseTransform(mixed $value): array|string|null
{
if (null === $value || [] === $value) {
return $this->multiple ? [] : '';
Expand Down
5 changes: 1 addition & 4 deletions src/Intl/IntlFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading