Skip to content

Commit

Permalink
CS Fixer fixes with version 3.8.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
l-you committed Feb 29, 2024
1 parent e69a186 commit 1f31f71
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Doctrine/AbstractElasticaToModelTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public function getObjectClass(): string
*
* @param Result[] $elasticaObjects of elastica objects
*
* @return array
*
* @throws \RuntimeException
*
* @return array
*/
public function transform(array $elasticaObjects)
{
Expand Down
6 changes: 6 additions & 0 deletions src/Finder/PaginatedFinderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public function findPaginated($query, array $options = []);
* @phpstan-param TQuery $query
* @phpstan-param TOptions $options
*
* @param mixed $query
*
* @return PaginatorAdapterInterface
*/
public function createPaginatorAdapter($query, array $options = []);
Expand All @@ -55,6 +57,8 @@ public function createPaginatorAdapter($query, array $options = []);
* @phpstan-param TQuery $query
* @phpstan-param TOptions $options
*
* @param mixed $query
*
* @return PaginatorAdapterInterface
*/
public function createHybridPaginatorAdapter($query, array $options = []);
Expand All @@ -65,6 +69,8 @@ public function createHybridPaginatorAdapter($query, array $options = []);
* @phpstan-param TQuery $query
* @phpstan-param TOptions $options
*
* @param mixed $query
*
* @return PaginatorAdapterInterface
*/
public function createRawPaginatorAdapter($query, array $options = []);
Expand Down
2 changes: 2 additions & 0 deletions src/Finder/TransformedFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public function createRawPaginatorAdapter($query, array $options = [])
* @phpstan-param TQuery $query
* @phpstan-param TOptions $options
*
* @param mixed $query
*
* @return Result[]
*/
protected function search($query, ?int $limit = null, array $options = [])
Expand Down
4 changes: 2 additions & 2 deletions src/Index/AliasProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public function setRootName(IndexConfig $indexConfig, Index $index)
*
* $force will delete an index encountered where an alias is expected.
*
* @return void
*
* @throws AliasIsIndexException
*
* @return void
*/
public function switchIndexAlias(IndexConfig $indexConfig, Index $index, bool $force = false, bool $delete = true)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Index/IndexTemplateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public function __construct(array $templates)
*
* @param string $name Index template to return
*
* @return IndexTemplate
*
* @throws \InvalidArgumentException if no index template exists for the given name
*
* @return IndexTemplate
*/
public function getIndexTemplate($name)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Logger/ElasticaLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public function getQueries(): array

/**
* @param array<string, mixed> $context
* @param mixed $level
* @param mixed $message
*/
public function log($level, $message, array $context = []): void
{
Expand Down
4 changes: 2 additions & 2 deletions src/Paginator/RawPaginatorAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ public function getQuery()
* @param int $offset
* @param int $itemCountPerPage
*
* @return ResultSet
*
* @throws \InvalidArgumentException
*
* @return ResultSet
*/
protected function getElasticaResults($offset, $itemCountPerPage)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Persister/ObjectPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ public function transformToElasticaDocument(object $object): Document
/**
* Log exception if logger defined for persister belonging to the current listener, otherwise re-throw.
*
* @return void
*
* @throws BulkException
*
* @return void
*/
private function log(BulkException $e)
{
Expand Down
10 changes: 10 additions & 0 deletions src/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public function __construct(PaginatedFinderInterface $finder)
* @phpstan-param TQuery $query
* @phpstan-param TOptions $options
*
* @param mixed $query
*
* @return array<object>
*/
public function find($query, ?int $limit = null, array $options = [])
Expand All @@ -47,6 +49,8 @@ public function find($query, ?int $limit = null, array $options = [])
* @phpstan-param TQuery $query
* @phpstan-param TOptions $options
*
* @param mixed $query
*
* @return list<HybridResult>
*/
public function findHybrid($query, ?int $limit = null, array $options = [])
Expand All @@ -58,6 +62,8 @@ public function findHybrid($query, ?int $limit = null, array $options = [])
* @phpstan-param TQuery $query
* @phpstan-param TOptions $options
*
* @param mixed $query
*
* @return \Pagerfanta\Pagerfanta<object>
*/
public function findPaginated($query, array $options = [])
Expand All @@ -69,6 +75,8 @@ public function findPaginated($query, array $options = [])
* @phpstan-param TQuery $query
* @phpstan-param TOptions $options
*
* @param mixed $query
*
* @return Paginator\PaginatorAdapterInterface
*/
public function createPaginatorAdapter($query, array $options = [])
Expand All @@ -80,6 +88,8 @@ public function createPaginatorAdapter($query, array $options = [])
* @phpstan-param TQuery $query
* @phpstan-param TOptions $options
*
* @param mixed $query
*
* @return Paginator\PaginatorAdapterInterface
*/
public function createHybridPaginatorAdapter($query, array $options = [])
Expand Down
2 changes: 2 additions & 0 deletions src/Transformer/ModelToElasticaAutoTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ protected function transformNested($objects, array $fields): ?array
/**
* Attempts to convert any type to a string or an array of strings.
*
* @param mixed $value
*
* @return string|list<string>
*/
protected function normalizeValue($value)
Expand Down
2 changes: 2 additions & 0 deletions tests/Functional/ProfilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public function setUp(): void

/**
* @dataProvider queryProvider
*
* @param mixed $query
*/
public function testRender($query)
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Functional/WebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ protected static function getVarDir()

/**
* To be removed when dropping support of Symfony < 5.3.
*
* @param mixed $arguments
*/
public static function __callStatic(string $name, $arguments)
{
Expand Down
20 changes: 20 additions & 0 deletions tests/Unit/Doctrine/AbstractElasticaToModelTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ public function resultsWithMatchingObjects()

/**
* @dataProvider resultsWithMatchingObjects
*
* @param mixed $elasticaResults
* @param mixed $doctrineObjects
*/
public function testObjectsAreTransformedByFindingThemByTheirIdentifiers($elasticaResults, $doctrineObjects)
{
Expand All @@ -117,6 +120,9 @@ public function testObjectsAreTransformedByFindingThemByTheirIdentifiers($elasti

/**
* @dataProvider resultsWithMatchingObjects
*
* @param mixed $elasticaResults
* @param mixed $doctrineObjects
*/
public function testAnExceptionIsThrownWhenTheNumberOfFoundObjectsIsLessThanTheNumberOfResults(
$elasticaResults,
Expand All @@ -139,6 +145,9 @@ public function testAnExceptionIsThrownWhenTheNumberOfFoundObjectsIsLessThanTheN

/**
* @dataProvider resultsWithMatchingObjects
*
* @param mixed $elasticaResults
* @param mixed $doctrineObjects
*/
public function testAnExceptionIsNotThrownWhenTheNumberOfFoundObjectsIsLessThanTheNumberOfResultsIfOptionSet(
$elasticaResults,
Expand All @@ -160,6 +169,9 @@ public function testAnExceptionIsNotThrownWhenTheNumberOfFoundObjectsIsLessThanT

/**
* @dataProvider resultsWithMatchingObjects
*
* @param mixed $elasticaResults
* @param mixed $doctrineObjects
*/
public function testHighlightsAreSetOnTransformedObjects($elasticaResults, $doctrineObjects)
{
Expand All @@ -182,6 +194,9 @@ public function testHighlightsAreSetOnTransformedObjects($elasticaResults, $doct

/**
* @dataProvider resultsWithMatchingObjects
*
* @param mixed $elasticaResults
* @param mixed $doctrineObjects
*/
public function testResultsAreSortedByIdentifier($elasticaResults, $doctrineObjects)
{
Expand All @@ -205,6 +220,9 @@ public function testResultsAreSortedByIdentifier($elasticaResults, $doctrineObje

/**
* @dataProvider resultsWithMatchingObjects
*
* @param mixed $elasticaResults
* @param mixed $doctrineObjects
*/
public function testHybridTransformReturnsDecoratedResults($elasticaResults, $doctrineObjects)
{
Expand Down Expand Up @@ -252,6 +270,8 @@ private function createMockPropertyAccessor()
}

/**
* @param mixed $options
*
* @return \PHPUnit\Framework\MockObject\MockObject|AbstractElasticaToModelTransformer
*/
private function createMockTransformer($options = [])
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Index/IndexTemplateManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class IndexTemplateManagerTest extends TestCase
*
* @param string $name
* @param string|null $expectedException
* @param mixed $expectedTemplate
*
* @return void
*
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Logger/ElasticaLoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ public function logLevels()

/**
* @dataProvider logLevels
*
* @param mixed $level
*/
public function testMessagesCanBeLoggedAtSpecificLogLevels($level)
{
Expand Down
5 changes: 5 additions & 0 deletions tests/Unit/Provider/IndexableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public function testIndexableUnknown()

/**
* @dataProvider provideIsIndexableCallbacks
*
* @param mixed $callback
* @param mixed $return
*/
public function testValidIndexableCallbacks($callback, $return)
{
Expand All @@ -42,6 +45,8 @@ public function testValidIndexableCallbacks($callback, $return)

/**
* @dataProvider provideInvalidIsIndexableCallbacks
*
* @param mixed $callback
*/
public function testInvalidIsIndexableCallbacks($callback)
{
Expand Down

0 comments on commit 1f31f71

Please sign in to comment.