diff --git a/src/Datagrid/Pager.php b/src/Datagrid/Pager.php index a0682ab9d5..9b801dc2c3 100644 --- a/src/Datagrid/Pager.php +++ b/src/Datagrid/Pager.php @@ -18,6 +18,9 @@ * * @author Fabien Potencier * @author Thomas Rabaix + * + * @phpstan-template T of ProxyQueryInterface + * @phpstan-implements PagerInterface */ abstract class Pager implements \Iterator, \Countable, \Serializable, PagerInterface { @@ -113,6 +116,8 @@ abstract class Pager implements \Iterator, \Countable, \Serializable, PagerInter /** * @var ProxyQueryInterface|null + * + * @phpstan-var T|null */ protected $query; @@ -856,6 +861,8 @@ public function setQuery($query) /** * @return ProxyQueryInterface|null + * + * @phpstan-return T|null $query */ public function getQuery() { diff --git a/src/Datagrid/PagerInterface.php b/src/Datagrid/PagerInterface.php index 42fef32f21..06f637c296 100644 --- a/src/Datagrid/PagerInterface.php +++ b/src/Datagrid/PagerInterface.php @@ -30,6 +30,8 @@ * @method array getLinks(?int $nbLinks = null) * @method bool haveToPaginate() * @method ProxyQueryInterface|null getQuery() + * + * @phpstan-template T of ProxyQueryInterface */ interface PagerInterface { @@ -79,10 +81,17 @@ public function setPage($page); // public function isLastPage(): bool; // NEXT_MAJOR: uncomment this method in 4.0 +// /** +// * @return ProxyQueryInterface|null +// * +// * @phpstan-return T|null +// */ // public function getQuery(): ?ProxyQueryInterface; /** * @param ProxyQueryInterface $query + * + * @phpstan-param T $query */ public function setQuery($query);