Skip to content

Commit 34bb109

Browse files
committed
bug #6998 Improve deprecation message about return type (VincentLanglet)
This PR was merged into the 4.x branch. Discussion ---------- Improve deprecation message about return type Seems like the ``@return` TEntity` gives a weird deprecation message `@javiereguiluz`, cf issue #6995 So I updated the phpdoc to ``` `@return` object `@phpstan`-return TEntity ``` Also, I saw some ``@psalm`-`. Annotation. Since you're using phpstan for SA and not psalm ; I would recommend to use ``@phpstan`` everywhere so I updated those tag. Closes #6995 I think Commits ------- 5ac430e Improve return type
2 parents 260223b + 5ac430e commit 34bb109

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

src/Config/Crud.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static function new(): self
5656
/**
5757
* @param TranslatableInterface|string|callable $label The callable signature is: fn ($entityInstance, $pageName): string
5858
*
59-
* @psalm-param mixed $label
59+
* @phpstan-param mixed $label
6060
*/
6161
public function setEntityLabelInSingular($label): self
6262
{
@@ -80,7 +80,7 @@ public function setEntityLabelInSingular($label): self
8080
/**
8181
* @param TranslatableInterface|string|callable $label The callable signature is: fn ($entityInstance, $pageName): string
8282
*
83-
* @psalm-param mixed $label
83+
* @phpstan-param mixed $label
8484
*/
8585
public function setEntityLabelInPlural($label): self
8686
{
@@ -104,7 +104,7 @@ public function setEntityLabelInPlural($label): self
104104
/**
105105
* @param TranslatableInterface|string|callable $title The callable signature is: fn ($entityInstance): string
106106
*
107-
* @psalm-param mixed $title
107+
* @phpstan-param mixed $title
108108
*/
109109
public function setPageTitle(string $pageName, $title): self
110110
{

src/Contracts/Controller/CrudControllerInterface.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function configureFilters(Filters $filters): Filters;
4343
/**
4444
* @return FieldInterface[]|string[]
4545
*
46-
* @psalm-return iterable<FieldInterface|string>
46+
* @phpstan-return iterable<FieldInterface|string>
4747
*/
4848
public function configureFields(string $pageName): iterable;
4949

@@ -74,7 +74,9 @@ public function createIndexQueryBuilder(SearchDto $searchDto, EntityDto $entityD
7474
/**
7575
* @param class-string<TEntity> $entityFqcn
7676
*
77-
* @return TEntity
77+
* @return object
78+
*
79+
* @phpstan-return TEntity
7880
*/
7981
public function createEntity(string $entityFqcn);
8082

src/Contracts/Controller/DashboardControllerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function configureAssets(): Assets;
2626
/**
2727
* @return MenuItemInterface[]
2828
*
29-
* @psalm-return iterable<MenuItemInterface>
29+
* @phpstan-return iterable<MenuItemInterface>
3030
*/
3131
public function configureMenuItems(): iterable;
3232

src/Contracts/Event/EntityLifecycleEventInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
interface EntityLifecycleEventInterface
1111
{
1212
/**
13-
* @return TEntity
13+
* @return object
14+
*
15+
* @phpstan-return TEntity
1416
*/
1517
public function getEntityInstance();
1618
}

src/Dto/EntityDto.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ public function toString(): string
9999
}
100100

101101
/**
102-
* @return TEntity|null
102+
* @return object|null
103+
*
104+
* @phpstan-return TEntity|null
103105
*/
104106
public function getInstance()/* : ?object */
105107
{

0 commit comments

Comments
 (0)