Skip to content

Commit 7cf7151

Browse files
committed
Add type-hints on signatures of pager-provider methods
1 parent 985e7a5 commit 7cf7151

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/Doctrine/MongoDBPagerProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Doctrine\Persistence\ManagerRegistry;
1515
use FOS\ElasticaBundle\Provider\PagerfantaPager;
16+
use FOS\ElasticaBundle\Provider\PagerInterface;
1617
use FOS\ElasticaBundle\Provider\PagerProviderInterface;
1718
use Pagerfanta\Adapter\DoctrineODMMongoDBAdapter;
1819
use Pagerfanta\Pagerfanta;
@@ -53,7 +54,7 @@ public function __construct(ManagerRegistry $doctrine, RegisterListenersService
5354
/**
5455
* {@inheritdoc}
5556
*/
56-
public function provide(array $options = [])
57+
public function provide(array $options = []): PagerInterface
5758
{
5859
$options = array_replace($this->baseOptions, $options);
5960

src/Doctrine/ORMPagerProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Doctrine\ORM\QueryBuilder;
1616
use Doctrine\Persistence\ManagerRegistry;
1717
use FOS\ElasticaBundle\Provider\PagerfantaPager;
18+
use FOS\ElasticaBundle\Provider\PagerInterface;
1819
use FOS\ElasticaBundle\Provider\PagerProviderInterface;
1920
use Pagerfanta\Adapter\DoctrineORMAdapter;
2021
use Pagerfanta\Pagerfanta;
@@ -57,7 +58,7 @@ public function __construct(ManagerRegistry $doctrine, RegisterListenersService
5758
/**
5859
* {@inheritdoc}
5960
*/
60-
public function provide(array $options = [])
61+
public function provide(array $options = []): PagerInterface
6162
{
6263
$options = array_replace($this->baseOptions, $options);
6364

src/Doctrine/PHPCRPagerProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Doctrine\Persistence\ManagerRegistry;
1515
use FOS\ElasticaBundle\Provider\PagerfantaPager;
16+
use FOS\ElasticaBundle\Provider\PagerInterface;
1617
use FOS\ElasticaBundle\Provider\PagerProviderInterface;
1718
use Pagerfanta\Adapter\DoctrineODMPhpcrAdapter;
1819
use Pagerfanta\Pagerfanta;
@@ -55,7 +56,7 @@ public function __construct(ManagerRegistry $doctrine, RegisterListenersService
5556
/**
5657
* {@inheritdoc}
5758
*/
58-
public function provide(array $options = [])
59+
public function provide(array $options = []): PagerInterface
5960
{
6061
$options = array_replace($this->baseOptions, $options);
6162

src/Provider/PagerProviderInterface.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,5 @@
1313

1414
interface PagerProviderInterface
1515
{
16-
/**
17-
* @return PagerInterface
18-
*/
19-
public function provide(array $options = []);
16+
public function provide(array $options = []): PagerInterface;
2017
}

src/Provider/PagerProviderRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getProviders()
4545
*
4646
* @throws \InvalidArgumentException if no provider was registered for the index and type
4747
*/
48-
public function getProvider(string $index): ?PagerProviderInterface
48+
public function getProvider(string $index): PagerProviderInterface
4949
{
5050
if (!$this->providers->has($index)) {
5151
throw new \InvalidArgumentException(sprintf('No provider was registered for index "%s".', $index));

0 commit comments

Comments
 (0)