diff --git a/examples/shared.php b/examples/shared.php index 403203d0..119d1f76 100644 --- a/examples/shared.php +++ b/examples/shared.php @@ -11,7 +11,7 @@ */ if (PHP_SAPI !== 'cli') { - die("Example scripts are meant to be executed locally via CLI."); + die('Example scripts are meant to be executed locally via CLI.'); } require __DIR__ . '/../autoload.php'; diff --git a/src/Command/Traits/By/ByLexByScore.php b/src/Command/Traits/By/ByLexByScore.php index c835d7d8..2a267955 100644 --- a/src/Command/Traits/By/ByLexByScore.php +++ b/src/Command/Traits/By/ByLexByScore.php @@ -37,7 +37,7 @@ trait ByLexByScore if (is_string($argument) && in_array(strtoupper($argument), self::$argumentsEnum)) { $argument = self::$argumentsEnum[$argument]; } else { - throw new UnexpectedValueException("By argument accepts only \"bylex\" and \"byscore\" values"); + throw new UnexpectedValueException('By argument accepts only "bylex" and "byscore" values'); } $argumentsBefore = array_slice($arguments, 0, static::$byLexByScoreArgumentPositionOffset); diff --git a/src/Command/Traits/Storedist.php b/src/Command/Traits/Storedist.php index 3456af49..a30b8993 100644 --- a/src/Command/Traits/Storedist.php +++ b/src/Command/Traits/Storedist.php @@ -37,7 +37,7 @@ trait Storedist if (true === $argument) { $argument = 'STOREDIST'; } else { - throw new UnexpectedValueException("Wrong STOREDIST argument type"); + throw new UnexpectedValueException('Wrong STOREDIST argument type'); } $argumentsBefore = array_slice($arguments, 0, static::$storeDistArgumentPositionOffset); diff --git a/src/Command/Traits/With/WithCoord.php b/src/Command/Traits/With/WithCoord.php index 9edf0b1a..fcded1c5 100644 --- a/src/Command/Traits/With/WithCoord.php +++ b/src/Command/Traits/With/WithCoord.php @@ -37,7 +37,7 @@ trait WithCoord if (true === $argument) { $argument = 'WITHCOORD'; } else { - throw new UnexpectedValueException("Wrong WITHCOORD argument type"); + throw new UnexpectedValueException('Wrong WITHCOORD argument type'); } $argumentsBefore = array_slice($arguments, 0, static::$withCoordArgumentPositionOffset); diff --git a/src/Command/Traits/With/WithDist.php b/src/Command/Traits/With/WithDist.php index 6f274ad9..6703aaa2 100644 --- a/src/Command/Traits/With/WithDist.php +++ b/src/Command/Traits/With/WithDist.php @@ -33,7 +33,7 @@ trait WithDist if (true === $argument) { $argument = 'WITHDIST'; } else { - throw new UnexpectedValueException("Wrong WITHDIST argument type"); + throw new UnexpectedValueException('Wrong WITHDIST argument type'); } $argumentsBefore = array_slice($arguments, 0, static::$withDistArgumentPositionOffset); diff --git a/src/Command/Traits/With/WithHash.php b/src/Command/Traits/With/WithHash.php index 4bc3ec6e..71e3d300 100644 --- a/src/Command/Traits/With/WithHash.php +++ b/src/Command/Traits/With/WithHash.php @@ -33,7 +33,7 @@ trait WithHash if (true === $argument) { $argument = 'WITHHASH'; } else { - throw new UnexpectedValueException("Wrong WITHHASH argument type"); + throw new UnexpectedValueException('Wrong WITHHASH argument type'); } $argumentsBefore = array_slice($arguments, 0, static::$withHashArgumentPositionOffset); diff --git a/src/CommunicationException.php b/src/CommunicationException.php index eaede45e..5e046222 100644 --- a/src/CommunicationException.php +++ b/src/CommunicationException.php @@ -30,7 +30,7 @@ abstract class CommunicationException extends PredisException */ public function __construct( NodeConnectionInterface $connection, - $message = "", + $message = '', $code = 0, Exception $innerException = null ) { diff --git a/tests/Predis/ClientTest.php b/tests/Predis/ClientTest.php index 2dc0f54d..3fca4cd8 100644 --- a/tests/Predis/ClientTest.php +++ b/tests/Predis/ClientTest.php @@ -752,7 +752,7 @@ class ClientTest extends PredisTestCase public function testThrowsExceptionOnNonRegisteredRedisCommand(): void { $this->expectException('Predis\ClientException'); - $this->expectExceptionMessage("Command `INVALIDCOMMAND` is not a registered Redis command"); + $this->expectExceptionMessage('Command `INVALIDCOMMAND` is not a registered Redis command'); $client = new Client(); $client->invalidCommand(); diff --git a/tests/Predis/Command/Redis/ZRANGESTORE_Test.php b/tests/Predis/Command/Redis/ZRANGESTORE_Test.php index a75edaf1..f39b412c 100644 --- a/tests/Predis/Command/Redis/ZRANGESTORE_Test.php +++ b/tests/Predis/Command/Redis/ZRANGESTORE_Test.php @@ -269,7 +269,7 @@ class ZRANGESTORE_Test extends PredisCommandTestCase { return [ 'wrong BY argument value' => [ - 0, -1, 'wrong value', false, false, 0, 0, "By argument accepts only \"bylex\" and \"byscore\" values", + 0, -1, 'wrong value', false, false, 0, 0, 'By argument accepts only "bylex" and "byscore" values', ], 'wrong REV argument type' => [ 0, -1, false, 'wrong value', false, 0, 0, 'Wrong rev argument type', diff --git a/tests/Predis/Command/RedisFactoryTest.php b/tests/Predis/Command/RedisFactoryTest.php index 04e97a49..b2b9795d 100644 --- a/tests/Predis/Command/RedisFactoryTest.php +++ b/tests/Predis/Command/RedisFactoryTest.php @@ -177,7 +177,7 @@ class RedisFactoryTest extends PredisTestCase public function testCreateUndefinedCommand(): void { $this->expectException('Predis\ClientException'); - $this->expectExceptionMessage("Command `UNKNOWN` is not a registered Redis command."); + $this->expectExceptionMessage('Command `UNKNOWN` is not a registered Redis command.'); $factory = new RedisFactory(); diff --git a/tests/Predis/Command/Traits/By/GeoByTest.php b/tests/Predis/Command/Traits/By/GeoByTest.php index b9860437..8bcdd99d 100644 --- a/tests/Predis/Command/Traits/By/GeoByTest.php +++ b/tests/Predis/Command/Traits/By/GeoByTest.php @@ -55,7 +55,7 @@ class GeoByTest extends PredisTestCase public function testThrowsExceptionOnUnexpectedValue(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Invalid BY argument value given"); + $this->expectExceptionMessage('Invalid BY argument value given'); $this->testClass->setArguments(['test']); } diff --git a/tests/Predis/Command/Traits/ByLexByScoreTest.php b/tests/Predis/Command/Traits/ByLexByScoreTest.php index 6f349f43..14f3a83b 100644 --- a/tests/Predis/Command/Traits/ByLexByScoreTest.php +++ b/tests/Predis/Command/Traits/ByLexByScoreTest.php @@ -63,7 +63,7 @@ class ByLexByScoreTest extends PredisTestCase $this->testClass::$byLexByScoreArgumentPositionOffset = 0; $this->expectException(UnexpectedValueException::class); - $this->expectExceptionMessage("By argument accepts only \"bylex\" and \"byscore\" values"); + $this->expectExceptionMessage('By argument accepts only "bylex" and "byscore" values'); $this->testClass->setArguments($actualArguments); } diff --git a/tests/Predis/Command/Traits/From/GeoFromTest.php b/tests/Predis/Command/Traits/From/GeoFromTest.php index 4276bf76..ac20e55d 100644 --- a/tests/Predis/Command/Traits/From/GeoFromTest.php +++ b/tests/Predis/Command/Traits/From/GeoFromTest.php @@ -55,7 +55,7 @@ class GeoFromTest extends PredisTestCase public function testThrowsExceptionOnUnexpectedValue(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Invalid FROM argument value given"); + $this->expectExceptionMessage('Invalid FROM argument value given'); $this->testClass->setArguments(['test']); } diff --git a/tests/Predis/Command/Traits/LimitTest.php b/tests/Predis/Command/Traits/LimitTest.php index 7746c998..aed54bea 100644 --- a/tests/Predis/Command/Traits/LimitTest.php +++ b/tests/Predis/Command/Traits/LimitTest.php @@ -60,7 +60,7 @@ class LimitTest extends PredisTestCase $this->testClass::$limitArgumentPositionOffset = 0; $this->expectException(UnexpectedValueException::class); - $this->expectExceptionMessage("Wrong limit argument type"); + $this->expectExceptionMessage('Wrong limit argument type'); $this->testClass->setArguments(['test']); } diff --git a/tests/Predis/Command/Traits/RevTest.php b/tests/Predis/Command/Traits/RevTest.php index e3dba5ee..47ff6176 100644 --- a/tests/Predis/Command/Traits/RevTest.php +++ b/tests/Predis/Command/Traits/RevTest.php @@ -60,7 +60,7 @@ class RevTest extends PredisTestCase $this->testClass::$revArgumentPositionOffset = 0; $this->expectException(UnexpectedValueException::class); - $this->expectExceptionMessage("Wrong rev argument type"); + $this->expectExceptionMessage('Wrong rev argument type'); $this->testClass->setArguments(['test']); } diff --git a/tests/Predis/Command/Traits/StoredistTest.php b/tests/Predis/Command/Traits/StoredistTest.php index 008a38e1..7d045e6f 100644 --- a/tests/Predis/Command/Traits/StoredistTest.php +++ b/tests/Predis/Command/Traits/StoredistTest.php @@ -60,7 +60,7 @@ class StoredistTest extends PredisTestCase $this->testClass::$storeDistArgumentPositionOffset = 0; $this->expectException(UnexpectedValueException::class); - $this->expectExceptionMessage("Wrong STOREDIST argument type"); + $this->expectExceptionMessage('Wrong STOREDIST argument type'); $this->testClass->setArguments(['test']); } diff --git a/tests/Predis/Command/Traits/With/WithCoordTest.php b/tests/Predis/Command/Traits/With/WithCoordTest.php index 62179ab6..d1272b8b 100644 --- a/tests/Predis/Command/Traits/With/WithCoordTest.php +++ b/tests/Predis/Command/Traits/With/WithCoordTest.php @@ -60,7 +60,7 @@ class WithCoordTest extends PredisTestCase $this->testClass::$withCoordArgumentPositionOffset = 0; $this->expectException(UnexpectedValueException::class); - $this->expectExceptionMessage("Wrong WITHCOORD argument type"); + $this->expectExceptionMessage('Wrong WITHCOORD argument type'); $this->testClass->setArguments(['test']); } diff --git a/tests/Predis/Command/Traits/With/WithDistTest.php b/tests/Predis/Command/Traits/With/WithDistTest.php index af560955..cb3cfe7f 100644 --- a/tests/Predis/Command/Traits/With/WithDistTest.php +++ b/tests/Predis/Command/Traits/With/WithDistTest.php @@ -60,7 +60,7 @@ class WithDistTest extends PredisTestCase $this->testClass::$withDistArgumentPositionOffset = 0; $this->expectException(UnexpectedValueException::class); - $this->expectExceptionMessage("Wrong WITHDIST argument type"); + $this->expectExceptionMessage('Wrong WITHDIST argument type'); $this->testClass->setArguments(['test']); } diff --git a/tests/Predis/Command/Traits/With/WithHashTest.php b/tests/Predis/Command/Traits/With/WithHashTest.php index 9897c83a..e7690860 100644 --- a/tests/Predis/Command/Traits/With/WithHashTest.php +++ b/tests/Predis/Command/Traits/With/WithHashTest.php @@ -60,7 +60,7 @@ class WithHashTest extends PredisTestCase $this->testClass::$withHashArgumentPositionOffset = 0; $this->expectException(UnexpectedValueException::class); - $this->expectExceptionMessage("Wrong WITHHASH argument type"); + $this->expectExceptionMessage('Wrong WITHHASH argument type'); $this->testClass->setArguments(['test']); } diff --git a/tests/Predis/Connection/Cluster/RedisClusterTest.php b/tests/Predis/Connection/Cluster/RedisClusterTest.php index 038f89c3..acdeb2c1 100644 --- a/tests/Predis/Connection/Cluster/RedisClusterTest.php +++ b/tests/Predis/Connection/Cluster/RedisClusterTest.php @@ -849,7 +849,7 @@ class RedisClusterTest extends PredisTestCase public function testAskSlotMapHonorsRetryLimitOnMultipleConnectionFailures(): void { $this->expectException('Predis\Connection\ConnectionException'); - $this->expectExceptionMessage("Unknown connection error [127.0.0.1:6382]"); + $this->expectExceptionMessage('Unknown connection error [127.0.0.1:6382]'); $slotsmap = [ [0, 5460, ['127.0.0.1', 9381], []], @@ -1310,7 +1310,7 @@ class RedisClusterTest extends PredisTestCase */ public function testRetryCommandSuccessOnClusterDownErrors() { - $clusterDownError= new Response\Error("CLUSTERDOWN") ; + $clusterDownError= new Response\Error('CLUSTERDOWN') ; $command = Command\RawCommand::create('get', 'node:1001'); @@ -1341,7 +1341,7 @@ class RedisClusterTest extends PredisTestCase $this->expectException('Predis\Response\ServerException'); $this->expectExceptionMessage('CLUSTERDOWN'); - $clusterDownError= new Response\Error("CLUSTERDOWN") ; + $clusterDownError= new Response\Error('CLUSTERDOWN') ; $command = Command\RawCommand::create('get', 'node:1001'); @@ -1438,7 +1438,7 @@ class RedisClusterTest extends PredisTestCase $t2 = $t1 * 2; $expectedTime = ($t1 + $t2 )/1000 ; // expected time for 2 retries (fail 1=wait 2s, fail 2=wait 4s , OK) - $this->AssertEqualsWithDelta($expectedTime, $totalTime, 1, "Unexpected execution time") ; + $this->AssertEqualsWithDelta($expectedTime, $totalTime, 1, 'Unexpected execution time') ; $this->assertCount(16384, $cluster->getSlotMap()); } diff --git a/tests/Predis/Connection/CompositeStreamConnectionTest.php b/tests/Predis/Connection/CompositeStreamConnectionTest.php index 20bbc200..c9d5802a 100644 --- a/tests/Predis/Connection/CompositeStreamConnectionTest.php +++ b/tests/Predis/Connection/CompositeStreamConnectionTest.php @@ -35,7 +35,7 @@ class CompositeStreamConnectionTest extends PredisConnectionTestCase public function testThrowsExceptionOnInitializationCommandFailure(): void { $this->expectException('Predis\Connection\ConnectionException'); - $this->expectExceptionMessage("`SELECT` failed: ERR invalid DB index [tcp://127.0.0.1:6379]"); + $this->expectExceptionMessage('`SELECT` failed: ERR invalid DB index [tcp://127.0.0.1:6379]'); $cmdSelect = RawCommand::create('SELECT', '1000'); diff --git a/tests/Predis/Connection/ParametersTest.php b/tests/Predis/Connection/ParametersTest.php index eaeef2ba..351a6367 100644 --- a/tests/Predis/Connection/ParametersTest.php +++ b/tests/Predis/Connection/ParametersTest.php @@ -341,7 +341,7 @@ class ParametersTest extends PredisTestCase public function testParsingURIThrowOnInvalidURI(): void { $this->expectException('InvalidArgumentException'); - $this->expectExceptionMessage("Invalid parameters URI: tcp://invalid:uri"); + $this->expectExceptionMessage('Invalid parameters URI: tcp://invalid:uri'); Parameters::parse('tcp://invalid:uri'); } diff --git a/tests/Predis/Connection/PhpiredisSocketConnectionTest.php b/tests/Predis/Connection/PhpiredisSocketConnectionTest.php index 062e6df5..b9437370 100644 --- a/tests/Predis/Connection/PhpiredisSocketConnectionTest.php +++ b/tests/Predis/Connection/PhpiredisSocketConnectionTest.php @@ -62,7 +62,7 @@ class PhpiredisSocketConnectionTest extends PredisConnectionTestCase public function testThrowsExceptionOnInitializationCommandFailure(): void { $this->expectException('Predis\Connection\ConnectionException'); - $this->expectExceptionMessage("`SELECT` failed: ERR invalid DB index [tcp://127.0.0.1:6379]"); + $this->expectExceptionMessage('`SELECT` failed: ERR invalid DB index [tcp://127.0.0.1:6379]'); $cmdSelect = RawCommand::create('SELECT', '1000'); diff --git a/tests/Predis/Connection/PhpiredisStreamConnectionTest.php b/tests/Predis/Connection/PhpiredisStreamConnectionTest.php index 0e36816e..2f689174 100644 --- a/tests/Predis/Connection/PhpiredisStreamConnectionTest.php +++ b/tests/Predis/Connection/PhpiredisStreamConnectionTest.php @@ -62,7 +62,7 @@ class PhpiredisStreamConnectionTest extends PredisConnectionTestCase public function testThrowsExceptionOnInitializationCommandFailure(): void { $this->expectException('Predis\Connection\ConnectionException'); - $this->expectExceptionMessage("`SELECT` failed: ERR invalid DB index [tcp://127.0.0.1:6379]"); + $this->expectExceptionMessage('`SELECT` failed: ERR invalid DB index [tcp://127.0.0.1:6379]'); $cmdSelect = RawCommand::create('SELECT', '1000'); diff --git a/tests/Predis/Connection/StreamConnectionTest.php b/tests/Predis/Connection/StreamConnectionTest.php index a40363bc..b950af50 100644 --- a/tests/Predis/Connection/StreamConnectionTest.php +++ b/tests/Predis/Connection/StreamConnectionTest.php @@ -35,7 +35,7 @@ class StreamConnectionTest extends PredisConnectionTestCase public function testThrowsExceptionOnInitializationCommandFailure(): void { $this->expectException('Predis\Connection\ConnectionException'); - $this->expectExceptionMessage("`SELECT` failed: ERR invalid DB index [tcp://127.0.0.1:6379]"); + $this->expectExceptionMessage('`SELECT` failed: ERR invalid DB index [tcp://127.0.0.1:6379]'); $cmdSelect = RawCommand::create('SELECT', '1000');