Skip to content

Commit

Permalink
TASK: Add findBy method in Repository.stub
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbelasichon committed Feb 14, 2024
1 parent 947b026 commit 825a8a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions stubs/Repository.stub
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,11 @@ class Repository
* @phpstan-return class-string<static>
*/
protected function getRepositoryClassName();

/**
* @phpstan-param array<non-empty-string, mixed> $criteria
* @phpstan-param array<non-empty-string, QueryInterface::ORDER_*>|null $orderBy
* @phpstan-return QueryResultInterface<TEntityClass>|list<TEntityClass>
*/
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null);

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.1)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.1)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.1)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.1)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.2, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.2, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.2, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.2, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.2)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.2)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 7.4)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 7.4)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.3, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.3, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.3)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.3)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.2, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.2, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.3, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.3, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.1, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.1, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.3)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.0)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.3)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.0)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.3)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.3)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.2)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 7.4, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.2)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 7.4, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.0, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.0, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.2)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.2)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.1, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.1, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 7.4)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 7.4)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.0)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.0)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.3, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.3, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.0, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.0, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.1)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.1)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.2, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.2, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 7.4, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 7.4, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.1, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.1, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.2)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.2)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.1)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.1)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.2, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.2, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.3, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.3, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.2, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.2, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.1, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.1, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.2)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.2)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.2)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.2)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.3, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.3, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.3)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^11.5, 8.3)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.3)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^12.4, 8.3)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.3)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.3)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.3, --prefer-lowest)

Method TYPO3\CMS\Extbase\Persistence\Repository::findBy() has parameter $orderBy with no value type specified in iterable type array<string, mixed>.

Check failure on line 70 in stubs/Repository.stub

View workflow job for this annotation

GitHub Actions / Tests (^13.0, 8.3, --prefer-lowest)

PHPDoc tag @param for parameter $orderBy contains unresolvable type.
}
5 changes: 5 additions & 0 deletions tests/Unit/Type/data/repository-stub-files.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ public function myTests(): void
'array<int, RepositoryStubFiles\My\Test\Extension\Domain\Model\MyModel>|TYPO3\CMS\Extbase\Persistence\QueryResultInterface<RepositoryStubFiles\My\Test\Extension\Domain\Model\MyModel>',
$this->findAll()
);

assertType(
'array<int, RepositoryStubFiles\My\Test\Extension\Domain\Model\MyModel>|TYPO3\CMS\Extbase\Persistence\QueryResultInterface<RepositoryStubFiles\My\Test\Extension\Domain\Model\MyModel>',
$this->findBy(['foo' => 'baz'])
);
}

public function findAll() // phpcs:ignore SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint
Expand Down

0 comments on commit 825a8a3

Please sign in to comment.