From 82791e55e118377fe78852e45518b8bcade87db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Tue, 17 Jan 2023 14:41:34 -0800 Subject: [PATCH] format tests --- tests/PHPUnit/OneOfConstraint.php | 2 +- tests/PHPUnit/PredisCommandTestCase.php | 3 --- tests/PHPUnit/PredisConnectionTestCase.php | 2 +- tests/PHPUnit/PredisTestCase.php | 3 +-- tests/Predis/ClientExceptionTest.php | 3 --- tests/Predis/ClientTest.php | 3 --- .../Distributor/EmptyRingExceptionTest.php | 3 --- .../Cluster/Distributor/HashRingTest.php | 21 ++++++++----------- .../Cluster/Distributor/KetamaRingTest.php | 19 +++++++---------- tests/Predis/Cluster/Hash/CRC16Test.php | 3 --- tests/Predis/Cluster/PredisStrategyTest.php | 7 ++----- tests/Predis/Cluster/RedisStrategyTest.php | 7 ++----- tests/Predis/Cluster/SlotMapTest.php | 3 --- .../Collection/Iterator/KeyspaceTest.php | 2 -- tests/Predis/Command/CommandTest.php | 3 --- .../Processor/KeyPrefixProcessorTest.php | 3 --- .../Command/Processor/ProcessorChainTest.php | 3 --- tests/Predis/Command/RawCommandTest.php | 3 --- tests/Predis/Command/RawFactoryTest.php | 3 --- .../Redis/AbstractCommand/BZPOPBaseTest.php | 3 +-- tests/Predis/Command/Redis/BLMOVE_Test.php | 4 ++-- tests/Predis/Command/Redis/BZMPOP_Test.php | 4 ++-- tests/Predis/Command/Redis/BZPOPMAX_Test.php | 6 +++--- tests/Predis/Command/Redis/BZPOPMIN_Test.php | 6 +++--- tests/Predis/Command/Redis/COMMAND_Test.php | 6 +++--- tests/Predis/Command/Redis/COPY_Test.php | 6 +++--- .../Command/Redis/GEOSEARCHSTORE_Test.php | 6 +++--- tests/Predis/Command/Redis/GEOSEARCH_Test.php | 6 +++--- tests/Predis/Command/Redis/GETDEL_Test.php | 4 ++-- .../Predis/Command/Redis/HRANDFIELD_Test.php | 4 ++-- tests/Predis/Command/Redis/INFO_Test.php | 1 + tests/Predis/Command/Redis/LMOVE_Test.php | 4 ++-- tests/Predis/Command/Redis/PEXPIRE_Test.php | 4 ++-- tests/Predis/Command/Redis/SORT_Test.php | 2 +- .../Predis/Command/Redis/ZDIFFSTORE_Test.php | 5 ++--- tests/Predis/Command/Redis/ZDIFF_test.php | 6 +++--- .../Predis/Command/Redis/ZINTERCARD_Test.php | 4 ++-- tests/Predis/Command/Redis/ZINTER_Test.php | 6 +++--- tests/Predis/Command/Redis/ZMPOP_Test.php | 4 ++-- tests/Predis/Command/Redis/ZMSCORE_Test.php | 7 +++---- tests/Predis/Command/Redis/ZPOPMAX_Test.php | 1 - .../Predis/Command/Redis/ZRANDMEMBER_test.php | 7 +++---- .../Predis/Command/Redis/ZRANGESTORE_Test.php | 4 ++-- tests/Predis/Command/Redis/ZUNION_Test.php | 7 +++---- tests/Predis/Command/RedisFactoryTest.php | 3 --- tests/Predis/Command/ScriptCommandTest.php | 4 ++-- tests/Predis/Command/Traits/AggregateTest.php | 2 +- tests/Predis/Command/Traits/By/GeoByTest.php | 2 +- .../Command/Traits/ByLexByScoreTest.php | 2 +- tests/Predis/Command/Traits/CountTest.php | 2 +- tests/Predis/Command/Traits/DbTest.php | 2 +- .../Command/Traits/From/GeoFromTest.php | 2 +- tests/Predis/Command/Traits/KeysTest.php | 2 +- tests/Predis/Command/Traits/LeftRightTest.php | 4 ++-- tests/Predis/Command/Traits/LimitTest.php | 2 +- .../Command/Traits/MinMaxModifierTest.php | 2 +- tests/Predis/Command/Traits/ReplaceTest.php | 4 ++-- tests/Predis/Command/Traits/RevTest.php | 2 +- tests/Predis/Command/Traits/StoredistTest.php | 2 +- tests/Predis/Command/Traits/TimeoutTest.php | 2 +- .../Predis/Command/Traits/To/ServerToTest.php | 2 +- tests/Predis/Command/Traits/WeightsTest.php | 3 +-- .../Command/Traits/With/WithCoordTest.php | 2 +- .../Command/Traits/With/WithDistTest.php | 2 +- .../Command/Traits/With/WithHashTest.php | 2 +- .../Command/Traits/With/WithScoresTest.php | 2 +- tests/Predis/CommunicationExceptionTest.php | 5 +---- .../Configuration/Option/AggregateTest.php | 5 ----- .../Predis/Configuration/Option/CRC16Test.php | 3 --- .../Configuration/Option/ClusterTest.php | 3 --- .../Configuration/Option/CommandsTest.php | 5 +---- .../Configuration/Option/ConnectionsTest.php | 3 --- .../Configuration/Option/ExceptionsTest.php | 3 --- .../Configuration/Option/PrefixTest.php | 3 --- .../Configuration/Option/ReplicationTest.php | 3 --- .../Connection/Cluster/PredisClusterTest.php | 5 +---- .../CompositeStreamConnectionTest.php | 5 +---- .../Connection/ConnectionExceptionTest.php | 3 --- tests/Predis/Connection/FactoryTest.php | 5 ----- tests/Predis/Connection/ParametersTest.php | 3 --- .../PhpiredisSocketConnectionTest.php | 2 +- .../PhpiredisStreamConnectionTest.php | 2 +- .../MasterSlaveReplicationTest.php | 15 ++++++------- .../Replication/SentinelReplicationTest.php | 11 ++++------ .../Connection/StreamConnectionTest.php | 5 +---- tests/Predis/Pipeline/AtomicTest.php | 3 --- tests/Predis/Pipeline/FireAndForgetTest.php | 3 --- tests/Predis/Pipeline/PipelineTest.php | 3 --- tests/Predis/PredisExceptionTest.php | 3 --- .../Predis/Protocol/ProtocolExceptionTest.php | 3 --- .../Text/CompositeProtocolProcessorTest.php | 3 --- .../Text/Handler/BulkResponseTest.php | 3 --- .../Text/Handler/ErrorResponseTest.php | 3 --- .../Text/Handler/IntegerResponseTest.php | 3 --- .../Text/Handler/MultiBulkResponseTest.php | 3 --- .../Text/Handler/StatusResponseTest.php | 3 --- .../StreamableMultiBulkResponseTest.php | 3 --- .../Protocol/Text/ProtocolProcessorTest.php | 3 --- .../Protocol/Text/RequestSerializerTest.php | 3 --- .../Protocol/Text/ResponseReaderTest.php | 3 --- .../Replication/ReplicationStrategyTest.php | 3 --- tests/Predis/Response/ErrorTest.php | 5 +---- .../Response/Iterator/MultiBulkTest.php | 2 +- tests/Predis/Response/ServerExceptionTest.php | 5 +---- tests/Predis/Response/StatusTest.php | 3 --- .../AbortedMultiExecExceptionTest.php | 3 --- .../Predis/Transaction/MultiExecStateTest.php | 8 +++---- tests/Predis/Transaction/MultiExecTest.php | 8 ++++--- tests/bootstrap.php | 2 +- 109 files changed, 134 insertions(+), 304 deletions(-) diff --git a/tests/PHPUnit/OneOfConstraint.php b/tests/PHPUnit/OneOfConstraint.php index 025e65ff..7c30cdbd 100644 --- a/tests/PHPUnit/OneOfConstraint.php +++ b/tests/PHPUnit/OneOfConstraint.php @@ -53,7 +53,7 @@ class OneOfConstraint extends Constraint } /** - * @inheritDoc + * {@inheritDoc} */ public function toString(): string { diff --git a/tests/PHPUnit/PredisCommandTestCase.php b/tests/PHPUnit/PredisCommandTestCase.php index 26b7b52c..ac4f5dde 100644 --- a/tests/PHPUnit/PredisCommandTestCase.php +++ b/tests/PHPUnit/PredisCommandTestCase.php @@ -17,9 +17,6 @@ use Predis\Command; use Predis\Command\CommandInterface; use PredisTestCase; -/** - * - */ abstract class PredisCommandTestCase extends PredisTestCase { /** diff --git a/tests/PHPUnit/PredisConnectionTestCase.php b/tests/PHPUnit/PredisConnectionTestCase.php index f96d2756..89e9419e 100644 --- a/tests/PHPUnit/PredisConnectionTestCase.php +++ b/tests/PHPUnit/PredisConnectionTestCase.php @@ -556,7 +556,7 @@ abstract class PredisConnectionTestCase extends PredisTestCase * * @return string */ - protected abstract function getConnectionClass(): string; + abstract protected function getConnectionClass(): string; /** * Returns a named array with the default connection parameters and their values. diff --git a/tests/PHPUnit/PredisTestCase.php b/tests/PHPUnit/PredisTestCase.php index 09d80e3e..095c452c 100644 --- a/tests/PHPUnit/PredisTestCase.php +++ b/tests/PHPUnit/PredisTestCase.php @@ -292,9 +292,8 @@ abstract class PredisTestCase extends \PHPUnit\Framework\TestCase /** * Returns the server version of the Redis instance used by the test suite. * - * @throws RuntimeException When the client cannot retrieve the current server version - * * @return string + * @throws RuntimeException When the client cannot retrieve the current server version */ protected function getRedisServerVersion(): string { diff --git a/tests/Predis/ClientExceptionTest.php b/tests/Predis/ClientExceptionTest.php index 796c3957..a83bcdc1 100644 --- a/tests/Predis/ClientExceptionTest.php +++ b/tests/Predis/ClientExceptionTest.php @@ -14,9 +14,6 @@ namespace Predis; use PredisTestCase; -/** - * - */ class ClientExceptionTest extends PredisTestCase { /** diff --git a/tests/Predis/ClientTest.php b/tests/Predis/ClientTest.php index 3fca4cd8..3051fb9b 100644 --- a/tests/Predis/ClientTest.php +++ b/tests/Predis/ClientTest.php @@ -23,9 +23,6 @@ use PredisTestCase; use ReflectionProperty; use stdClass; -/** - * - */ class ClientTest extends PredisTestCase { /** diff --git a/tests/Predis/Cluster/Distributor/EmptyRingExceptionTest.php b/tests/Predis/Cluster/Distributor/EmptyRingExceptionTest.php index e94fc613..2ebdb95c 100644 --- a/tests/Predis/Cluster/Distributor/EmptyRingExceptionTest.php +++ b/tests/Predis/Cluster/Distributor/EmptyRingExceptionTest.php @@ -14,9 +14,6 @@ namespace Predis\Cluster\Distributor; use PredisTestCase; -/** - * - */ class EmptyRingExceptionTest extends PredisTestCase { /** diff --git a/tests/Predis/Cluster/Distributor/HashRingTest.php b/tests/Predis/Cluster/Distributor/HashRingTest.php index 47b5dc7d..1134d3c4 100644 --- a/tests/Predis/Cluster/Distributor/HashRingTest.php +++ b/tests/Predis/Cluster/Distributor/HashRingTest.php @@ -12,9 +12,6 @@ namespace Predis\Cluster\Distributor; -/** - * - */ class HashRingTest extends PredisDistributorTestCase { /** @@ -159,10 +156,10 @@ class HashRingTest extends PredisDistributorTestCase $this->assertSame('127.0.0.1:7001', $ring->getByHash(PHP_INT_SIZE == 4 ? -1249390087 : 3045577209)); // uid:256 $this->assertSame('127.0.0.1:7001', $ring->getByHash(PHP_INT_SIZE == 4 ? -1639106025 : 2655861271)); // uid:281 - $this->assertSame('127.0.0.1:7000', $ring->getByHash(PHP_INT_SIZE == 4 ? -683361581 : 3611605715)); // uid:312 - $this->assertSame('127.0.0.1:7001', $ring->getByHash(PHP_INT_SIZE == 4 ? -532820268 : 3762147028)); // uid:432 - $this->assertSame('127.0.0.1:7002', $ring->getByHash(PHP_INT_SIZE == 4 ? 618436108 : 618436108)); // uid:500 - $this->assertSame('127.0.0.1:7000', $ring->getByHash(PHP_INT_SIZE == 4 ? 905043399 : 905043399)); // uid:641 + $this->assertSame('127.0.0.1:7000', $ring->getByHash(PHP_INT_SIZE == 4 ? -683361581 : 3611605715)); // uid:312 + $this->assertSame('127.0.0.1:7001', $ring->getByHash(PHP_INT_SIZE == 4 ? -532820268 : 3762147028)); // uid:432 + $this->assertSame('127.0.0.1:7002', $ring->getByHash(PHP_INT_SIZE == 4 ? 618436108 : 618436108)); // uid:500 + $this->assertSame('127.0.0.1:7000', $ring->getByHash(PHP_INT_SIZE == 4 ? 905043399 : 905043399)); // uid:641 } /** @@ -178,14 +175,14 @@ class HashRingTest extends PredisDistributorTestCase $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? -1255075679 : 3039891617)); // uid:256 $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? -1642314910 : 2652652386)); // uid:281 - $this->assertSame('127.0.0.1:7000', $ring->getBySlot(PHP_INT_SIZE == 4 ? -687739295 : 3607228001)); // uid:312 - $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? -544842345 : 3750124951)); // uid:432 - $this->assertSame('127.0.0.1:7002', $ring->getBySlot(PHP_INT_SIZE == 4 ? 609245004 : 609245004)); // uid:500 - $this->assertSame('127.0.0.1:7000', $ring->getBySlot(PHP_INT_SIZE == 4 ? 902549909 : 902549909)); // uid:641 + $this->assertSame('127.0.0.1:7000', $ring->getBySlot(PHP_INT_SIZE == 4 ? -687739295 : 3607228001)); // uid:312 + $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? -544842345 : 3750124951)); // uid:432 + $this->assertSame('127.0.0.1:7002', $ring->getBySlot(PHP_INT_SIZE == 4 ? 609245004 : 609245004)); // uid:500 + $this->assertSame('127.0.0.1:7000', $ring->getBySlot(PHP_INT_SIZE == 4 ? 902549909 : 902549909)); // uid:641 // Test first and last slots $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? -2096102881 : 2198864415)); - $this->assertSame('127.0.0.1:7002', $ring->getBySlot(PHP_INT_SIZE == 4 ? 2146453549 : 2146453549)); + $this->assertSame('127.0.0.1:7002', $ring->getBySlot(PHP_INT_SIZE == 4 ? 2146453549 : 2146453549)); // Test non-existing slot $this->assertNull($ring->getBySlot(0)); diff --git a/tests/Predis/Cluster/Distributor/KetamaRingTest.php b/tests/Predis/Cluster/Distributor/KetamaRingTest.php index 119d3a6f..f3845ff2 100644 --- a/tests/Predis/Cluster/Distributor/KetamaRingTest.php +++ b/tests/Predis/Cluster/Distributor/KetamaRingTest.php @@ -12,9 +12,6 @@ namespace Predis\Cluster\Distributor; -/** - * - */ class KetamaRingTest extends PredisDistributorTestCase { /** @@ -158,12 +155,12 @@ class KetamaRingTest extends PredisDistributorTestCase '127.0.0.1:7002', ]); - $this->assertSame('127.0.0.1:7001', $ring->getByHash(PHP_INT_SIZE == 4 ? -591277534 : 3703689762)); // uid:256 + $this->assertSame('127.0.0.1:7001', $ring->getByHash(PHP_INT_SIZE == 4 ? -591277534 : 3703689762)); // uid:256 $this->assertSame('127.0.0.1:7002', $ring->getByHash(PHP_INT_SIZE == 4 ? -1632011260 : 2662956036)); // uid:281 - $this->assertSame('127.0.0.1:7001', $ring->getByHash(PHP_INT_SIZE == 4 ? 345494622 : 345494622)); // uid:312 + $this->assertSame('127.0.0.1:7001', $ring->getByHash(PHP_INT_SIZE == 4 ? 345494622 : 345494622)); // uid:312 $this->assertSame('127.0.0.1:7000', $ring->getByHash(PHP_INT_SIZE == 4 ? -1042625818 : 3252341478)); // uid:432 - $this->assertSame('127.0.0.1:7000', $ring->getByHash(PHP_INT_SIZE == 4 ? -465463623 : 3829503673)); // uid:500 - $this->assertSame('127.0.0.1:7002', $ring->getByHash(PHP_INT_SIZE == 4 ? 2141928822 : 2141928822)); // uid:641 + $this->assertSame('127.0.0.1:7000', $ring->getByHash(PHP_INT_SIZE == 4 ? -465463623 : 3829503673)); // uid:500 + $this->assertSame('127.0.0.1:7002', $ring->getByHash(PHP_INT_SIZE == 4 ? 2141928822 : 2141928822)); // uid:641 } /** @@ -177,16 +174,16 @@ class KetamaRingTest extends PredisDistributorTestCase '127.0.0.1:7002', ]); - $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? -585685153 : 3709282143)); // uid:256 + $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? -585685153 : 3709282143)); // uid:256 $this->assertSame('127.0.0.1:7002', $ring->getBySlot(PHP_INT_SIZE == 4 ? -1617239533 : 2677727763)); // uid:281 - $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? 353009954 : 353009954)); // uid:312 + $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? 353009954 : 353009954)); // uid:312 $this->assertSame('127.0.0.1:7000', $ring->getBySlot(PHP_INT_SIZE == 4 ? -1037794023 : 3257173273)); // uid:432 - $this->assertSame('127.0.0.1:7000', $ring->getBySlot(PHP_INT_SIZE == 4 ? -458724341 : 3836242955)); // uid:500 + $this->assertSame('127.0.0.1:7000', $ring->getBySlot(PHP_INT_SIZE == 4 ? -458724341 : 3836242955)); // uid:500 $this->assertSame('127.0.0.1:7002', $ring->getBySlot(PHP_INT_SIZE == 4 ? -2143763192 : 2151204104)); // uid:641 // Test first and last slots $this->assertSame('127.0.0.1:7002', $ring->getBySlot(PHP_INT_SIZE == 4 ? -2135629153 : 2159338143)); - $this->assertSame('127.0.0.1:7000', $ring->getBySlot(PHP_INT_SIZE == 4 ? 2137506232 : 2137506232)); + $this->assertSame('127.0.0.1:7000', $ring->getBySlot(PHP_INT_SIZE == 4 ? 2137506232 : 2137506232)); // Test non-existing slot $this->assertNull($ring->getBySlot(0)); diff --git a/tests/Predis/Cluster/Hash/CRC16Test.php b/tests/Predis/Cluster/Hash/CRC16Test.php index 21148fce..11d856dd 100644 --- a/tests/Predis/Cluster/Hash/CRC16Test.php +++ b/tests/Predis/Cluster/Hash/CRC16Test.php @@ -14,9 +14,6 @@ namespace Predis\Cluster\Hash; use PredisTestCase; -/** - * - */ class CRC16Test extends PredisTestCase { /** diff --git a/tests/Predis/Cluster/PredisStrategyTest.php b/tests/Predis/Cluster/PredisStrategyTest.php index 3b69eb0b..594c4ed3 100644 --- a/tests/Predis/Cluster/PredisStrategyTest.php +++ b/tests/Predis/Cluster/PredisStrategyTest.php @@ -15,9 +15,6 @@ namespace Predis\Cluster; use PHPUnit\Framework\MockObject\MockObject; use PredisTestCase; -/** - * - */ class PredisStrategyTest extends PredisTestCase { /** @@ -36,9 +33,9 @@ class PredisStrategyTest extends PredisTestCase $this->assertSame($expected, $strategy->getSlotByKey('bar:{foo}:{baz}')); $this->assertSame($expected, $strategy->getSlotByKey('bar:{foo}:baz{}')); - $this->assertSame(PHP_INT_SIZE == 4 ? -1355751440 : 2939215856, $strategy->getSlotByKey('{}bar:{foo}:baz')); + $this->assertSame(PHP_INT_SIZE == 4 ? -1355751440 : 2939215856, $strategy->getSlotByKey('{}bar:{foo}:baz')); - $this->assertSame(PHP_INT_SIZE == 4 ? -18873278 : 4276094018, $strategy->getSlotByKey('')); + $this->assertSame(PHP_INT_SIZE == 4 ? -18873278 : 4276094018, $strategy->getSlotByKey('')); $this->assertSame(PHP_INT_SIZE == 4 ? -1574052038 : 2720915258, $strategy->getSlotByKey('{}')); } diff --git a/tests/Predis/Cluster/RedisStrategyTest.php b/tests/Predis/Cluster/RedisStrategyTest.php index bebecab3..d19eec85 100644 --- a/tests/Predis/Cluster/RedisStrategyTest.php +++ b/tests/Predis/Cluster/RedisStrategyTest.php @@ -15,9 +15,6 @@ namespace Predis\Cluster; use PHPUnit\Framework\MockObject\MockObject; use PredisTestCase; -/** - * - */ class RedisStrategyTest extends PredisTestCase { /** @@ -34,9 +31,9 @@ class RedisStrategyTest extends PredisTestCase $this->assertSame(12182, $strategy->getSlotByKey('bar:{foo}:{baz}')); $this->assertSame(12182, $strategy->getSlotByKey('bar:{foo}:baz{}')); - $this->assertSame(9415, $strategy->getSlotByKey('{}bar:{foo}:baz')); + $this->assertSame(9415, $strategy->getSlotByKey('{}bar:{foo}:baz')); - $this->assertSame(0, $strategy->getSlotByKey('')); + $this->assertSame(0, $strategy->getSlotByKey('')); $this->assertSame(15257, $strategy->getSlotByKey('{}')); } diff --git a/tests/Predis/Cluster/SlotMapTest.php b/tests/Predis/Cluster/SlotMapTest.php index 6be35786..fac1b8df 100644 --- a/tests/Predis/Cluster/SlotMapTest.php +++ b/tests/Predis/Cluster/SlotMapTest.php @@ -14,9 +14,6 @@ namespace Predis\Cluster; use PredisTestCase; -/** - * - */ class SlotMapTest extends PredisTestCase { /** diff --git a/tests/Predis/Collection/Iterator/KeyspaceTest.php b/tests/Predis/Collection/Iterator/KeyspaceTest.php index d3fb12c7..eb7cb487 100644 --- a/tests/Predis/Collection/Iterator/KeyspaceTest.php +++ b/tests/Predis/Collection/Iterator/KeyspaceTest.php @@ -389,7 +389,6 @@ class KeyspaceTest extends PredisTestCase ->method('getCommandFactory') ->willReturn($this->getCommandFactory()); - $client ->expects($this->exactly(2)) ->method('scan') @@ -473,7 +472,6 @@ class KeyspaceTest extends PredisTestCase ->method('getCommandFactory') ->willReturn($this->getCommandFactory()); - $client ->expects($this->exactly(2)) ->method('scan') diff --git a/tests/Predis/Command/CommandTest.php b/tests/Predis/Command/CommandTest.php index 63d3c98a..00121c5c 100644 --- a/tests/Predis/Command/CommandTest.php +++ b/tests/Predis/Command/CommandTest.php @@ -15,9 +15,6 @@ namespace Predis\Command; use PredisTestCase; use stdClass; -/** - * - */ class CommandTest extends PredisTestCase { /** diff --git a/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php index 171952c9..6a246ec2 100644 --- a/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php +++ b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php @@ -18,9 +18,6 @@ use Predis\Command\RawCommand; use PredisTestCase; use stdClass; -/** - * - */ class KeyPrefixProcessorTest extends PredisTestCase { /** diff --git a/tests/Predis/Command/Processor/ProcessorChainTest.php b/tests/Predis/Command/Processor/ProcessorChainTest.php index a0f97596..fd00fa65 100644 --- a/tests/Predis/Command/Processor/ProcessorChainTest.php +++ b/tests/Predis/Command/Processor/ProcessorChainTest.php @@ -16,9 +16,6 @@ use Predis\Command\CommandInterface; use PredisTestCase; use stdClass; -/** - * - */ class ProcessorChainTest extends PredisTestCase { /** diff --git a/tests/Predis/Command/RawCommandTest.php b/tests/Predis/Command/RawCommandTest.php index 55097aef..f7597108 100644 --- a/tests/Predis/Command/RawCommandTest.php +++ b/tests/Predis/Command/RawCommandTest.php @@ -14,9 +14,6 @@ namespace Predis\Command; use PredisTestCase; -/** - * - */ class RawCommandTest extends PredisTestCase { /** diff --git a/tests/Predis/Command/RawFactoryTest.php b/tests/Predis/Command/RawFactoryTest.php index f94a2337..888771aa 100644 --- a/tests/Predis/Command/RawFactoryTest.php +++ b/tests/Predis/Command/RawFactoryTest.php @@ -14,9 +14,6 @@ namespace Predis\Command; use PredisTestCase; -/** - * - */ class RawFactoryTest extends PredisTestCase { /** diff --git a/tests/Predis/Command/Redis/AbstractCommand/BZPOPBaseTest.php b/tests/Predis/Command/Redis/AbstractCommand/BZPOPBaseTest.php index 03d9df28..785cc45a 100644 --- a/tests/Predis/Command/Redis/AbstractCommand/BZPOPBaseTest.php +++ b/tests/Predis/Command/Redis/AbstractCommand/BZPOPBaseTest.php @@ -26,8 +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/Redis/BLMOVE_Test.php b/tests/Predis/Command/Redis/BLMOVE_Test.php index 5081a4ec..8e1c5b36 100644 --- a/tests/Predis/Command/Redis/BLMOVE_Test.php +++ b/tests/Predis/Command/Redis/BLMOVE_Test.php @@ -17,7 +17,7 @@ use Predis\Response\ServerException; class BLMOVE_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -25,7 +25,7 @@ class BLMOVE_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { diff --git a/tests/Predis/Command/Redis/BZMPOP_Test.php b/tests/Predis/Command/Redis/BZMPOP_Test.php index 805a8224..8e4da84f 100644 --- a/tests/Predis/Command/Redis/BZMPOP_Test.php +++ b/tests/Predis/Command/Redis/BZMPOP_Test.php @@ -18,7 +18,7 @@ use UnexpectedValueException; class BZMPOP_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -26,7 +26,7 @@ class BZMPOP_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { diff --git a/tests/Predis/Command/Redis/BZPOPMAX_Test.php b/tests/Predis/Command/Redis/BZPOPMAX_Test.php index 89486958..a83149fb 100644 --- a/tests/Predis/Command/Redis/BZPOPMAX_Test.php +++ b/tests/Predis/Command/Redis/BZPOPMAX_Test.php @@ -18,7 +18,7 @@ use UnexpectedValueException; class BZPOPMAX_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -26,7 +26,7 @@ class BZPOPMAX_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { @@ -47,7 +47,7 @@ class BZPOPMAX_Test extends PredisCommandTestCase $redis->zadd('test-bzpopmax', ...$sortedSetDictionary); - $this->assertSame($expectedResponse, $redis->bzpopmax(['empty sorted set','test-bzpopmax'], 0)); + $this->assertSame($expectedResponse, $redis->bzpopmax(['empty sorted set', 'test-bzpopmax'], 0)); $this->assertSame($expectedModifiedSortedSet, $redis->zrange('test-bzpopmax', 0, -1)); } diff --git a/tests/Predis/Command/Redis/BZPOPMIN_Test.php b/tests/Predis/Command/Redis/BZPOPMIN_Test.php index bc893dff..e24c26c2 100644 --- a/tests/Predis/Command/Redis/BZPOPMIN_Test.php +++ b/tests/Predis/Command/Redis/BZPOPMIN_Test.php @@ -18,7 +18,7 @@ use UnexpectedValueException; class BZPOPMIN_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -26,7 +26,7 @@ class BZPOPMIN_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { @@ -47,7 +47,7 @@ class BZPOPMIN_Test extends PredisCommandTestCase $redis->zadd('test-bzpopmin', ...$sortedSetDictionary); - $this->assertSame($expectedResponse, $redis->bzpopmin(['empty sorted set','test-bzpopmin'], 0)); + $this->assertSame($expectedResponse, $redis->bzpopmin(['empty sorted set', 'test-bzpopmin'], 0)); $this->assertSame($expectedModifiedSortedSet, $redis->zrange('test-bzpopmin', 0, -1)); } diff --git a/tests/Predis/Command/Redis/COMMAND_Test.php b/tests/Predis/Command/Redis/COMMAND_Test.php index a19aa5b9..988661d4 100644 --- a/tests/Predis/Command/Redis/COMMAND_Test.php +++ b/tests/Predis/Command/Redis/COMMAND_Test.php @@ -125,11 +125,11 @@ class COMMAND_Test extends PredisCommandTestCase $expected[0][] = [ [ 'flags', - ['RO','access'], + ['RO', 'access'], 'begin_search', - ['type','index','spec', ['index',1]], + ['type', 'index', 'spec', ['index', 1]], 'find_keys', - ['type','range','spec', ['lastkey',0,'keystep',1,'limit',0]], + ['type', 'range', 'spec', ['lastkey', 0, 'keystep', 1, 'limit', 0]], ], ]; $expected[0][] = []; diff --git a/tests/Predis/Command/Redis/COPY_Test.php b/tests/Predis/Command/Redis/COPY_Test.php index 6aa77d2e..241a1521 100644 --- a/tests/Predis/Command/Redis/COPY_Test.php +++ b/tests/Predis/Command/Redis/COPY_Test.php @@ -15,15 +15,15 @@ namespace Predis\Command\Redis; class COPY_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { - return COPY::class; + return COPY::class; } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { diff --git a/tests/Predis/Command/Redis/GEOSEARCHSTORE_Test.php b/tests/Predis/Command/Redis/GEOSEARCHSTORE_Test.php index 6eb1259c..3924cda8 100644 --- a/tests/Predis/Command/Redis/GEOSEARCHSTORE_Test.php +++ b/tests/Predis/Command/Redis/GEOSEARCHSTORE_Test.php @@ -24,7 +24,7 @@ use UnexpectedValueException; class GEOSEARCHSTORE_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -32,7 +32,7 @@ class GEOSEARCHSTORE_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { @@ -169,7 +169,7 @@ class GEOSEARCHSTORE_Test extends PredisCommandTestCase ['destination', 'source', 'FROMLONLAT', 1.1, 2.2, 'BYRADIUS', 1, 'km'], ], 'with default arguments - FROMMEMBER, BYBOX' => [ - ['destination', 'source', new FromMember('member'), new ByBox(1,1, 'km')], + ['destination', 'source', new FromMember('member'), new ByBox(1, 1, 'km')], ['destination', 'source', 'FROMMEMBER', 'member', 'BYBOX', 1, 1, 'km'], ], 'with ASC sorting' => [ diff --git a/tests/Predis/Command/Redis/GEOSEARCH_Test.php b/tests/Predis/Command/Redis/GEOSEARCH_Test.php index 9a7bb1c8..ea640e00 100644 --- a/tests/Predis/Command/Redis/GEOSEARCH_Test.php +++ b/tests/Predis/Command/Redis/GEOSEARCH_Test.php @@ -24,7 +24,7 @@ use UnexpectedValueException; class GEOSEARCH_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -32,7 +32,7 @@ class GEOSEARCH_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { @@ -136,7 +136,7 @@ class GEOSEARCH_Test extends PredisCommandTestCase ['key', 'FROMLONLAT', 1.1, 2.2, 'BYRADIUS', 1, 'km'], ], 'with default arguments - FROMMEMBER, BYBOX' => [ - ['key', new FromMember('member'), new ByBox(1,1, 'km')], + ['key', new FromMember('member'), new ByBox(1, 1, 'km')], ['key', 'FROMMEMBER', 'member', 'BYBOX', 1, 1, 'km'], ], 'with ASC sorting' => [ diff --git a/tests/Predis/Command/Redis/GETDEL_Test.php b/tests/Predis/Command/Redis/GETDEL_Test.php index c1db851f..9cf0207f 100644 --- a/tests/Predis/Command/Redis/GETDEL_Test.php +++ b/tests/Predis/Command/Redis/GETDEL_Test.php @@ -15,7 +15,7 @@ namespace Predis\Command\Redis; class GETDEL_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -23,7 +23,7 @@ class GETDEL_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { diff --git a/tests/Predis/Command/Redis/HRANDFIELD_Test.php b/tests/Predis/Command/Redis/HRANDFIELD_Test.php index 8f920973..e706e47a 100644 --- a/tests/Predis/Command/Redis/HRANDFIELD_Test.php +++ b/tests/Predis/Command/Redis/HRANDFIELD_Test.php @@ -17,7 +17,7 @@ use Predis\Response\ServerException; class HRANDFIELD_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -25,7 +25,7 @@ class HRANDFIELD_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { diff --git a/tests/Predis/Command/Redis/INFO_Test.php b/tests/Predis/Command/Redis/INFO_Test.php index d5920910..e6015e12 100644 --- a/tests/Predis/Command/Redis/INFO_Test.php +++ b/tests/Predis/Command/Redis/INFO_Test.php @@ -312,6 +312,7 @@ BUFFER; $this->assertIsArray($info = $redis->executeCommand($command)); $this->assertArrayHasKey('redis_version', isset($info['Server']) ? $info['Server'] : $info); } + /** * @group connected * @requiresRedisVersion < 2.6.0 diff --git a/tests/Predis/Command/Redis/LMOVE_Test.php b/tests/Predis/Command/Redis/LMOVE_Test.php index 517a72f9..7a105bad 100644 --- a/tests/Predis/Command/Redis/LMOVE_Test.php +++ b/tests/Predis/Command/Redis/LMOVE_Test.php @@ -21,7 +21,7 @@ use Predis\Response\ServerException; class LMOVE_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -29,7 +29,7 @@ class LMOVE_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { diff --git a/tests/Predis/Command/Redis/PEXPIRE_Test.php b/tests/Predis/Command/Redis/PEXPIRE_Test.php index c1e24dc2..158a4fd6 100644 --- a/tests/Predis/Command/Redis/PEXPIRE_Test.php +++ b/tests/Predis/Command/Redis/PEXPIRE_Test.php @@ -104,8 +104,8 @@ class PEXPIRE_Test extends PredisCommandTestCase $this->sleep(0.5); $this->assertThat($redis->pttl('foo'), $this->logicalAnd( - $this->lessThanOrEqual($ttl), $this->greaterThan($ttl - 800) - )); + $this->lessThanOrEqual($ttl), $this->greaterThan($ttl - 800) + )); } /** diff --git a/tests/Predis/Command/Redis/SORT_Test.php b/tests/Predis/Command/Redis/SORT_Test.php index 3fe5ba96..fb4ea777 100644 --- a/tests/Predis/Command/Redis/SORT_Test.php +++ b/tests/Predis/Command/Redis/SORT_Test.php @@ -193,7 +193,7 @@ class SORT_Test extends PredisCommandTestCase $unordered ); - $this->assertEquals([1, 2, 3, 10, 30, 100], $redis->lrange('list:ordered', 0, -1)); + $this->assertEquals([1, 2, 3, 10, 30, 100], $redis->lrange('list:ordered', 0, -1)); } /** diff --git a/tests/Predis/Command/Redis/ZDIFFSTORE_Test.php b/tests/Predis/Command/Redis/ZDIFFSTORE_Test.php index ba62d088..b3aa05ab 100644 --- a/tests/Predis/Command/Redis/ZDIFFSTORE_Test.php +++ b/tests/Predis/Command/Redis/ZDIFFSTORE_Test.php @@ -15,7 +15,7 @@ namespace Predis\Command\Redis; class ZDIFFSTORE_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -23,7 +23,7 @@ class ZDIFFSTORE_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { @@ -78,7 +78,6 @@ class ZDIFFSTORE_Test extends PredisCommandTestCase $this->assertSame($expectedResponse, $redis->zrange('zdiffstore', 0, -1)); } - public function sortedSetsProvider(): array { return [ diff --git a/tests/Predis/Command/Redis/ZDIFF_test.php b/tests/Predis/Command/Redis/ZDIFF_test.php index b64f2cf1..e7d61434 100644 --- a/tests/Predis/Command/Redis/ZDIFF_test.php +++ b/tests/Predis/Command/Redis/ZDIFF_test.php @@ -17,7 +17,7 @@ use Predis\Response\ServerException; class ZDIFF_test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -25,7 +25,7 @@ class ZDIFF_test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { @@ -103,7 +103,7 @@ class ZDIFF_test extends PredisCommandTestCase $redis = $this->getClient(); $redis->set('zdiff_foo', 'bar'); - $redis->zdiff(['zdiff_foo'],true); + $redis->zdiff(['zdiff_foo'], true); } public function argumentsProvider(): array diff --git a/tests/Predis/Command/Redis/ZINTERCARD_Test.php b/tests/Predis/Command/Redis/ZINTERCARD_Test.php index c6a6c252..d307eff1 100644 --- a/tests/Predis/Command/Redis/ZINTERCARD_Test.php +++ b/tests/Predis/Command/Redis/ZINTERCARD_Test.php @@ -18,7 +18,7 @@ use UnexpectedValueException; class ZINTERCARD_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -26,7 +26,7 @@ class ZINTERCARD_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { diff --git a/tests/Predis/Command/Redis/ZINTER_Test.php b/tests/Predis/Command/Redis/ZINTER_Test.php index 7fcd8077..297d4387 100644 --- a/tests/Predis/Command/Redis/ZINTER_Test.php +++ b/tests/Predis/Command/Redis/ZINTER_Test.php @@ -22,7 +22,7 @@ use UnexpectedValueException; class ZINTER_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -30,7 +30,7 @@ class ZINTER_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { @@ -70,7 +70,7 @@ class ZINTER_Test extends PredisCommandTestCase ], 'with all arguments' => [ [['key1', 'key2'], [1, 2], 'min', true], - [ 2, 'key1', 'key2', 'WEIGHTS', 1, 2, 'AGGREGATE', 'MIN', 'WITHSCORES'], + [2, 'key1', 'key2', 'WEIGHTS', 1, 2, 'AGGREGATE', 'MIN', 'WITHSCORES'], ], ]; } diff --git a/tests/Predis/Command/Redis/ZMPOP_Test.php b/tests/Predis/Command/Redis/ZMPOP_Test.php index 04002fcc..b57adba3 100644 --- a/tests/Predis/Command/Redis/ZMPOP_Test.php +++ b/tests/Predis/Command/Redis/ZMPOP_Test.php @@ -18,7 +18,7 @@ use UnexpectedValueException; class ZMPOP_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -26,7 +26,7 @@ class ZMPOP_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { diff --git a/tests/Predis/Command/Redis/ZMSCORE_Test.php b/tests/Predis/Command/Redis/ZMSCORE_Test.php index 98aa042b..19f62c7a 100644 --- a/tests/Predis/Command/Redis/ZMSCORE_Test.php +++ b/tests/Predis/Command/Redis/ZMSCORE_Test.php @@ -20,9 +20,8 @@ use Predis\Response\ServerException; */ class ZMSCORE_Test extends PredisCommandTestCase { - /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -30,7 +29,7 @@ class ZMSCORE_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { @@ -73,7 +72,7 @@ class ZMSCORE_Test extends PredisCommandTestCase $notExpectedMember = 'not_expected'; /** @var string[] $members */ - $members = array_filter($membersDictionary, static function($item) { + $members = array_filter($membersDictionary, static function ($item) { return is_string($item); }); diff --git a/tests/Predis/Command/Redis/ZPOPMAX_Test.php b/tests/Predis/Command/Redis/ZPOPMAX_Test.php index 072234fe..5939c153 100644 --- a/tests/Predis/Command/Redis/ZPOPMAX_Test.php +++ b/tests/Predis/Command/Redis/ZPOPMAX_Test.php @@ -18,7 +18,6 @@ namespace Predis\Command\Redis; */ class ZPOPMAX_Test extends PredisCommandTestCase { - /** * {@inheritdoc} */ diff --git a/tests/Predis/Command/Redis/ZRANDMEMBER_test.php b/tests/Predis/Command/Redis/ZRANDMEMBER_test.php index 3c391ce1..634ffc31 100644 --- a/tests/Predis/Command/Redis/ZRANDMEMBER_test.php +++ b/tests/Predis/Command/Redis/ZRANDMEMBER_test.php @@ -16,9 +16,8 @@ use Predis\Response\ServerException; class ZRANDMEMBER_test extends PredisCommandTestCase { - /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -26,11 +25,11 @@ class ZRANDMEMBER_test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { - return 'ZRANDMEMBER'; + return 'ZRANDMEMBER'; } /** diff --git a/tests/Predis/Command/Redis/ZRANGESTORE_Test.php b/tests/Predis/Command/Redis/ZRANGESTORE_Test.php index f39b412c..92cf1531 100644 --- a/tests/Predis/Command/Redis/ZRANGESTORE_Test.php +++ b/tests/Predis/Command/Redis/ZRANGESTORE_Test.php @@ -17,7 +17,7 @@ use UnexpectedValueException; class ZRANGESTORE_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -25,7 +25,7 @@ class ZRANGESTORE_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { diff --git a/tests/Predis/Command/Redis/ZUNION_Test.php b/tests/Predis/Command/Redis/ZUNION_Test.php index ef593748..eef3941a 100644 --- a/tests/Predis/Command/Redis/ZUNION_Test.php +++ b/tests/Predis/Command/Redis/ZUNION_Test.php @@ -22,7 +22,7 @@ use UnexpectedValueException; class ZUNION_Test extends PredisCommandTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedCommand(): string { @@ -30,7 +30,7 @@ class ZUNION_Test extends PredisCommandTestCase } /** - * @inheritDoc + * {@inheritDoc} */ protected function getExpectedId(): string { @@ -84,7 +84,6 @@ class ZUNION_Test extends PredisCommandTestCase $this->assertSame($expectedResponse, $actualResponse); } - /** * @group connected * @requiresRedisVersion >= 6.2.0 @@ -145,7 +144,7 @@ class ZUNION_Test extends PredisCommandTestCase ], 'with all arguments' => [ [['key1', 'key2'], [1, 2], 'min', true], - [ 2, 'key1', 'key2', 'WEIGHTS', 1, 2, 'AGGREGATE', 'MIN', 'WITHSCORES'], + [2, 'key1', 'key2', 'WEIGHTS', 1, 2, 'AGGREGATE', 'MIN', 'WITHSCORES'], ], ]; } diff --git a/tests/Predis/Command/RedisFactoryTest.php b/tests/Predis/Command/RedisFactoryTest.php index b2b9795d..81cfac33 100644 --- a/tests/Predis/Command/RedisFactoryTest.php +++ b/tests/Predis/Command/RedisFactoryTest.php @@ -16,9 +16,6 @@ use Predis\Command\Processor\ProcessorChain; use Predis\Command\Processor\ProcessorInterface; use PredisTestCase; -/** - * - */ class RedisFactoryTest extends PredisTestCase { /** diff --git a/tests/Predis/Command/ScriptCommandTest.php b/tests/Predis/Command/ScriptCommandTest.php index 293f7645..e3f26dc0 100644 --- a/tests/Predis/Command/ScriptCommandTest.php +++ b/tests/Predis/Command/ScriptCommandTest.php @@ -20,8 +20,8 @@ use PredisTestCase; */ class ScriptCommandTest extends PredisTestCase { - const LUA_SCRIPT = 'return { KEYS[1], KEYS[2], ARGV[1], ARGV[2] }'; - const LUA_SCRIPT_SHA1 = '6e07f61f502e36d123fe28523076af588f5c315e'; + public const LUA_SCRIPT = 'return { KEYS[1], KEYS[2], ARGV[1], ARGV[2] }'; + public const LUA_SCRIPT_SHA1 = '6e07f61f502e36d123fe28523076af588f5c315e'; /** * @group disconnected diff --git a/tests/Predis/Command/Traits/AggregateTest.php b/tests/Predis/Command/Traits/AggregateTest.php index 25ae9653..dee92924 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/By/GeoByTest.php b/tests/Predis/Command/Traits/By/GeoByTest.php index 8bcdd99d..6760872e 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 14f3a83b..4c3ed7f4 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 bae54be0..86f32678 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 abed8d91..11f259e6 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 ac20e55d..9916f731 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/KeysTest.php b/tests/Predis/Command/Traits/KeysTest.php index 8119f5b6..58616fb9 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 3a0b0b61..b3feaf94 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; @@ -80,7 +80,7 @@ class LeftRightTest extends PredisTestCase 'left/right argument not the first and not the last' => [ 1, ['first argument', 'left', 'third argument'], - ['first argument', 'LEFT','third argument'], + ['first argument', 'LEFT', 'third argument'], ], 'aggregate argument the only argument' => [ 0, diff --git a/tests/Predis/Command/Traits/LimitTest.php b/tests/Predis/Command/Traits/LimitTest.php index aed54bea..fb15a025 100644 --- a/tests/Predis/Command/Traits/LimitTest.php +++ b/tests/Predis/Command/Traits/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 5998a1b8..7b4ab9a3 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 1d7a520f..3fd6e180 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() @@ -49,7 +49,7 @@ class ReplaceTest extends PredisTestCase public function argumentsProvider(): array { return [ - 'with boolean - true' => [[true],['REPLACE']], + 'with boolean - true' => [[true], ['REPLACE']], 'with boolean - false' => [[false], []], 'with non boolean' => [['string'], ['string']], ]; diff --git a/tests/Predis/Command/Traits/RevTest.php b/tests/Predis/Command/Traits/RevTest.php index 47ff6176..e89624fa 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 7d045e6f..a7c65036 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 77632747..f6b74e78 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 3a17458a..db8b3d76 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 47ccf03e..7142d942 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; @@ -62,7 +62,6 @@ class WeightsTest extends PredisTestCase $this->testClass->setArguments($actualArguments); } - public function argumentsProvider(): array { return [ diff --git a/tests/Predis/Command/Traits/With/WithCoordTest.php b/tests/Predis/Command/Traits/With/WithCoordTest.php index d1272b8b..68f8041d 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 cb3cfe7f..e36acb01 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 e7690860..a6bca05c 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 396e14c3..82aa7319 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/CommunicationExceptionTest.php b/tests/Predis/CommunicationExceptionTest.php index 2612fd29..c58e677a 100644 --- a/tests/Predis/CommunicationExceptionTest.php +++ b/tests/Predis/CommunicationExceptionTest.php @@ -16,9 +16,6 @@ use Exception; use PHPUnit\Framework\MockObject\MockObject; use PredisTestCase; -/** - * - */ class CommunicationExceptionTest extends PredisTestCase { /** @@ -118,7 +115,7 @@ class CommunicationExceptionTest extends PredisTestCase * @param Connection\NodeConnectionInterface $connection Connection instance. * @param string $message Exception message. * @param int $code Exception code. - * @param Exception $inner Inner exception. + * @param Exception $inner Inner exception. * * @return \Predis\CommunicationException */ diff --git a/tests/Predis/Configuration/Option/AggregateTest.php b/tests/Predis/Configuration/Option/AggregateTest.php index ac985f1d..e6550646 100644 --- a/tests/Predis/Configuration/Option/AggregateTest.php +++ b/tests/Predis/Configuration/Option/AggregateTest.php @@ -12,15 +12,10 @@ namespace Predis\Configuration\Option; -use function PHPSTORM_META\expectedArguments; use PHPUnit\Framework\MockObject\MockObject; use Predis\Configuration\OptionsInterface; - use PredisTestCase; -/** - * - */ class AggregateTest extends PredisTestCase { /** diff --git a/tests/Predis/Configuration/Option/CRC16Test.php b/tests/Predis/Configuration/Option/CRC16Test.php index 9b9a3f4d..54173d92 100644 --- a/tests/Predis/Configuration/Option/CRC16Test.php +++ b/tests/Predis/Configuration/Option/CRC16Test.php @@ -15,9 +15,6 @@ namespace Predis\Configuration\Option; use Predis\Configuration\OptionsInterface; use PredisTestCase; -/** - * - */ class CRC16Test extends PredisTestCase { /** diff --git a/tests/Predis/Configuration/Option/ClusterTest.php b/tests/Predis/Configuration/Option/ClusterTest.php index d1792ea3..c1fdcbf9 100644 --- a/tests/Predis/Configuration/Option/ClusterTest.php +++ b/tests/Predis/Configuration/Option/ClusterTest.php @@ -16,9 +16,6 @@ use PHPUnit\Framework\MockObject\MockObject; use Predis\Configuration\OptionsInterface; use PredisTestCase; -/** - * - */ class ClusterTest extends PredisTestCase { /** diff --git a/tests/Predis/Configuration/Option/CommandsTest.php b/tests/Predis/Configuration/Option/CommandsTest.php index 0e17eaef..8390cbf6 100644 --- a/tests/Predis/Configuration/Option/CommandsTest.php +++ b/tests/Predis/Configuration/Option/CommandsTest.php @@ -19,9 +19,6 @@ use Predis\Configuration\OptionsInterface; use PredisTestCase; use stdClass; -/** - * - */ class CommandsTest extends PredisTestCase { /** @@ -122,7 +119,7 @@ class CommandsTest extends PredisTestCase $input = [ 'ECHO' => null, 'EVAL' => null, - 'FOO' => null, + 'FOO' => null, ]; $commands = $option->filter($options, $input); diff --git a/tests/Predis/Configuration/Option/ConnectionsTest.php b/tests/Predis/Configuration/Option/ConnectionsTest.php index 40890b89..a58fec3d 100644 --- a/tests/Predis/Configuration/Option/ConnectionsTest.php +++ b/tests/Predis/Configuration/Option/ConnectionsTest.php @@ -17,9 +17,6 @@ use Predis\Configuration\OptionsInterface; use PredisTestCase; use stdClass; -/** - * - */ class ConnectionsTest extends PredisTestCase { /** diff --git a/tests/Predis/Configuration/Option/ExceptionsTest.php b/tests/Predis/Configuration/Option/ExceptionsTest.php index 4556038f..61b8279f 100644 --- a/tests/Predis/Configuration/Option/ExceptionsTest.php +++ b/tests/Predis/Configuration/Option/ExceptionsTest.php @@ -16,9 +16,6 @@ use Predis\Configuration\OptionsInterface; use PredisTestCase; use stdClass; -/** - * - */ class ExceptionsTest extends PredisTestCase { /** diff --git a/tests/Predis/Configuration/Option/PrefixTest.php b/tests/Predis/Configuration/Option/PrefixTest.php index d3df5709..da703caf 100644 --- a/tests/Predis/Configuration/Option/PrefixTest.php +++ b/tests/Predis/Configuration/Option/PrefixTest.php @@ -15,9 +15,6 @@ namespace Predis\Configuration\Option; use Predis\Configuration\OptionsInterface; use PredisTestCase; -/** - * - */ class PrefixTest extends PredisTestCase { /** diff --git a/tests/Predis/Configuration/Option/ReplicationTest.php b/tests/Predis/Configuration/Option/ReplicationTest.php index cb0c7ac5..8106a0fb 100644 --- a/tests/Predis/Configuration/Option/ReplicationTest.php +++ b/tests/Predis/Configuration/Option/ReplicationTest.php @@ -17,9 +17,6 @@ use Predis\Configuration\OptionsInterface; use PredisTestCase; use ReflectionProperty; -/** - * - */ class ReplicationTest extends PredisTestCase { /** diff --git a/tests/Predis/Connection/Cluster/PredisClusterTest.php b/tests/Predis/Connection/Cluster/PredisClusterTest.php index 7cbc431d..80f37f82 100644 --- a/tests/Predis/Connection/Cluster/PredisClusterTest.php +++ b/tests/Predis/Connection/Cluster/PredisClusterTest.php @@ -14,9 +14,6 @@ namespace Predis\Connection\Cluster; use PredisTestCase; -/** - * - */ class PredisClusterTest extends PredisTestCase { /** @@ -278,7 +275,7 @@ class PredisClusterTest extends PredisTestCase /** * @group disconnected - */ + */ public function testThrowsExceptionOnNonShardableCommand(): void { $this->expectException('Predis\NotSupportedException'); diff --git a/tests/Predis/Connection/CompositeStreamConnectionTest.php b/tests/Predis/Connection/CompositeStreamConnectionTest.php index c9d5802a..2798d797 100644 --- a/tests/Predis/Connection/CompositeStreamConnectionTest.php +++ b/tests/Predis/Connection/CompositeStreamConnectionTest.php @@ -16,13 +16,10 @@ use PHPUnit\Framework\MockObject\MockObject; use Predis\Command\RawCommand; use Predis\Response\Error as ErrorResponse; -/** - * - */ class CompositeStreamConnectionTest extends PredisConnectionTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getConnectionClass(): string { diff --git a/tests/Predis/Connection/ConnectionExceptionTest.php b/tests/Predis/Connection/ConnectionExceptionTest.php index 9e5534e2..066b7b32 100644 --- a/tests/Predis/Connection/ConnectionExceptionTest.php +++ b/tests/Predis/Connection/ConnectionExceptionTest.php @@ -17,9 +17,6 @@ require_once __DIR__ . '/../CommunicationExceptionTest.php'; use Exception; use Predis\CommunicationExceptionTest; -/** - * - */ class ConnectionExceptionTest extends CommunicationExceptionTest { /** diff --git a/tests/Predis/Connection/FactoryTest.php b/tests/Predis/Connection/FactoryTest.php index e0e86ca8..6d431234 100644 --- a/tests/Predis/Connection/FactoryTest.php +++ b/tests/Predis/Connection/FactoryTest.php @@ -12,15 +12,10 @@ namespace Predis\Connection; -use PHPUnit\Framework\MockObject\MockObject; -use Predis\Connection\Cluster\ClusterInterface; use PredisTestCase; use ReflectionObject; use stdClass; -/** - * - */ class FactoryTest extends PredisTestCase { /** diff --git a/tests/Predis/Connection/ParametersTest.php b/tests/Predis/Connection/ParametersTest.php index 351a6367..560d0586 100644 --- a/tests/Predis/Connection/ParametersTest.php +++ b/tests/Predis/Connection/ParametersTest.php @@ -14,9 +14,6 @@ namespace Predis\Connection; use PredisTestCase; -/** - * - */ class ParametersTest extends PredisTestCase { /** diff --git a/tests/Predis/Connection/PhpiredisSocketConnectionTest.php b/tests/Predis/Connection/PhpiredisSocketConnectionTest.php index b9437370..8c4dd117 100644 --- a/tests/Predis/Connection/PhpiredisSocketConnectionTest.php +++ b/tests/Predis/Connection/PhpiredisSocketConnectionTest.php @@ -23,7 +23,7 @@ use Predis\Response\Error as ErrorResponse; class PhpiredisSocketConnectionTest extends PredisConnectionTestCase { /** - * @inheritDoc + * {@inheritDoc} */ protected function getConnectionClass(): string { diff --git a/tests/Predis/Connection/PhpiredisStreamConnectionTest.php b/tests/Predis/Connection/PhpiredisStreamConnectionTest.php index 2f689174..83c5d2a5 100644 --- a/tests/Predis/Connection/PhpiredisStreamConnectionTest.php +++ b/tests/Predis/Connection/PhpiredisStreamConnectionTest.php @@ -23,7 +23,7 @@ use Predis\Response\Error as ErrorResponse; class PhpiredisStreamConnectionTest extends PredisConnectionTestCase { /** - * @inheritDoc + * {@inheritDoc} */ public function getConnectionClass(): string { diff --git a/tests/Predis/Connection/Replication/MasterSlaveReplicationTest.php b/tests/Predis/Connection/Replication/MasterSlaveReplicationTest.php index 04264415..9c1e9e7b 100644 --- a/tests/Predis/Connection/Replication/MasterSlaveReplicationTest.php +++ b/tests/Predis/Connection/Replication/MasterSlaveReplicationTest.php @@ -19,9 +19,6 @@ use Predis\Replication\ReplicationStrategy; use Predis\Response; use PredisTestCase; -/** - * - */ class MasterSlaveReplicationTest extends PredisTestCase { /** @@ -1114,7 +1111,7 @@ repl_backlog_histlen:12978 ->expects($this->exactly(3)) ->method('create') ->withConsecutive( - # Connection to master node + // Connection to master node [ [ 'host' => '127.0.0.1', @@ -1123,7 +1120,7 @@ repl_backlog_histlen:12978 ], ], - # Connection to first slave + // Connection to first slave [ [ 'host' => '127.0.0.1', @@ -1132,7 +1129,7 @@ repl_backlog_histlen:12978 ], ], - # Connection to second slave + // Connection to second slave [ [ 'host' => '127.0.0.1', @@ -1222,7 +1219,7 @@ repl_backlog_histlen:12978 ->expects($this->exactly(3)) ->method('create') ->withConsecutive( - # Connection to master node + // Connection to master node [ [ 'host' => '127.0.0.1', @@ -1231,7 +1228,7 @@ repl_backlog_histlen:12978 ], ], - # Connection to first slave + // Connection to first slave [ [ 'host' => '127.0.0.1', @@ -1240,7 +1237,7 @@ repl_backlog_histlen:12978 ], ], - # Connection to second slave + // Connection to second slave [ [ 'host' => '127.0.0.1', diff --git a/tests/Predis/Connection/Replication/SentinelReplicationTest.php b/tests/Predis/Connection/Replication/SentinelReplicationTest.php index a89fb60d..941ae105 100644 --- a/tests/Predis/Connection/Replication/SentinelReplicationTest.php +++ b/tests/Predis/Connection/Replication/SentinelReplicationTest.php @@ -20,9 +20,6 @@ use Predis\Response; use PredisTestCase; use ReflectionProperty; -/** - * - */ class SentinelReplicationTest extends PredisTestCase { /** @@ -1170,7 +1167,7 @@ class SentinelReplicationTest extends PredisTestCase ) ->willReturnOnConsecutiveCalls( $cmdSetResponse - ); + ); $slave1 = $this->getMockConnection('tcp://127.0.0.1:6382?role=slave'); $slave1 @@ -1184,8 +1181,8 @@ class SentinelReplicationTest extends PredisTestCase [$this->isRedisCommand('GET', ['key'])] ) ->willReturnOnConsecutiveCalls( - $cmdGetResponse - ); + $cmdGetResponse + ); $replication = $this->getReplicationConnection('svc', [$sentinel1]); @@ -1513,7 +1510,7 @@ class SentinelReplicationTest extends PredisTestCase $replication = $this->getReplicationConnection('svc', [$sentinel1, $sentinel2]); try { $replication->updateSentinels(); - } catch (\Predis\ClientException $exception){ + } catch (\Predis\ClientException $exception) { $this->assertEquals('No sentinel server available for autodiscovery.', $exception->getMessage()); } diff --git a/tests/Predis/Connection/StreamConnectionTest.php b/tests/Predis/Connection/StreamConnectionTest.php index b950af50..55c30c08 100644 --- a/tests/Predis/Connection/StreamConnectionTest.php +++ b/tests/Predis/Connection/StreamConnectionTest.php @@ -16,13 +16,10 @@ use PHPUnit\Framework\MockObject\MockObject; use Predis\Command\RawCommand; use Predis\Response\Error as ErrorResponse; -/** - * - */ class StreamConnectionTest extends PredisConnectionTestCase { /** - * @inheritDoc + * {@inheritDoc} */ public function getConnectionClass(): string { diff --git a/tests/Predis/Pipeline/AtomicTest.php b/tests/Predis/Pipeline/AtomicTest.php index cf44eb50..ef0830a1 100644 --- a/tests/Predis/Pipeline/AtomicTest.php +++ b/tests/Predis/Pipeline/AtomicTest.php @@ -16,9 +16,6 @@ use Predis\Client; use Predis\Response; use PredisTestCase; -/** - * - */ class AtomicTest extends PredisTestCase { /** diff --git a/tests/Predis/Pipeline/FireAndForgetTest.php b/tests/Predis/Pipeline/FireAndForgetTest.php index 094485a0..2b845642 100644 --- a/tests/Predis/Pipeline/FireAndForgetTest.php +++ b/tests/Predis/Pipeline/FireAndForgetTest.php @@ -15,9 +15,6 @@ namespace Predis\Pipeline; use Predis\Client; use PredisTestCase; -/** - * - */ class FireAndForgetTest extends PredisTestCase { /** diff --git a/tests/Predis/Pipeline/PipelineTest.php b/tests/Predis/Pipeline/PipelineTest.php index eba3986b..445f6082 100644 --- a/tests/Predis/Pipeline/PipelineTest.php +++ b/tests/Predis/Pipeline/PipelineTest.php @@ -22,9 +22,6 @@ use Predis\Response; use PredisTestCase; use stdClass; -/** - * - */ class PipelineTest extends PredisTestCase { /** diff --git a/tests/Predis/PredisExceptionTest.php b/tests/Predis/PredisExceptionTest.php index 80abf4e4..fba8bf54 100644 --- a/tests/Predis/PredisExceptionTest.php +++ b/tests/Predis/PredisExceptionTest.php @@ -14,9 +14,6 @@ namespace Predis; use PredisTestCase; -/** - * - */ class PredisExceptionTest extends PredisTestCase { /** diff --git a/tests/Predis/Protocol/ProtocolExceptionTest.php b/tests/Predis/Protocol/ProtocolExceptionTest.php index 825cb16d..c36fb0c0 100644 --- a/tests/Predis/Protocol/ProtocolExceptionTest.php +++ b/tests/Predis/Protocol/ProtocolExceptionTest.php @@ -19,9 +19,6 @@ use Predis\CommunicationException; use Predis\CommunicationExceptionTest; use Predis\Connection\NodeConnectionInterface; -/** - * - */ class ProtocolExceptionTest extends CommunicationExceptionTest { /** diff --git a/tests/Predis/Protocol/Text/CompositeProtocolProcessorTest.php b/tests/Predis/Protocol/Text/CompositeProtocolProcessorTest.php index 8bb00cd4..bd942261 100644 --- a/tests/Predis/Protocol/Text/CompositeProtocolProcessorTest.php +++ b/tests/Predis/Protocol/Text/CompositeProtocolProcessorTest.php @@ -19,9 +19,6 @@ use Predis\Protocol\RequestSerializerInterface; use Predis\Protocol\ResponseReaderInterface; use PredisTestCase; -/** - * - */ class CompositeProtocolProcessorTest extends PredisTestCase { /** diff --git a/tests/Predis/Protocol/Text/Handler/BulkResponseTest.php b/tests/Predis/Protocol/Text/Handler/BulkResponseTest.php index 75bca2f8..5bd5025a 100644 --- a/tests/Predis/Protocol/Text/Handler/BulkResponseTest.php +++ b/tests/Predis/Protocol/Text/Handler/BulkResponseTest.php @@ -14,9 +14,6 @@ namespace Predis\Protocol\Text; use PredisTestCase; -/** - * - */ class BulkResponseTest extends PredisTestCase { /** diff --git a/tests/Predis/Protocol/Text/Handler/ErrorResponseTest.php b/tests/Predis/Protocol/Text/Handler/ErrorResponseTest.php index ad8bcbd5..4245862b 100644 --- a/tests/Predis/Protocol/Text/Handler/ErrorResponseTest.php +++ b/tests/Predis/Protocol/Text/Handler/ErrorResponseTest.php @@ -14,9 +14,6 @@ namespace Predis\Protocol\Text; use PredisTestCase; -/** - * - */ class ErrorResponseTest extends PredisTestCase { /** diff --git a/tests/Predis/Protocol/Text/Handler/IntegerResponseTest.php b/tests/Predis/Protocol/Text/Handler/IntegerResponseTest.php index d9e9f467..77465373 100644 --- a/tests/Predis/Protocol/Text/Handler/IntegerResponseTest.php +++ b/tests/Predis/Protocol/Text/Handler/IntegerResponseTest.php @@ -14,9 +14,6 @@ namespace Predis\Protocol\Text; use PredisTestCase; -/** - * - */ class IntegerResponseTest extends PredisTestCase { /** diff --git a/tests/Predis/Protocol/Text/Handler/MultiBulkResponseTest.php b/tests/Predis/Protocol/Text/Handler/MultiBulkResponseTest.php index bb1873ae..b2a7f0c1 100644 --- a/tests/Predis/Protocol/Text/Handler/MultiBulkResponseTest.php +++ b/tests/Predis/Protocol/Text/Handler/MultiBulkResponseTest.php @@ -14,9 +14,6 @@ namespace Predis\Protocol\Text; use PredisTestCase; -/** - * - */ class MultiBulkResponseTest extends PredisTestCase { /** diff --git a/tests/Predis/Protocol/Text/Handler/StatusResponseTest.php b/tests/Predis/Protocol/Text/Handler/StatusResponseTest.php index 361647b8..10bb1e36 100644 --- a/tests/Predis/Protocol/Text/Handler/StatusResponseTest.php +++ b/tests/Predis/Protocol/Text/Handler/StatusResponseTest.php @@ -14,9 +14,6 @@ namespace Predis\Protocol\Text; use PredisTestCase; -/** - * - */ class StatusResponseTest extends PredisTestCase { /** diff --git a/tests/Predis/Protocol/Text/Handler/StreamableMultiBulkResponseTest.php b/tests/Predis/Protocol/Text/Handler/StreamableMultiBulkResponseTest.php index fc348662..53cdf8ae 100644 --- a/tests/Predis/Protocol/Text/Handler/StreamableMultiBulkResponseTest.php +++ b/tests/Predis/Protocol/Text/Handler/StreamableMultiBulkResponseTest.php @@ -14,9 +14,6 @@ namespace Predis\Protocol\Text; use PredisTestCase; -/** - * - */ class StreamableMultiBulkResponseTest extends PredisTestCase { /** diff --git a/tests/Predis/Protocol/Text/ProtocolProcessorTest.php b/tests/Predis/Protocol/Text/ProtocolProcessorTest.php index aa9475b1..5509a8fc 100644 --- a/tests/Predis/Protocol/Text/ProtocolProcessorTest.php +++ b/tests/Predis/Protocol/Text/ProtocolProcessorTest.php @@ -16,9 +16,6 @@ use PHPUnit\Framework\MockObject\MockObject; use Predis\Command\CommandInterface; use PredisTestCase; -/** - * - */ class ProtocolProcessorTest extends PredisTestCase { /** diff --git a/tests/Predis/Protocol/Text/RequestSerializerTest.php b/tests/Predis/Protocol/Text/RequestSerializerTest.php index b0074a12..3c47a8c3 100644 --- a/tests/Predis/Protocol/Text/RequestSerializerTest.php +++ b/tests/Predis/Protocol/Text/RequestSerializerTest.php @@ -16,9 +16,6 @@ use PHPUnit\Framework\MockObject\MockObject; use Predis\Command\CommandInterface; use PredisTestCase; -/** - * - */ class RequestSerializerTest extends PredisTestCase { /** diff --git a/tests/Predis/Protocol/Text/ResponseReaderTest.php b/tests/Predis/Protocol/Text/ResponseReaderTest.php index 71028db3..d28cd312 100644 --- a/tests/Predis/Protocol/Text/ResponseReaderTest.php +++ b/tests/Predis/Protocol/Text/ResponseReaderTest.php @@ -15,9 +15,6 @@ namespace Predis\Protocol\Text; use Predis\Protocol\Text\Handler\ResponseHandlerInterface; use PredisTestCase; -/** - * - */ class ResponseReaderTest extends PredisTestCase { /** diff --git a/tests/Predis/Replication/ReplicationStrategyTest.php b/tests/Predis/Replication/ReplicationStrategyTest.php index a88aedcf..490bf0fe 100644 --- a/tests/Predis/Replication/ReplicationStrategyTest.php +++ b/tests/Predis/Replication/ReplicationStrategyTest.php @@ -16,9 +16,6 @@ use PHPUnit\Framework\MockObject\MockObject; use Predis\Command\CommandInterface; use PredisTestCase; -/** - * - */ class ReplicationStrategyTest extends PredisTestCase { /** diff --git a/tests/Predis/Response/ErrorTest.php b/tests/Predis/Response/ErrorTest.php index e1697a7d..95eff63f 100644 --- a/tests/Predis/Response/ErrorTest.php +++ b/tests/Predis/Response/ErrorTest.php @@ -14,12 +14,9 @@ namespace Predis\Response; use PredisTestCase; -/** - * - */ class ErrorTest extends PredisTestCase { - const ERR_WRONG_KEY_TYPE = 'ERR Operation against a key holding the wrong kind of value'; + public const ERR_WRONG_KEY_TYPE = 'ERR Operation against a key holding the wrong kind of value'; /** * @group disconnected diff --git a/tests/Predis/Response/Iterator/MultiBulkTest.php b/tests/Predis/Response/Iterator/MultiBulkTest.php index 24381d8e..5b5ade73 100644 --- a/tests/Predis/Response/Iterator/MultiBulkTest.php +++ b/tests/Predis/Response/Iterator/MultiBulkTest.php @@ -31,7 +31,7 @@ class MultiBulkTest extends PredisTestCase $client = $this->getClient(); $client->rpush('metavars', 'foo', 'hoge', 'lol'); - /** @var MultiBulkIterator */ + /* @var MultiBulkIterator */ $this->assertInstanceOf('Iterator', $iterator = $client->lrange('metavars', 0, -1)); $this->assertInstanceOf('Predis\Response\Iterator\MultiBulk', $iterator); diff --git a/tests/Predis/Response/ServerExceptionTest.php b/tests/Predis/Response/ServerExceptionTest.php index fbaaecfc..c8c33f66 100644 --- a/tests/Predis/Response/ServerExceptionTest.php +++ b/tests/Predis/Response/ServerExceptionTest.php @@ -14,12 +14,9 @@ namespace Predis\Response; use PredisTestCase; -/** - * - */ class ServerExceptionTest extends PredisTestCase { - const ERR_WRONG_KEY_TYPE = 'ERR Operation against a key holding the wrong kind of value'; + public const ERR_WRONG_KEY_TYPE = 'ERR Operation against a key holding the wrong kind of value'; /** * @group disconnected diff --git a/tests/Predis/Response/StatusTest.php b/tests/Predis/Response/StatusTest.php index c55c7f66..3e6aa957 100644 --- a/tests/Predis/Response/StatusTest.php +++ b/tests/Predis/Response/StatusTest.php @@ -14,9 +14,6 @@ namespace Predis\Response; use PredisTestCase; -/** - * - */ class StatusTest extends PredisTestCase { /** diff --git a/tests/Predis/Transaction/AbortedMultiExecExceptionTest.php b/tests/Predis/Transaction/AbortedMultiExecExceptionTest.php index d45da33b..55d74faf 100644 --- a/tests/Predis/Transaction/AbortedMultiExecExceptionTest.php +++ b/tests/Predis/Transaction/AbortedMultiExecExceptionTest.php @@ -15,9 +15,6 @@ namespace Predis\Transaction; use Predis\Client; use PredisTestCase; -/** - * - */ class AbortedMultiExecExceptionTest extends PredisTestCase { /** diff --git a/tests/Predis/Transaction/MultiExecStateTest.php b/tests/Predis/Transaction/MultiExecStateTest.php index 94a9fcd7..b1a424cb 100644 --- a/tests/Predis/Transaction/MultiExecStateTest.php +++ b/tests/Predis/Transaction/MultiExecStateTest.php @@ -24,10 +24,10 @@ class MultiExecStateTest extends PredisTestCase */ public function testFlagsValues(): void { - $this->assertSame(1, MultiExecState::INITIALIZED); - $this->assertSame(2, MultiExecState::INSIDEBLOCK); - $this->assertSame(4, MultiExecState::DISCARDED); - $this->assertSame(8, MultiExecState::CAS); + $this->assertSame(1, MultiExecState::INITIALIZED); + $this->assertSame(2, MultiExecState::INSIDEBLOCK); + $this->assertSame(4, MultiExecState::DISCARDED); + $this->assertSame(8, MultiExecState::CAS); $this->assertSame(16, MultiExecState::WATCH); } diff --git a/tests/Predis/Transaction/MultiExecTest.php b/tests/Predis/Transaction/MultiExecTest.php index 507b2d8a..9e8f5990 100644 --- a/tests/Predis/Transaction/MultiExecTest.php +++ b/tests/Predis/Transaction/MultiExecTest.php @@ -264,6 +264,7 @@ class MultiExecTest extends PredisTestCase $this->assertSame($responses, $expected); $this->assertSame(['MULTI', 'ECHO', 'DISCARD', 'MULTI', 'ECHO', 'EXEC'], self::commandsToIDs($commands)); } + /** * @group disconnected */ @@ -316,6 +317,7 @@ class MultiExecTest extends PredisTestCase $this->assertSame(['foo', 'hoge'], $casCommands[0]->getArguments()); $this->assertSame(['MULTI', 'GET', 'GET', 'EXEC'], self::commandsToIDs($txCommands)); } + /** * @group disconnected */ @@ -423,7 +425,6 @@ class MultiExecTest extends PredisTestCase $this->expectException('Predis\ClientException'); $this->expectExceptionMessage('Automatic retries are supported only when a callable block is provided'); - $options = ['retry' => 1]; $callback = $this->getExecuteCallback(); @@ -455,7 +456,7 @@ class MultiExecTest extends PredisTestCase $tx->get('foo'); if ($attempts > 0) { - $attempts -= 1; + $attempts--; $signal(); $tx->echo('!!ABORT!!'); @@ -885,7 +886,8 @@ class MultiExecTest extends PredisTestCase ?array $expected = [], ?array &$commands = [], ?array &$cas = [] - ): callable { + ): callable + { $multi = $watch = $abort = false; return function (CommandInterface $command) use (&$expected, &$commands, &$cas, &$multi, &$watch, &$abort) { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index b7ec3599..1e21c357 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -15,7 +15,7 @@ if (file_exists(__DIR__ . '/../autoload.php')) { } elseif (@include('Predis/Autoloader.php')) { Predis\Autoloader::register(); } else { - die('ERROR: Unable to find a suitable mean to register Predis\Autoloader.'); + exit('ERROR: Unable to find a suitable mean to register Predis\Autoloader.'); } require __DIR__ . '/PHPUnit/ArrayHasSameValuesConstraint.php';