Skip to content

Commit 7bf1fd4

Browse files
committed
New cs fixer rule
1 parent 4fe99dd commit 7bf1fd4

File tree

10 files changed

+11
-10
lines changed

10 files changed

+11
-10
lines changed

.php_cs.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ return PhpCsFixer\Config::create()
2222
'ordered_imports' => true,
2323
'phpdoc_no_empty_return' => false,
2424
'ternary_to_null_coalescing' => true,
25+
'nullable_type_declaration_for_default_null_value' => true,
2526
])
2627
->setUsingCache(true)
2728
->setFinder(

src/DataCollector/ElasticaDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(ElasticaLogger $logger)
3030
$this->logger = $logger;
3131
}
3232

33-
public function collect(Request $request, Response $response, \Throwable $exception = null)
33+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
3434
{
3535
$this->data['nb_queries'] = $this->logger->getNbQueries();
3636
$this->data['queries'] = $this->logger->getQueries();

src/Doctrine/Listener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function __construct(
8080
ObjectPersisterInterface $objectPersister,
8181
IndexableInterface $indexable,
8282
array $config = [],
83-
LoggerInterface $logger = null
83+
?LoggerInterface $logger = null
8484
) {
8585
$this->config = array_merge([
8686
'identifier' => 'id',

src/Doctrine/RepositoryManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(ManagerRegistry $managerRegistry, RepositoryManagerI
4747
/**
4848
* {@inheritdoc}
4949
*/
50-
public function addIndex(string $indexName, FinderInterface $finder, string $repositoryName = null): void
50+
public function addIndex(string $indexName, FinderInterface $finder, ?string $repositoryName = null): void
5151
{
5252
throw new \LogicException(__METHOD__.' should not be called. Call addIndex on the main repository manager');
5353
}

src/Finder/FinderInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ interface FinderInterface
1616
/**
1717
* Searches for query results within a given limit.
1818
*
19-
* @param mixed $query Can be a string, an array or an \Elastica\Query object
20-
* @param int|null $limit How many results to get
19+
* @param mixed $query Can be a string, an array or an \Elastica\Query object
20+
* @param int|null $limit How many results to get
2121
*
2222
* @return array results
2323
*/

src/Finder/PaginatedFinderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface PaginatedFinderInterface extends FinderInterface
2323
/**
2424
* Searches for query results and returns them wrapped in a paginator.
2525
*
26-
* @param mixed $query Can be a string, an array or an \Elastica\Query object
26+
* @param mixed $query Can be a string, an array or an \Elastica\Query object
2727
*
2828
* @return Pagerfanta paginated results
2929
*/

src/Manager/RepositoryManagerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface RepositoryManagerInterface
2626
* Adds index name and its finder.
2727
* Custom repository class name can also be added.
2828
*/
29-
public function addIndex(string $indexName, FinderInterface $finder, string $repositoryName = null): void;
29+
public function addIndex(string $indexName, FinderInterface $finder, ?string $repositoryName = null): void;
3030

3131
/**
3232
* Return repository for entity.

tests/Unit/Doctrine/AbstractListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ private function getMockPersister(Entity $object, $indexName)
294294
return $mock;
295295
}
296296

297-
private function getMockIndexable($indexName, Entity $object = null, $return = null)
297+
private function getMockIndexable($indexName, ?Entity $object = null, $return = null)
298298
{
299299
$mock = $this->createMock(IndexableInterface::class);
300300

tests/Unit/Elastica/ClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private function getConnectionMock()
9494
return $connection;
9595
}
9696

97-
private function getClientMock(Response $response = null, $connection = null)
97+
private function getClientMock(?Response $response = null, $connection = null)
9898
{
9999
$transport = new NullTransport();
100100
if ($response) {

tests/Unit/Subscriber/PaginateElasticaQuerySubscriberTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ protected function getResultSetMock()
295295
return $this->createMock(PartialResultsInterface::class);
296296
}
297297

298-
private function getRequestStack(Request $request = null)
298+
private function getRequestStack(?Request $request = null)
299299
{
300300
$stack = new RequestStack();
301301

0 commit comments

Comments
 (0)