Skip to content

Commit ec65289

Browse files
authored
Merge pull request #1656 from deguif/type-hint-repository-signatures
Add type-hints on signatures of repository methods
2 parents 17e36ac + db16f70 commit ec65289

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

CHANGELOG-6.0.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ in 6.0 versions.
1515
* [BC break] Signature of method `FOS\ElasticaBundle\HybridResult::getResult()` was changed.
1616
* [BC break] Signature of method `FOS\ElasticaBundle\Finder\FinderInterface::find()` was changed.
1717
* [BC break] Signature of method `FOS\ElasticaBundle\Persister\ObjectPersisterInterface::handlesObject()` was changed.
18-
* [BC break] Signature of method `FOS\ElasticaBundle\Provider\PagerProviderInterface::provider()` was changed.
18+
* [BC break] Signature of method `FOS\ElasticaBundle\Provider\PagerProviderInterface::provide()` was changed.
1919
* [BC break] Signature of methods `getPager`, `getOptions` and `getObjectPersister` from interface `FOS\ElasticaBundle\Persister\Event\PersistEvent` were changed.
2020
* [BC break] Signature of methods `getNbResults`, `getNbPages`, `getCurrentPage`, `setCurrentPage`, `getMaxPerPage` and `setMaxPerPage` from interface `FOS\ElasticaBundle\Provider\PagerInterface` were changed.
2121
* [BC break] Signature of methods `findPaginated`, `createPaginatorAdapter` and `createRawPaginatorAdapter` from interface `FOS\ElasticaBundle\Finder\PaginatedFinderInterface` were changed.
2222
* [BC break] Signature of methods `request`, `getIndex`, `getIndexTemplate` and `setStopwatch` from class `FOS\ElasticaBundle\Elastica\Client` were changed.
2323
* [BC break] Signature of methods `logQuery`, `getNbQueries` and `getQueries` from class `FOS\ElasticaBundle\Logger\ElasticaLogger` were changed.
24+
* [BC break] Signature of methods `find`, `findHybrid`, `findPaginated` and `createPaginatorAdapter` from class `FOS\ElasticaBundle\Repository` were changed.
2425
* [BC break] Removed `Elastica\Type`.
2526
* [BC break] Removed `_parent`.
2627
* [BC Break] Removed `FOS\ElasticaBundle\Persister\Event\Events` class, use class events instead.

src/Repository.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,46 +31,40 @@ public function __construct(PaginatedFinderInterface $finder)
3131

3232
/**
3333
* @param mixed $query
34-
* @param int $limit
35-
* @param array $options
3634
*
3735
* @return array
3836
*/
39-
public function find($query, $limit = null, $options = [])
37+
public function find($query, ?int $limit = null, array $options = [])
4038
{
4139
return $this->finder->find($query, $limit, $options);
4240
}
4341

4442
/**
4543
* @param mixed $query
46-
* @param int $limit
47-
* @param array $options
4844
*
4945
* @return mixed
5046
*/
51-
public function findHybrid($query, $limit = null, $options = [])
47+
public function findHybrid($query, ?int $limit = null, array $options = [])
5248
{
5349
return $this->finder->findHybrid($query, $limit, $options);
5450
}
5551

5652
/**
5753
* @param mixed $query
58-
* @param array $options
5954
*
6055
* @return \Pagerfanta\Pagerfanta
6156
*/
62-
public function findPaginated($query, $options = [])
57+
public function findPaginated($query, array $options = [])
6358
{
6459
return $this->finder->findPaginated($query, $options);
6560
}
6661

6762
/**
6863
* @param mixed $query
69-
* @param array $options
7064
*
7165
* @return Paginator\PaginatorAdapterInterface
7266
*/
73-
public function createPaginatorAdapter($query, $options = [])
67+
public function createPaginatorAdapter($query, array $options = [])
7468
{
7569
return $this->finder->createPaginatorAdapter($query, $options);
7670
}

0 commit comments

Comments
 (0)