Skip to content

Update PHP-CS-Fixer version #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased v2.x]

### Changed

- (dev) Update PHP-CS-Fixer to version `3.12.0`

## [2.2.0]

### Added
Expand Down
1 change: 1 addition & 0 deletions src/Redis/Client/PhpiredisClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class PhpiredisClient extends AbstractClient

/**
* @param resource $redis
*
* @psalm-assert function_exists('phpiredis_command_bs')
* @psalm-assert function_exists('phpiredis_multi_command_bs')
*/
Expand Down
1 change: 1 addition & 0 deletions src/Redis/Client/PredisClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ protected function doPipeline(Command ...$commands): array

/**
* @param array<float|int|string> $args
*
* @codeCoverageIgnore
*/
private static function createRawCommand(array $args): CommandInterface
Expand Down
1 change: 1 addition & 0 deletions src/Redis/Command/Aggregate.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ public function getSize(): ?int
* @param array|mixed|string $data
*
* @return CursorResponse|PaginatedResponse<AggregateResponseItem>
*
* @phpstan-return CursorResponse|PaginatedResponse
*/
public function parseResponse($data)
Expand Down
3 changes: 3 additions & 0 deletions src/Redis/Command/Option/CustomValidatorOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

/**
* @template T of CommandOption
*
* @mixin T
*/
class CustomValidatorOption implements CommandOption, DecoratedCommandOption
Expand All @@ -47,6 +48,7 @@ public function __construct(CommandOption $decorated, Validatable $validator)

/**
* @phpstan-param T $decorated
*
* @psalm-param CommandOption $decorated
*
* @param array<float|int|string> $allowed
Expand All @@ -60,6 +62,7 @@ public static function allowedValues(CommandOption $decorated, array $allowed):

/**
* @phpstan-param T $decorated
*
* @psalm-param CommandOption $decorated
*
* @return static<T>
Expand Down
2 changes: 2 additions & 0 deletions src/Redis/Command/Option/DecoratedOptionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@

/**
* @template T of CommandOption
*
* @mixin T
*/
trait DecoratedOptionTrait
{
/**
* @var CommandOption
*
* @phpstan-var T
*/
private $decorated;
Expand Down
1 change: 1 addition & 0 deletions src/Redis/Command/Option/FlagOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function isActive(): bool

/**
* @return bool
*
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
*/
public function getOptionData()
Expand Down
1 change: 1 addition & 0 deletions src/Redis/Command/Option/NotEmptyOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

/**
* @template T of CommandOption
*
* @mixin T
*/
class NotEmptyOption implements CommandOption, DecoratedCommandOption
Expand Down
1 change: 1 addition & 0 deletions src/Redis/Command/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ public function setDialect(int $version): self
* @param mixed $data
*
* @return PaginatedResponse
*
* @psalm-return PaginatedResponse<SearchResponseItem>
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
Expand Down
1 change: 1 addition & 0 deletions src/Redis/Initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class Initializer
{
/**
* @codeCoverageIgnore
*
* @psalm-suppress UndefinedDocblockClass
* @psalm-suppress UndefinedClass
*
Expand Down
3 changes: 3 additions & 0 deletions src/Redis/Response/AggregateResponseItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ public function getFields(): array
* @return null|array<mixed>|float|int|string
*
* @deprecated Use ::getFieldValue instead
*
* @codeCoverageIgnore
*
* @psalm-suppress
*
* @SuppressWarnings
*/
public function getValue(string $fieldName, $default = null)
Expand Down
3 changes: 1 addition & 2 deletions src/Redis/Response/InfoResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ public function getFieldsAsOption(): array
assert($object instanceof GroupedOption);
$object->setDataOfOption('field', $fieldName);
$object = self::setOptionFlag($object, $field, 'NOINDEX', 'no_index');
$object = self::setOptionFlag($object, $field, 'SORTABLE', 'sortable');

return $object;
return self::setOptionFlag($object, $field, 'SORTABLE', 'sortable');
}, $fields);
}

Expand Down
1 change: 1 addition & 0 deletions tests/IndexBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class IndexBuilderTest extends TestCase
{
/**
* @return array<Create|IndexBuilder>
*
* @medium
*/
public function testAllSetter(): array
Expand Down
3 changes: 2 additions & 1 deletion tests/IndexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use MacFJA\RediSearch\Redis\Command\DropIndex;
use MacFJA\RediSearch\Redis\Command\TagVals;
use MacFJA\RediSearch\Redis\Response\InfoResponse;
use PHPUnit\Framework\TestCase;

/**
* @covers \MacFJA\RediSearch\Index
Expand Down Expand Up @@ -60,7 +61,7 @@
*
* @internal
*/
class IndexTest extends \PHPUnit\Framework\TestCase
class IndexTest extends TestCase
{
public function testAddDocumentFromArray(): void
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Query/Builder/FuzzyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@

use MacFJA\RediSearch\Exception\OutOfRangeLevenshteinDistanceException;
use MacFJA\RediSearch\Query\Builder\Fuzzy;
use PHPUnit\Framework\TestCase;

/**
* @covers \MacFJA\RediSearch\Exception\OutOfRangeLevenshteinDistanceException
* @covers \MacFJA\RediSearch\Query\Builder\Fuzzy
*
* @internal
*/
class FuzzyTest extends \PHPUnit\Framework\TestCase
class FuzzyTest extends TestCase
{
public function testTooLow(): void
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Query/Builder/GeoFacetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@

use MacFJA\RediSearch\Exception\UnknownUnitException;
use MacFJA\RediSearch\Query\Builder\GeoFacet;
use PHPUnit\Framework\TestCase;

/**
* @covers \MacFJA\RediSearch\Exception\UnknownUnitException
* @covers \MacFJA\RediSearch\Query\Builder\GeoFacet
*
* @internal
*/
class GeoFacetTest extends \PHPUnit\Framework\TestCase
class GeoFacetTest extends TestCase
{
public function testWrongUnit(): void
{
Expand Down
6 changes: 2 additions & 4 deletions tests/Query/Builder/IncludeSpaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,20 @@
use MacFJA\RediSearch\Query\Builder\TextFacet;
use MacFJA\RediSearch\Query\Builder\Word;
use MacFJA\RediSearch\Redis\Command\SearchCommand\GeoFilterOption;
use PHPUnit\Framework\TestCase;

/**
* @covers \MacFJA\RediSearch\Query\Builder
*
* @covers \MacFJA\RediSearch\Query\Builder\AbstractGroup
* @covers \MacFJA\RediSearch\Query\Builder\AndGroup
* @covers \MacFJA\RediSearch\Query\Builder\EncapsulationGroup
* @covers \MacFJA\RediSearch\Query\Builder\ExactMatch
* @covers \MacFJA\RediSearch\Query\Builder\FieldFacet
*
* @covers \MacFJA\RediSearch\Query\Builder\Fuzzy
* @covers \MacFJA\RediSearch\Query\Builder\GeoFacet
* @covers \MacFJA\RediSearch\Query\Builder\Negation
* @covers \MacFJA\RediSearch\Query\Builder\NumericFacet
* @covers \MacFJA\RediSearch\Query\Builder\Optional
*
* @covers \MacFJA\RediSearch\Query\Builder\OrGroup
* @covers \MacFJA\RediSearch\Query\Builder\Prefix
* @covers \MacFJA\RediSearch\Query\Builder\QueryElement::priority
Expand All @@ -69,7 +67,7 @@
*
* @internal
*/
class IncludeSpaceTest extends \PHPUnit\Framework\TestCase
class IncludeSpaceTest extends TestCase
{
public function testGroupIncludeSpace(): void
{
Expand Down
1 change: 0 additions & 1 deletion tests/Query/Builder/IncompleteFacetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
/**
* @covers \MacFJA\RediSearch\Exception\NotEnoughFieldsException
* @covers \MacFJA\RediSearch\Exception\NotEnoughTermsException
*
* @covers \MacFJA\RediSearch\Query\Builder\FieldFacet
* @covers \MacFJA\RediSearch\Query\Builder\GeoFacet
* @covers \MacFJA\RediSearch\Query\Builder\NumericFacet
Expand Down
6 changes: 2 additions & 4 deletions tests/Query/Builder/PriorityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,20 @@
use MacFJA\RediSearch\Query\Builder\TextFacet;
use MacFJA\RediSearch\Query\Builder\Word;
use MacFJA\RediSearch\Redis\Command\SearchCommand\GeoFilterOption;
use PHPUnit\Framework\TestCase;

/**
* @covers \MacFJA\RediSearch\Query\Builder
*
* @covers \MacFJA\RediSearch\Query\Builder\AbstractGroup
* @covers \MacFJA\RediSearch\Query\Builder\AndGroup
* @covers \MacFJA\RediSearch\Query\Builder\EncapsulationGroup
* @covers \MacFJA\RediSearch\Query\Builder\ExactMatch
* @covers \MacFJA\RediSearch\Query\Builder\FieldFacet
*
* @covers \MacFJA\RediSearch\Query\Builder\Fuzzy
* @covers \MacFJA\RediSearch\Query\Builder\GeoFacet
* @covers \MacFJA\RediSearch\Query\Builder\Negation
* @covers \MacFJA\RediSearch\Query\Builder\NumericFacet
* @covers \MacFJA\RediSearch\Query\Builder\Optional
*
* @covers \MacFJA\RediSearch\Query\Builder\OrGroup
* @covers \MacFJA\RediSearch\Query\Builder\Prefix
* @covers \MacFJA\RediSearch\Query\Builder\QueryElement::priority
Expand All @@ -70,7 +68,7 @@
*
* @internal
*/
class PriorityTest extends \PHPUnit\Framework\TestCase
class PriorityTest extends TestCase
{
public function testGroupPriority(): void
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Query/Builder/QueryElementAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

use MacFJA\RediSearch\Query\Builder\QueryElementAttribute;
use MacFJA\RediSearch\Query\Builder\RawElement;
use PHPUnit\Framework\TestCase;

/**
* @covers \MacFJA\RediSearch\Query\Builder\QueryElementAttribute
Expand All @@ -32,7 +33,7 @@
*
* @internal
*/
class QueryElementAttributeTest extends \PHPUnit\Framework\TestCase
class QueryElementAttributeTest extends TestCase
{
/**
* @dataProvider dataProvider
Expand Down
1 change: 0 additions & 1 deletion tests/Query/BuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
* @covers \MacFJA\RediSearch\Query\Builder\TextFacet
* @covers \MacFJA\RediSearch\Query\Builder\Word
* @covers \MacFJA\RediSearch\Query\Escaper
*
* @covers \MacFJA\RediSearch\Redis\Command\Search::addParam
*
* @uses \MacFJA\RediSearch\Redis\Command\AbstractCommand
Expand Down
3 changes: 2 additions & 1 deletion tests/Query/EscaperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
use function count;

use MacFJA\RediSearch\Query\Escaper;
use PHPUnit\Framework\TestCase;

/**
* @covers \MacFJA\RediSearch\Query\Escaper
*
* @internal
*/
class EscaperTest extends \PHPUnit\Framework\TestCase
class EscaperTest extends TestCase
{
private const TEST_TO_FIXTURE = [
'testEscapeFieldName' => 'field name',
Expand Down
3 changes: 2 additions & 1 deletion tests/Redis/Command/AbstractCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use InvalidArgumentException;
use MacFJA\RediSearch\Redis\Command\Option\NamelessOption;
use MacFJA\RediSearch\tests\fixtures\Redis\Command\FakeAbstractCommand;
use PHPUnit\Framework\TestCase;

/**
* @covers \MacFJA\RediSearch\Redis\Command\AbstractCommand
Expand All @@ -33,7 +34,7 @@
*
* @internal
*/
class AbstractCommandTest extends \PHPUnit\Framework\TestCase
class AbstractCommandTest extends TestCase
{
public function testGetRediSearchVersion(): void
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Redis/Command/AddFieldOptionTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use BadMethodCallException;
use MacFJA\RediSearch\tests\fixtures\Redis\Command\FakeAddFieldOptionTraitClass1;
use MacFJA\RediSearch\tests\fixtures\Redis\Command\FakeAddFieldOptionTraitClass2;
use PHPUnit\Framework\TestCase;

/**
* @covers \MacFJA\RediSearch\Redis\Command\AddFieldOptionTrait
Expand All @@ -39,7 +40,7 @@
*
* @internal
*/
class AddFieldOptionTraitTest extends \PHPUnit\Framework\TestCase
class AddFieldOptionTraitTest extends TestCase
{
public function testWrongParent(): void
{
Expand Down
8 changes: 3 additions & 5 deletions tests/Redis/Command/AggregateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@

/**
* @covers \MacFJA\RediSearch\Redis\Command\AbstractCommand
*
* @covers \MacFJA\RediSearch\Redis\Command\Aggregate
* @covers \MacFJA\RediSearch\Redis\Command\AggregateCommand\ApplyOption
* @covers \MacFJA\RediSearch\Redis\Command\AggregateCommand\GroupByOption
* @covers \MacFJA\RediSearch\Redis\Command\AggregateCommand\LimitOption
* @covers \MacFJA\RediSearch\Redis\Command\AggregateCommand\ReduceOption
* @covers \MacFJA\RediSearch\Redis\Command\AggregateCommand\SortByOption
*
* @covers \MacFJA\RediSearch\Redis\Command\AggregateCommand\WithCursor
*
* @uses \MacFJA\RediSearch\Redis\Command\SearchCommand\LimitOption
Expand Down Expand Up @@ -188,7 +186,7 @@ public function testFullOption(): void
'VERBATIM',
'LOAD', 2, '@geo1', '@tag1',
'GROUPBY', 1, '@text1', 'REDUCE', 'COUNT_DISTINCT', 1, '@user_id', 'REDUCE', 'AVG', 1, '@num1', 'AS', 'average',
'APPLY', '@timestamp - (@timestamp % 86400)', 'AS', 'day',
'APPLY', '@timestamp - (@timestamp % 86400)', 'AS', 'day',
'SORTBY', 3, '@text1', '@num1', 'DESC', 'MAX', 10,
'LIMIT', 12, 35,
'FILTER', "@name=='foo' && @age < 20",
Expand Down Expand Up @@ -221,9 +219,9 @@ public function testApplyOrder(): void
'@text1:"hello world"',
'VERBATIM',
'LOAD', 2, '@geo1', '@tag1',
'APPLY', 'split(@tag1)', 'AS', 'tag2',
'APPLY', 'split(@tag1)', 'AS', 'tag2',
'GROUPBY', 1, '@text1', 'REDUCE', 'COUNT_DISTINCT', 1, '@user_id', 'REDUCE', 'AVG', 1, '@num1', 'AS', 'average',
'APPLY', '@age - 1', 'AS', 'age',
'APPLY', '@age - 1', 'AS', 'age',
'SORTBY', 3, '@text1', '@num1', 'DESC', 'MAX', 10,
'LIMIT', 12, 35,
'FILTER', "@name=='foo' && @age < 20",
Expand Down
3 changes: 2 additions & 1 deletion tests/Redis/Command/AggregationCommand/ReduceOptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
namespace MacFJA\RediSearch\tests\Redis\Command\AggregationCommand;

use MacFJA\RediSearch\Redis\Command\AggregateCommand\ReduceOption;
use PHPUnit\Framework\TestCase;

/**
* @covers \MacFJA\RediSearch\Redis\Command\AggregateCommand\ReduceOption
Expand All @@ -30,7 +31,7 @@
*
* @internal
*/
class ReduceOptionTest extends \PHPUnit\Framework\TestCase
class ReduceOptionTest extends TestCase
{
public function testShorthands(): void
{
Expand Down
1 change: 0 additions & 1 deletion tests/Redis/Command/AliasAddTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

/**
* @covers \MacFJA\RediSearch\Redis\Command\AbstractCommand
*
* @covers \MacFJA\RediSearch\Redis\Command\AliasAdd
*
* @uses \MacFJA\RediSearch\Redis\Command\Option\AbstractCommandOption
Expand Down
Loading