diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 4bfcf60b..c74feb7f 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -25,6 +25,7 @@ return (new PhpCsFixer\Config) 'single_line_throw' => false, 'concat_space' => ['spacing' => 'one'], 'increment_style' => false, + 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays']] ]) ->setFinder( PhpCsFixer\Finder::create() diff --git a/tests/Predis/Command/CommandTest.php b/tests/Predis/Command/CommandTest.php index 488e4444..e58dcf4d 100644 --- a/tests/Predis/Command/CommandTest.php +++ b/tests/Predis/Command/CommandTest.php @@ -174,7 +174,7 @@ class CommandTest extends PredisTestCase */ public function testSerializeCommand(): void { - $command = new class() extends Command { + $command = new class extends Command { public function getId() { return 'Test'; diff --git a/tests/Predis/Command/PrefixableCommandTest.php b/tests/Predis/Command/PrefixableCommandTest.php index 8647f070..48603648 100644 --- a/tests/Predis/Command/PrefixableCommandTest.php +++ b/tests/Predis/Command/PrefixableCommandTest.php @@ -20,7 +20,7 @@ class PrefixableCommandTest extends PredisTestCase protected function setUp(): void { - $this->testClass = new class() extends PrefixableCommand { + $this->testClass = new class extends PrefixableCommand { public function getId() { return 'test'; diff --git a/tests/Predis/Command/Redis/AbstractCommand/BZPOPBaseTest.php b/tests/Predis/Command/Redis/AbstractCommand/BZPOPBaseTest.php index 785cc45a..ab60ccaa 100644 --- a/tests/Predis/Command/Redis/AbstractCommand/BZPOPBaseTest.php +++ b/tests/Predis/Command/Redis/AbstractCommand/BZPOPBaseTest.php @@ -26,7 +26,7 @@ class BZPOPBaseTest extends PredisTestCase { parent::setUp(); - $this->testCommand = new class() extends BZPOPBase { + $this->testCommand = new class extends BZPOPBase { public function getId(): string { return 'test'; diff --git a/tests/Predis/Command/Traits/AggregateTest.php b/tests/Predis/Command/Traits/AggregateTest.php index dee92924..25ae9653 100644 --- a/tests/Predis/Command/Traits/AggregateTest.php +++ b/tests/Predis/Command/Traits/AggregateTest.php @@ -22,7 +22,7 @@ class AggregateTest extends PredisTestCase protected function setUp(): void { - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Aggregate; public static $aggregateArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/BitByteTest.php b/tests/Predis/Command/Traits/BitByteTest.php index 6fd5a713..1d3f1807 100644 --- a/tests/Predis/Command/Traits/BitByteTest.php +++ b/tests/Predis/Command/Traits/BitByteTest.php @@ -21,7 +21,7 @@ class BitByteTest extends PredisTestCase protected function setUp(): void { - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use BitByte; public function getId() diff --git a/tests/Predis/Command/Traits/BloomFilters/BucketSizeTest.php b/tests/Predis/Command/Traits/BloomFilters/BucketSizeTest.php index 17cecf47..49e5ff29 100644 --- a/tests/Predis/Command/Traits/BloomFilters/BucketSizeTest.php +++ b/tests/Predis/Command/Traits/BloomFilters/BucketSizeTest.php @@ -24,7 +24,7 @@ class BucketSizeTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use BucketSize; public static $bucketSizeArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/BloomFilters/CapacityTest.php b/tests/Predis/Command/Traits/BloomFilters/CapacityTest.php index 4490c1e1..74b71b0d 100644 --- a/tests/Predis/Command/Traits/BloomFilters/CapacityTest.php +++ b/tests/Predis/Command/Traits/BloomFilters/CapacityTest.php @@ -24,7 +24,7 @@ class CapacityTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Capacity; public static $capacityArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/BloomFilters/ErrorTest.php b/tests/Predis/Command/Traits/BloomFilters/ErrorTest.php index e8b25e6d..50c3587b 100644 --- a/tests/Predis/Command/Traits/BloomFilters/ErrorTest.php +++ b/tests/Predis/Command/Traits/BloomFilters/ErrorTest.php @@ -24,7 +24,7 @@ class ErrorTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Error; public static $errorArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/BloomFilters/ExpansionTest.php b/tests/Predis/Command/Traits/BloomFilters/ExpansionTest.php index 0e61641e..e8dd10a2 100644 --- a/tests/Predis/Command/Traits/BloomFilters/ExpansionTest.php +++ b/tests/Predis/Command/Traits/BloomFilters/ExpansionTest.php @@ -22,7 +22,7 @@ class ExpansionTest extends PredisTestCase protected function setUp(): void { - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Expansion; public static $expansionArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/BloomFilters/ItemsTest.php b/tests/Predis/Command/Traits/BloomFilters/ItemsTest.php index bf165ba1..f0050616 100644 --- a/tests/Predis/Command/Traits/BloomFilters/ItemsTest.php +++ b/tests/Predis/Command/Traits/BloomFilters/ItemsTest.php @@ -23,7 +23,7 @@ class ItemsTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Items; public static $itemsArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/BloomFilters/MaxIterationsTest.php b/tests/Predis/Command/Traits/BloomFilters/MaxIterationsTest.php index b2b04707..f92c784a 100644 --- a/tests/Predis/Command/Traits/BloomFilters/MaxIterationsTest.php +++ b/tests/Predis/Command/Traits/BloomFilters/MaxIterationsTest.php @@ -24,7 +24,7 @@ class MaxIterationsTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use MaxIterations; public static $maxIterationsArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/BloomFilters/NoCreateTest.php b/tests/Predis/Command/Traits/BloomFilters/NoCreateTest.php index e3fb3c45..9ef602b1 100644 --- a/tests/Predis/Command/Traits/BloomFilters/NoCreateTest.php +++ b/tests/Predis/Command/Traits/BloomFilters/NoCreateTest.php @@ -24,7 +24,7 @@ class NoCreateTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use NoCreate; public static $noCreateArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/By/ByArgumentTest.php b/tests/Predis/Command/Traits/By/ByArgumentTest.php index 0fac6ea8..c8af9036 100644 --- a/tests/Predis/Command/Traits/By/ByArgumentTest.php +++ b/tests/Predis/Command/Traits/By/ByArgumentTest.php @@ -23,7 +23,7 @@ class ByArgumentTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use ByArgument; public static $byArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/By/GeoByTest.php b/tests/Predis/Command/Traits/By/GeoByTest.php index 6760872e..8bcdd99d 100644 --- a/tests/Predis/Command/Traits/By/GeoByTest.php +++ b/tests/Predis/Command/Traits/By/GeoByTest.php @@ -26,7 +26,7 @@ class GeoByTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use GeoBy; public function getId() diff --git a/tests/Predis/Command/Traits/ByLexByScoreTest.php b/tests/Predis/Command/Traits/ByLexByScoreTest.php index 4c3ed7f4..14f3a83b 100644 --- a/tests/Predis/Command/Traits/ByLexByScoreTest.php +++ b/tests/Predis/Command/Traits/ByLexByScoreTest.php @@ -25,7 +25,7 @@ class ByLexByScoreTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use ByLexByScore; public static $byLexByScoreArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/CountTest.php b/tests/Predis/Command/Traits/CountTest.php index 86f32678..bae54be0 100644 --- a/tests/Predis/Command/Traits/CountTest.php +++ b/tests/Predis/Command/Traits/CountTest.php @@ -24,7 +24,7 @@ class CountTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Count; public static $countArgumentPositionOffset = 2; diff --git a/tests/Predis/Command/Traits/DbTest.php b/tests/Predis/Command/Traits/DbTest.php index 11f259e6..abed8d91 100644 --- a/tests/Predis/Command/Traits/DbTest.php +++ b/tests/Predis/Command/Traits/DbTest.php @@ -24,7 +24,7 @@ class DbTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use DB; public static $dbArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/From/GeoFromTest.php b/tests/Predis/Command/Traits/From/GeoFromTest.php index 9916f731..ac20e55d 100644 --- a/tests/Predis/Command/Traits/From/GeoFromTest.php +++ b/tests/Predis/Command/Traits/From/GeoFromTest.php @@ -26,7 +26,7 @@ class GeoFromTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use GeoFrom; public function getId() diff --git a/tests/Predis/Command/Traits/Get/GetTest.php b/tests/Predis/Command/Traits/Get/GetTest.php index 7bf5c839..2a506fa0 100644 --- a/tests/Predis/Command/Traits/Get/GetTest.php +++ b/tests/Predis/Command/Traits/Get/GetTest.php @@ -24,7 +24,7 @@ class GetTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Get; public static $getArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/Json/IndentTest.php b/tests/Predis/Command/Traits/Json/IndentTest.php index 1b31bed0..6f59546e 100644 --- a/tests/Predis/Command/Traits/Json/IndentTest.php +++ b/tests/Predis/Command/Traits/Json/IndentTest.php @@ -22,7 +22,7 @@ class IndentTest extends PredisTestCase protected function setUp(): void { - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Indent; public static $indentArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/Json/NewlineTest.php b/tests/Predis/Command/Traits/Json/NewlineTest.php index f5bacefa..9360120e 100644 --- a/tests/Predis/Command/Traits/Json/NewlineTest.php +++ b/tests/Predis/Command/Traits/Json/NewlineTest.php @@ -22,7 +22,7 @@ class NewlineTest extends PredisTestCase protected function setUp(): void { - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Newline; public static $newlineArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/Json/NxXxArgumentTest.php b/tests/Predis/Command/Traits/Json/NxXxArgumentTest.php index 04ad1c3f..17b013e3 100644 --- a/tests/Predis/Command/Traits/Json/NxXxArgumentTest.php +++ b/tests/Predis/Command/Traits/Json/NxXxArgumentTest.php @@ -22,7 +22,7 @@ class NxXxArgumentTest extends PredisTestCase protected function setUp(): void { - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use NxXxArgument; public static $nxXxArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/Json/SpaceTest.php b/tests/Predis/Command/Traits/Json/SpaceTest.php index ef5c456b..5d7d40d6 100644 --- a/tests/Predis/Command/Traits/Json/SpaceTest.php +++ b/tests/Predis/Command/Traits/Json/SpaceTest.php @@ -22,7 +22,7 @@ class SpaceTest extends PredisTestCase protected function setUp(): void { - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Space; public static $spaceArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/KeysTest.php b/tests/Predis/Command/Traits/KeysTest.php index 58616fb9..8119f5b6 100644 --- a/tests/Predis/Command/Traits/KeysTest.php +++ b/tests/Predis/Command/Traits/KeysTest.php @@ -24,7 +24,7 @@ class KeysTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Keys; public static $keysArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/LeftRightTest.php b/tests/Predis/Command/Traits/LeftRightTest.php index b3feaf94..6c709fd8 100644 --- a/tests/Predis/Command/Traits/LeftRightTest.php +++ b/tests/Predis/Command/Traits/LeftRightTest.php @@ -22,7 +22,7 @@ class LeftRightTest extends PredisTestCase protected function setUp(): void { - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use LeftRight; public static $leftRightArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/Limit/LimitObjectTest.php b/tests/Predis/Command/Traits/Limit/LimitObjectTest.php index 2a1779fd..2d9147bf 100644 --- a/tests/Predis/Command/Traits/Limit/LimitObjectTest.php +++ b/tests/Predis/Command/Traits/Limit/LimitObjectTest.php @@ -24,7 +24,7 @@ class LimitObjectTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use LimitObject; public function getId() diff --git a/tests/Predis/Command/Traits/Limit/LimitTest.php b/tests/Predis/Command/Traits/Limit/LimitTest.php index 2fd9346c..28895f39 100644 --- a/tests/Predis/Command/Traits/Limit/LimitTest.php +++ b/tests/Predis/Command/Traits/Limit/LimitTest.php @@ -24,7 +24,7 @@ class LimitTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Limit; public static $limitArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/MinMaxModifierTest.php b/tests/Predis/Command/Traits/MinMaxModifierTest.php index 7b4ab9a3..5998a1b8 100644 --- a/tests/Predis/Command/Traits/MinMaxModifierTest.php +++ b/tests/Predis/Command/Traits/MinMaxModifierTest.php @@ -24,7 +24,7 @@ class MinMaxModifierTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use MinMaxModifier; public function getId() diff --git a/tests/Predis/Command/Traits/ReplaceTest.php b/tests/Predis/Command/Traits/ReplaceTest.php index 3fd6e180..5e661eee 100644 --- a/tests/Predis/Command/Traits/ReplaceTest.php +++ b/tests/Predis/Command/Traits/ReplaceTest.php @@ -23,7 +23,7 @@ class ReplaceTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Replace; public function getId() diff --git a/tests/Predis/Command/Traits/RevTest.php b/tests/Predis/Command/Traits/RevTest.php index e89624fa..47ff6176 100644 --- a/tests/Predis/Command/Traits/RevTest.php +++ b/tests/Predis/Command/Traits/RevTest.php @@ -24,7 +24,7 @@ class RevTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Rev; public static $revArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/StoredistTest.php b/tests/Predis/Command/Traits/StoredistTest.php index a7c65036..7d045e6f 100644 --- a/tests/Predis/Command/Traits/StoredistTest.php +++ b/tests/Predis/Command/Traits/StoredistTest.php @@ -24,7 +24,7 @@ class StoredistTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Storedist; public static $storeDistArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/TimeoutTest.php b/tests/Predis/Command/Traits/TimeoutTest.php index f6b74e78..77632747 100644 --- a/tests/Predis/Command/Traits/TimeoutTest.php +++ b/tests/Predis/Command/Traits/TimeoutTest.php @@ -24,7 +24,7 @@ class TimeoutTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Timeout; public static $timeoutArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/To/ServerToTest.php b/tests/Predis/Command/Traits/To/ServerToTest.php index db8b3d76..3a17458a 100644 --- a/tests/Predis/Command/Traits/To/ServerToTest.php +++ b/tests/Predis/Command/Traits/To/ServerToTest.php @@ -24,7 +24,7 @@ class ServerToTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use ServerTo; public static $toArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/WeightsTest.php b/tests/Predis/Command/Traits/WeightsTest.php index 7142d942..a294df01 100644 --- a/tests/Predis/Command/Traits/WeightsTest.php +++ b/tests/Predis/Command/Traits/WeightsTest.php @@ -22,7 +22,7 @@ class WeightsTest extends PredisTestCase protected function setUp(): void { - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use Weights; public static $weightsArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/With/WithCoordTest.php b/tests/Predis/Command/Traits/With/WithCoordTest.php index 68f8041d..d1272b8b 100644 --- a/tests/Predis/Command/Traits/With/WithCoordTest.php +++ b/tests/Predis/Command/Traits/With/WithCoordTest.php @@ -24,7 +24,7 @@ class WithCoordTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use WithCoord; public static $withCoordArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/With/WithDistTest.php b/tests/Predis/Command/Traits/With/WithDistTest.php index e36acb01..cb3cfe7f 100644 --- a/tests/Predis/Command/Traits/With/WithDistTest.php +++ b/tests/Predis/Command/Traits/With/WithDistTest.php @@ -24,7 +24,7 @@ class WithDistTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use WithDist; public static $withDistArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/With/WithHashTest.php b/tests/Predis/Command/Traits/With/WithHashTest.php index a6bca05c..e7690860 100644 --- a/tests/Predis/Command/Traits/With/WithHashTest.php +++ b/tests/Predis/Command/Traits/With/WithHashTest.php @@ -24,7 +24,7 @@ class WithHashTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use WithHash; public static $withHashArgumentPositionOffset = 0; diff --git a/tests/Predis/Command/Traits/With/WithScoresTest.php b/tests/Predis/Command/Traits/With/WithScoresTest.php index 82aa7319..396e14c3 100644 --- a/tests/Predis/Command/Traits/With/WithScoresTest.php +++ b/tests/Predis/Command/Traits/With/WithScoresTest.php @@ -26,7 +26,7 @@ class WithScoresTest extends PredisTestCase { parent::setUp(); - $this->testClass = new class() extends RedisCommand { + $this->testClass = new class extends RedisCommand { use WithScores; public function getId() diff --git a/tests/Predis/Connection/RelayConnectionTest.php b/tests/Predis/Connection/RelayConnectionTest.php index 68023198..e6f7ee7a 100644 --- a/tests/Predis/Connection/RelayConnectionTest.php +++ b/tests/Predis/Connection/RelayConnectionTest.php @@ -17,11 +17,11 @@ use Predis\ClientException; use Predis\Command\RawCommand; use Predis\NotSupportedException; use Predis\Response\Error as ErrorResponse; -use PredisTestCase; -use Relay\Relay; use Predis\Response\ErrorInterface as ErrorResponseInterface; +use PredisTestCase; use ReflectionClass; use Relay\Exception as RelayException; +use Relay\Relay; /** * @group ext-relay