Skip to content

Commit

Permalink
Add more precise return type for Repository::setDefaultOrderings()
Browse files Browse the repository at this point in the history
  • Loading branch information
sascha-egerer committed Aug 9, 2024
1 parent b56227c commit 5d380d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions stubs/QueryInterface.stub
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ namespace TYPO3\CMS\Extbase\Persistence;
*/
interface QueryInterface
{
// We have to define the constants here to be able to use them in other stubs.
// See https://phpstan.org/user-guide/stub-files
public const ORDER_ASCENDING = 'ASC';
public const ORDER_DESCENDING = 'DESC';

/**
* @param bool $returnRawQueryResult
* @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface<ModelType>|list<array<string, mixed>>
Expand Down
2 changes: 1 addition & 1 deletion stubs/Repository.stub
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Repository
public function findByIdentifier($identifier);

/**
* @phpstan-param array<non-empty-string, non-empty-string> $defaultOrderings
* @phpstan-param array<non-empty-string, QueryInterface::ORDER_*> $defaultOrderings
* @phpstan-return void
*/
public function setDefaultOrderings($defaultOrderings);
Expand Down

0 comments on commit 5d380d7

Please sign in to comment.