From dc14c2967668854e3ab32469b20ceb9ffc414ff3 Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Sun, 15 Jan 2012 12:26:25 +0100 Subject: [PATCH] Rename certain namespaces, interfaces and classes. Now we follow a Symfony2-like naming convention for namespaces, interfaces and classes sticking with one clear rule. - Renamed namespaces: - Predis\Network - Predis\Profiles - Predis\Iterators - Predis\Options - Predis\Commands - Predis\Commands\Processors - Renamed interfaces: - Predis\IReplyObject - Predis\IRedisServerError - Predis\IConnectionFactory - Predis\IConnectionParameters - Predis\Options\IOption - Predis\Options\IClientOptions - Predis\Profile\IServerProfile - Predis\Pipeline\IPipelineExecutor - Predis\Distribution\INodeKeyGenerator - Predis\Distribution\IDistributionStrategy - Predis\Protocol\IProtocolProcessor - Predis\Protocol\IResponseReader - Predis\Protocol\IResponseHandler - Predis\Protocol\ICommandSerializer - Predis\Protocol\IComposableProtocolProcessor - Predis\Network\IConnection - Predis\Network\IConnectionSingle - Predis\Network\IConnectionComposable - Predis\Network\IConnectionCluster - Predis\Network\IConnectionReplication - Predis\Commands\ICommand - Predis\Commands\IPrefixable - Predis\Command\Processor\ICommandProcessor - Predis\Command\Processor\ICommandProcessorChain - Predis\Command\Processor\IProcessingSupport - Renamed Classes: - Predis\Commands\Command - Predis\Network\ConnectionBase - Classes moved to different namespaces: - Predis\MonitorContext Meh --- CHANGELOG.md | 67 ++++++ FAQ.PERFORMANCES.md | 2 +- README.md | 10 +- bin/generate-command-test.php | 22 +- examples/CustomDistributionStrategy.php | 10 +- examples/MasterSlaveReplicationComplex.php | 8 +- examples/ServerSideScripting.php | 4 +- examples/SimpleDebuggableConnection.php | 10 +- lib/Predis/Client.php | 46 ++-- .../AbstractCommand.php} | 10 +- .../CommandInterface.php} | 10 +- .../{Commands => Command}/ConnectionAuth.php | 4 +- .../{Commands => Command}/ConnectionEcho.php | 4 +- .../{Commands => Command}/ConnectionPing.php | 4 +- .../{Commands => Command}/ConnectionQuit.php | 4 +- .../ConnectionSelect.php | 4 +- .../{Commands => Command}/HashDelete.php | 2 +- .../{Commands => Command}/HashExists.php | 2 +- lib/Predis/{Commands => Command}/HashGet.php | 2 +- .../{Commands => Command}/HashGetAll.php | 4 +- .../{Commands => Command}/HashGetMultiple.php | 2 +- .../{Commands => Command}/HashIncrementBy.php | 2 +- .../HashIncrementByFloat.php | 2 +- lib/Predis/{Commands => Command}/HashKeys.php | 2 +- .../{Commands => Command}/HashLength.php | 2 +- lib/Predis/{Commands => Command}/HashSet.php | 2 +- .../{Commands => Command}/HashSetMultiple.php | 2 +- .../{Commands => Command}/HashSetPreserve.php | 2 +- .../{Commands => Command}/HashValues.php | 2 +- .../{Commands => Command}/KeyDelete.php | 4 +- .../{Commands => Command}/KeyExists.php | 2 +- .../{Commands => Command}/KeyExpire.php | 2 +- .../{Commands => Command}/KeyExpireAt.php | 2 +- lib/Predis/{Commands => Command}/KeyKeys.php | 2 +- .../{Commands => Command}/KeyKeysV12x.php | 2 +- lib/Predis/{Commands => Command}/KeyMove.php | 2 +- .../{Commands => Command}/KeyPersist.php | 2 +- .../KeyPreciseExpire.php | 2 +- .../KeyPreciseExpireAt.php | 2 +- .../KeyPreciseTimeToLive.php | 2 +- .../{Commands => Command}/KeyRandom.php | 4 +- .../{Commands => Command}/KeyRename.php | 4 +- .../KeyRenamePreserve.php | 2 +- lib/Predis/{Commands => Command}/KeySort.php | 4 +- .../{Commands => Command}/KeyTimeToLive.php | 2 +- lib/Predis/{Commands => Command}/KeyType.php | 2 +- .../{Commands => Command}/ListIndex.php | 2 +- .../{Commands => Command}/ListInsert.php | 2 +- .../{Commands => Command}/ListLength.php | 2 +- .../{Commands => Command}/ListPopFirst.php | 2 +- .../ListPopFirstBlocking.php | 4 +- .../{Commands => Command}/ListPopLast.php | 2 +- .../ListPopLastBlocking.php | 2 +- .../ListPopLastPushHead.php | 4 +- .../ListPopLastPushHeadBlocking.php | 4 +- .../{Commands => Command}/ListPushHead.php | 2 +- .../{Commands => Command}/ListPushHeadX.php | 2 +- .../{Commands => Command}/ListPushTail.php | 2 +- .../{Commands => Command}/ListPushTailX.php | 2 +- .../{Commands => Command}/ListRange.php | 2 +- .../{Commands => Command}/ListRemove.php | 2 +- lib/Predis/{Commands => Command}/ListSet.php | 2 +- lib/Predis/{Commands => Command}/ListTrim.php | 2 +- .../{Commands => Command}/PrefixHelpers.php | 18 +- .../PrefixableCommand.php | 4 +- .../PrefixableCommandInterface.php} | 6 +- .../Processor/CommandProcessingInterface.php} | 10 +- .../CommandProcessorChainInterface.php} | 12 +- .../Processor/CommandProcessorInterface.php} | 10 +- .../Processor}/KeyPrefixProcessor.php | 12 +- .../Processor}/ProcessorChain.php | 18 +- .../{Commands => Command}/PubSubPublish.php | 2 +- .../{Commands => Command}/PubSubSubscribe.php | 4 +- .../PubSubSubscribeByPattern.php | 2 +- .../PubSubUnsubscribe.php | 4 +- .../PubSubUnsubscribeByPattern.php | 2 +- .../{Commands => Command}/ScriptedCommand.php | 2 +- .../ServerBackgroundRewriteAOF.php | 4 +- .../ServerBackgroundSave.php | 4 +- .../{Commands => Command}/ServerClient.php | 4 +- .../{Commands => Command}/ServerConfig.php | 6 +- .../ServerDatabaseSize.php | 4 +- .../{Commands => Command}/ServerEval.php | 4 +- .../{Commands => Command}/ServerEvalSHA.php | 2 +- .../{Commands => Command}/ServerFlushAll.php | 4 +- .../ServerFlushDatabase.php | 4 +- .../{Commands => Command}/ServerInfo.php | 4 +- .../{Commands => Command}/ServerInfoV26x.php | 2 +- .../{Commands => Command}/ServerLastSave.php | 4 +- .../{Commands => Command}/ServerMonitor.php | 4 +- .../{Commands => Command}/ServerObject.php | 4 +- .../{Commands => Command}/ServerSave.php | 4 +- .../{Commands => Command}/ServerScript.php | 4 +- .../{Commands => Command}/ServerShutdown.php | 4 +- .../{Commands => Command}/ServerSlaveOf.php | 4 +- .../{Commands => Command}/ServerSlowlog.php | 6 +- lib/Predis/{Commands => Command}/SetAdd.php | 2 +- .../{Commands => Command}/SetCardinality.php | 2 +- .../{Commands => Command}/SetDifference.php | 2 +- .../SetDifferenceStore.php | 2 +- .../{Commands => Command}/SetIntersection.php | 4 +- .../SetIntersectionStore.php | 4 +- .../{Commands => Command}/SetIsMember.php | 2 +- .../{Commands => Command}/SetMembers.php | 2 +- lib/Predis/{Commands => Command}/SetMove.php | 4 +- lib/Predis/{Commands => Command}/SetPop.php | 2 +- .../{Commands => Command}/SetRandomMember.php | 2 +- .../{Commands => Command}/SetRemove.php | 2 +- lib/Predis/{Commands => Command}/SetUnion.php | 2 +- .../{Commands => Command}/SetUnionStore.php | 2 +- .../{Commands => Command}/StringAppend.php | 2 +- .../{Commands => Command}/StringDecrement.php | 2 +- .../StringDecrementBy.php | 2 +- .../{Commands => Command}/StringGet.php | 2 +- .../{Commands => Command}/StringGetBit.php | 2 +- .../StringGetMultiple.php | 4 +- .../{Commands => Command}/StringGetRange.php | 2 +- .../{Commands => Command}/StringGetSet.php | 2 +- .../{Commands => Command}/StringIncrement.php | 2 +- .../StringIncrementBy.php | 2 +- .../StringIncrementByFloat.php | 2 +- .../StringPreciseSetExpire.php | 2 +- .../{Commands => Command}/StringSet.php | 2 +- .../{Commands => Command}/StringSetBit.php | 2 +- .../{Commands => Command}/StringSetExpire.php | 2 +- .../StringSetMultiple.php | 4 +- .../StringSetMultiplePreserve.php | 2 +- .../StringSetPreserve.php | 2 +- .../{Commands => Command}/StringSetRange.php | 2 +- .../{Commands => Command}/StringStrlen.php | 2 +- .../{Commands => Command}/StringSubstr.php | 2 +- .../TransactionDiscard.php | 4 +- .../{Commands => Command}/TransactionExec.php | 4 +- .../TransactionMulti.php | 4 +- .../TransactionUnwatch.php | 4 +- .../TransactionWatch.php | 4 +- lib/Predis/{Commands => Command}/ZSetAdd.php | 2 +- .../{Commands => Command}/ZSetCardinality.php | 2 +- .../{Commands => Command}/ZSetCount.php | 2 +- .../{Commands => Command}/ZSetIncrementBy.php | 2 +- .../ZSetIntersectionStore.php | 2 +- .../{Commands => Command}/ZSetRange.php | 4 +- .../ZSetRangeByScore.php | 2 +- lib/Predis/{Commands => Command}/ZSetRank.php | 2 +- .../{Commands => Command}/ZSetRemove.php | 2 +- .../ZSetRemoveRangeByRank.php | 2 +- .../ZSetRemoveRangeByScore.php | 2 +- .../ZSetReverseRange.php | 2 +- .../ZSetReverseRangeByScore.php | 2 +- .../{Commands => Command}/ZSetReverseRank.php | 2 +- .../{Commands => Command}/ZSetScore.php | 2 +- .../{Commands => Command}/ZSetUnionStore.php | 2 +- lib/Predis/CommunicationException.php | 8 +- .../AbstractConnection.php} | 32 +-- .../ClusterConnectionInterface.php} | 22 +- .../ComposableConnectionInterface.php} | 10 +- .../ComposableStreamConnection.php | 22 +- .../ConnectionException.php | 2 +- .../ConnectionInterface.php} | 18 +- .../MasterSlaveReplication.php | 30 +-- .../PhpiredisConnection.php | 28 +-- .../{Network => Connection}/PredisCluster.php | 28 +-- .../ReplicationConnectionInterface.php} | 28 +-- .../SingleConnectionInterface.php} | 13 +- .../StreamConnection.php | 22 +- .../WebdisConnection.php | 37 +-- lib/Predis/ConnectionFactory.php | 47 ++-- ...ory.php => ConnectionFactoryInterface.php} | 26 +-- lib/Predis/ConnectionParameters.php | 11 +- ....php => ConnectionParametersInterface.php} | 2 +- ....php => DistributionStrategyInterface.php} | 2 +- ...nerator.php => HashGeneratorInterface.php} | 4 +- lib/Predis/Distribution/HashRing.php | 4 +- lib/Predis/Distribution/KetamaPureRing.php | 2 +- lib/Predis/Helpers.php | 18 +- .../MultiBulkResponse.php | 2 +- .../MultiBulkResponseSimple.php | 9 +- .../MultiBulkResponseTuple.php | 2 +- lib/Predis/{ => Monitor}/MonitorContext.php | 6 +- .../Option.php => Option/AbstractOption.php} | 10 +- .../{Options => Option}/ClientCluster.php | 28 +-- .../ClientConnectionFactory.php | 16 +- .../{Options => Option}/ClientOptions.php | 6 +- .../ClientOptionsInterface.php} | 4 +- .../{Options => Option}/ClientPrefix.php | 8 +- .../{Options => Option}/ClientProfile.php | 14 +- .../{Options => Option}/ClientReplication.php | 30 +-- .../{Options => Option}/CustomOption.php | 10 +- .../OptionInterface.php} | 10 +- lib/Predis/Pipeline/FireAndForgetExecutor.php | 6 +- lib/Predis/Pipeline/PipelineContext.php | 22 +- ...utor.php => PipelineExecutorInterface.php} | 8 +- lib/Predis/Pipeline/SafeClusterExecutor.php | 6 +- lib/Predis/Pipeline/SafeExecutor.php | 6 +- lib/Predis/Pipeline/StandardExecutor.php | 6 +- .../{Profiles => Profile}/ServerProfile.php | 38 ++-- .../ServerProfileInterface.php} | 6 +- lib/Predis/Profile/ServerVersion12.php | 125 +++++++++++ lib/Predis/Profile/ServerVersion20.php | 174 +++++++++++++++ lib/Predis/Profile/ServerVersion22.php | 204 +++++++++++++++++ lib/Predis/Profile/ServerVersion24.php | 210 ++++++++++++++++++ .../ServerVersionNext.php | 22 +- lib/Predis/Profiles/ServerVersion12.php | 125 ----------- lib/Predis/Profiles/ServerVersion20.php | 174 --------------- lib/Predis/Profiles/ServerVersion22.php | 204 ----------------- lib/Predis/Profiles/ServerVersion24.php | 210 ------------------ ...zer.php => CommandSerializerInterface.php} | 8 +- ...or.php => ComposableProtocolInterface.php} | 14 +- ...colProcessor.php => ProtocolInterface.php} | 12 +- ...ndler.php => ResponseHandlerInterface.php} | 8 +- ...Reader.php => ResponseReaderInterface.php} | 8 +- .../Protocol/Text/ComposableTextProtocol.php | 22 +- .../Protocol/Text/ResponseBulkHandler.php | 10 +- .../Protocol/Text/ResponseErrorHandler.php | 8 +- .../Text/ResponseErrorSilentHandler.php | 8 +- .../Protocol/Text/ResponseIntegerHandler.php | 10 +- .../Text/ResponseMultiBulkHandler.php | 10 +- .../Text/ResponseMultiBulkStreamHandler.php | 12 +- .../Protocol/Text/ResponseStatusHandler.php | 8 +- .../Protocol/Text/TextCommandSerializer.php | 8 +- lib/Predis/Protocol/Text/TextProtocol.php | 14 +- .../Protocol/Text/TextResponseReader.php | 20 +- lib/Predis/ResponseError.php | 2 +- ...erError.php => ResponseErrorInterface.php} | 2 +- ...Object.php => ResponseObjectInterface.php} | 2 +- lib/Predis/ResponseQueued.php | 2 +- lib/Predis/ServerException.php | 2 +- lib/Predis/Transaction/MultiExecContext.php | 8 +- tests/PHPUnit/CommandTestCase.php | 22 +- tests/PHPUnit/ConnectionTestCase.php | 10 +- .../PHPUnit/DistributionStrategyTestCase.php | 8 +- tests/PHPUnit/ServerVersionTestCase.php | 8 +- tests/Predis/ClientTest.php | 76 +++---- .../{Commands => Command}/CommandTest.php | 46 ++-- .../ConnectionAuthTest.php | 4 +- .../ConnectionEchoTest.php | 4 +- .../ConnectionPingTest.php | 4 +- .../ConnectionQuitTest.php | 4 +- .../ConnectionSelectTest.php | 4 +- .../{Commands => Command}/HashDeleteTest.php | 4 +- .../{Commands => Command}/HashExistsTest.php | 4 +- .../{Commands => Command}/HashGetAllTest.php | 4 +- .../HashGetMultipleTest.php | 4 +- .../{Commands => Command}/HashGetTest.php | 4 +- .../HashIncrementByFloatTest.php | 4 +- .../HashIncrementByTest.php | 4 +- .../{Commands => Command}/HashKeysTest.php | 4 +- .../{Commands => Command}/HashLengthTest.php | 4 +- .../HashSetMultipleTest.php | 4 +- .../HashSetPreserveTest.php | 4 +- .../{Commands => Command}/HashSetTest.php | 4 +- .../{Commands => Command}/HashValuesTest.php | 4 +- .../{Commands => Command}/KeyDeleteTest.php | 4 +- .../{Commands => Command}/KeyExistsTest.php | 4 +- .../{Commands => Command}/KeyExpireAtTest.php | 4 +- .../{Commands => Command}/KeyExpireTest.php | 4 +- .../{Commands => Command}/KeyKeysTest.php | 4 +- .../{Commands => Command}/KeyKeysV12xTest.php | 4 +- .../{Commands => Command}/KeyMoveTest.php | 4 +- .../{Commands => Command}/KeyPersistTest.php | 4 +- .../KeyPreciseExpireAtTest.php | 4 +- .../KeyPreciseExpireTest.php | 4 +- .../KeyPreciseTimeToLiveTest.php | 4 +- .../{Commands => Command}/KeyRandomTest.php | 4 +- .../KeyRenamePreserveTest.php | 4 +- .../{Commands => Command}/KeyRenameTest.php | 4 +- .../{Commands => Command}/KeySortTest.php | 4 +- .../KeyTimeToLiveTest.php | 4 +- .../{Commands => Command}/KeyTypeTest.php | 4 +- .../{Commands => Command}/ListIndexTest.php | 4 +- .../{Commands => Command}/ListInsertTest.php | 4 +- .../{Commands => Command}/ListLengthTest.php | 4 +- .../ListPopFirstBlockingTest.php | 4 +- .../ListPopFirstTest.php | 4 +- .../ListPopLastBlockingTest.php | 4 +- .../ListPopLastPushHeadBlockingTest.php | 4 +- .../ListPopLastPushHeadTest.php | 4 +- .../{Commands => Command}/ListPopLastTest.php | 4 +- .../ListPushHeadTest.php | 4 +- .../ListPushHeadXTest.php | 4 +- .../ListPushTailTest.php | 4 +- .../ListPushTailXTest.php | 4 +- .../{Commands => Command}/ListRangeTest.php | 4 +- .../{Commands => Command}/ListRemoveTest.php | 4 +- .../{Commands => Command}/ListSetTest.php | 4 +- .../{Commands => Command}/ListTrimTest.php | 4 +- .../PrefixHelpersTest.php | 10 +- .../PrefixableCommandTest.php | 12 +- .../Processor}/KeyPrefixProcessorTest.php | 8 +- .../Processor}/ProcessorChainTest.php | 44 ++-- .../PubSubPublishTest.php | 4 +- .../PubSubSubscribeByPatternTest.php | 4 +- .../PubSubSubscribeTest.php | 4 +- .../PubSubUnsubscribeByPatternTest.php | 4 +- .../PubSubUnsubscribeTest.php | 4 +- .../ScriptedCommandTest.php | 10 +- .../ServerBackgroundRewriteAOFTest.php | 4 +- .../ServerBackgroundSaveTest.php | 4 +- .../ServerClientTest.php | 4 +- .../ServerConfigTest.php | 4 +- .../ServerDatabaseSizeTest.php | 4 +- .../ServerEvalSHATest.php | 4 +- .../{Commands => Command}/ServerEvalTest.php | 4 +- .../ServerFlushAllTest.php | 4 +- .../ServerFlushDatabaseTest.php | 4 +- .../{Commands => Command}/ServerInfoTest.php | 4 +- .../ServerInfoV26xTest.php | 4 +- .../ServerLastSaveTest.php | 4 +- .../ServerMonitorTest.php | 4 +- .../ServerObjectTest.php | 4 +- .../{Commands => Command}/ServerSaveTest.php | 4 +- .../ServerScriptTest.php | 4 +- .../ServerShutdownTest.php | 4 +- .../ServerSlaveOfTest.php | 4 +- .../ServerSlowlogTest.php | 4 +- .../{Commands => Command}/SetAddTest.php | 4 +- .../SetCardinalityTest.php | 4 +- .../SetDifferenceStoreTest.php | 4 +- .../SetDifferenceTest.php | 4 +- .../SetIntersectionStoreTest.php | 4 +- .../SetIntersectionTest.php | 4 +- .../{Commands => Command}/SetIsMemberTest.php | 4 +- .../{Commands => Command}/SetMembersTest.php | 4 +- .../{Commands => Command}/SetMoveTest.php | 4 +- .../{Commands => Command}/SetPopTest.php | 4 +- .../SetRandomMemberTest.php | 4 +- .../{Commands => Command}/SetRemoveTest.php | 4 +- .../SetUnionStoreTest.php | 4 +- .../{Commands => Command}/SetUnionTest.php | 4 +- .../StringAppendTest.php | 4 +- .../StringDecrementByTest.php | 4 +- .../StringDecrementTest.php | 4 +- .../StringGetBitTest.php | 4 +- .../StringGetMultipleTest.php | 4 +- .../StringGetRangeTest.php | 4 +- .../StringGetSetTest.php | 4 +- .../{Commands => Command}/StringGetTest.php | 4 +- .../StringIncrementByFloatTest.php | 4 +- .../StringIncrementByTest.php | 4 +- .../StringIncrementTest.php | 4 +- .../StringPreciseSetExpireTest.php | 4 +- .../StringSetBitTest.php | 4 +- .../StringSetExpireTest.php | 4 +- .../StringSetMultiplePreserveTest.php | 4 +- .../StringSetMultipleTest.php | 4 +- .../StringSetRangeTest.php | 4 +- .../{Commands => Command}/StringSetTest.php | 4 +- .../StringStrlenTest.php | 4 +- .../StringSubstrTest.php | 4 +- .../TransactionDiscardTest.php | 4 +- .../TransactionExecTest.php | 4 +- .../TransactionMultiTest.php | 6 +- .../TransactionUnwatchTest.php | 4 +- .../TransactionWatchTest.php | 4 +- .../{Commands => Command}/ZSetAddTest.php | 4 +- .../ZSetCardinalityTest.php | 4 +- .../{Commands => Command}/ZSetCountTest.php | 4 +- .../ZSetIncrementByTest.php | 4 +- .../ZSetIntersectionStoreTest.php | 4 +- .../ZSetRangeByScoreTest.php | 4 +- .../{Commands => Command}/ZSetRangeTest.php | 4 +- .../{Commands => Command}/ZSetRankTest.php | 4 +- .../ZSetRemoveRangeByRankTest.php | 4 +- .../ZSetRemoveRangeByScoreTest.php | 4 +- .../{Commands => Command}/ZSetRemoveTest.php | 4 +- .../ZSetReverseRangeByScoreTest.php | 4 +- .../ZSetReverseRangeTest.php | 4 +- .../ZSetReverseRankTest.php | 4 +- .../{Commands => Command}/ZSetScoreTest.php | 4 +- .../ZSetUnionStoreTest.php | 4 +- tests/Predis/CommunicationExceptionTest.php | 12 +- .../ConnectionExceptionTest.php | 6 +- .../MasterSlaveReplicationTest.php | 8 +- .../PhpiredisConnectionTest.php | 6 +- .../PredisClusterTest.php | 8 +- .../StreamConnectionTest.php | 6 +- .../WebdisConnectionTest.php | 16 +- tests/Predis/ConnectionFactoryTest.php | 48 ++-- tests/Predis/Distribution/HashRingTest.php | 4 +- .../Distribution/KetamaPureRingTest.php | 4 +- tests/Predis/HelpersTest.php | 6 +- .../MultiBulkResponseSimpleTest.php | 4 +- .../MultiBulkResponseTupleTest.php | 6 +- .../{ => Monitor}/MonitorContextTest.php | 17 +- .../AbstractOptionTest.php} | 20 +- .../{Options => Option}/ClientClusterTest.php | 30 +-- .../ClientConnectionFactoryTest.php | 36 +-- .../{Options => Option}/ClientOptionsTest.php | 18 +- .../{Options => Option}/ClientPrefixTest.php | 14 +- .../{Options => Option}/ClientProfileTest.php | 52 ++--- .../{Options => Option}/CustomOptionTest.php | 14 +- tests/Predis/Pipeline/PipelineContextTest.php | 24 +- .../ServerProfileTest.php | 36 +-- .../ServerVersion12Test.php | 2 +- .../ServerVersion20Test.php | 2 +- .../ServerVersion22Test.php | 2 +- .../ServerVersion24Test.php | 2 +- .../ServerVersionNextTest.php | 2 +- .../Predis/Protocol/ProtocolExceptionTest.php | 4 +- tests/Predis/PubSub/DispatcherLoopTest.php | 2 +- tests/Predis/PubSub/PubSubContextTest.php | 26 +-- tests/Predis/ResponseErrorTest.php | 4 +- tests/Predis/ResponseQueuedTest.php | 2 +- tests/Predis/ServerExceptionTest.php | 4 +- .../Transaction/MultiExecContextTest.php | 18 +- tests/README.md | 4 +- 406 files changed, 2138 insertions(+), 2071 deletions(-) rename lib/Predis/{Commands/Command.php => Command/AbstractCommand.php} (93%) rename lib/Predis/{Commands/ICommand.php => Command/CommandInterface.php} (84%) rename lib/Predis/{Commands => Command}/ConnectionAuth.php (88%) rename lib/Predis/{Commands => Command}/ConnectionEcho.php (88%) rename lib/Predis/{Commands => Command}/ConnectionPing.php (90%) rename lib/Predis/{Commands => Command}/ConnectionQuit.php (88%) rename lib/Predis/{Commands => Command}/ConnectionSelect.php (88%) rename lib/Predis/{Commands => Command}/HashDelete.php (96%) rename lib/Predis/{Commands => Command}/HashExists.php (95%) rename lib/Predis/{Commands => Command}/HashGet.php (94%) rename lib/Predis/{Commands => Command}/HashGetAll.php (92%) rename lib/Predis/{Commands => Command}/HashGetMultiple.php (96%) rename lib/Predis/{Commands => Command}/HashIncrementBy.php (94%) rename lib/Predis/{Commands => Command}/HashIncrementByFloat.php (95%) rename lib/Predis/{Commands => Command}/HashKeys.php (94%) rename lib/Predis/{Commands => Command}/HashLength.php (94%) rename lib/Predis/{Commands => Command}/HashSet.php (95%) rename lib/Predis/{Commands => Command}/HashSetMultiple.php (97%) rename lib/Predis/{Commands => Command}/HashSetPreserve.php (95%) rename lib/Predis/{Commands => Command}/HashValues.php (94%) rename lib/Predis/{Commands => Command}/KeyDelete.php (90%) rename lib/Predis/{Commands => Command}/KeyExists.php (95%) rename lib/Predis/{Commands => Command}/KeyExpire.php (95%) rename lib/Predis/{Commands => Command}/KeyExpireAt.php (95%) rename lib/Predis/{Commands => Command}/KeyKeys.php (95%) rename lib/Predis/{Commands => Command}/KeyKeysV12x.php (95%) rename lib/Predis/{Commands => Command}/KeyMove.php (96%) rename lib/Predis/{Commands => Command}/KeyPersist.php (95%) rename lib/Predis/{Commands => Command}/KeyPreciseExpire.php (94%) rename lib/Predis/{Commands => Command}/KeyPreciseExpireAt.php (94%) rename lib/Predis/{Commands => Command}/KeyPreciseTimeToLive.php (94%) rename lib/Predis/{Commands => Command}/KeyRandom.php (91%) rename lib/Predis/{Commands => Command}/KeyRename.php (86%) rename lib/Predis/{Commands => Command}/KeyRenamePreserve.php (95%) rename lib/Predis/{Commands => Command}/KeySort.php (96%) rename lib/Predis/{Commands => Command}/KeyTimeToLive.php (94%) rename lib/Predis/{Commands => Command}/KeyType.php (94%) rename lib/Predis/{Commands => Command}/ListIndex.php (94%) rename lib/Predis/{Commands => Command}/ListInsert.php (94%) rename lib/Predis/{Commands => Command}/ListLength.php (94%) rename lib/Predis/{Commands => Command}/ListPopFirst.php (94%) rename lib/Predis/{Commands => Command}/ListPopFirstBlocking.php (90%) rename lib/Predis/{Commands => Command}/ListPopLast.php (94%) rename lib/Predis/{Commands => Command}/ListPopLastBlocking.php (94%) rename lib/Predis/{Commands => Command}/ListPopLastPushHead.php (86%) rename lib/Predis/{Commands => Command}/ListPopLastPushHeadBlocking.php (86%) rename lib/Predis/{Commands => Command}/ListPushHead.php (94%) rename lib/Predis/{Commands => Command}/ListPushHeadX.php (94%) rename lib/Predis/{Commands => Command}/ListPushTail.php (96%) rename lib/Predis/{Commands => Command}/ListPushTailX.php (94%) rename lib/Predis/{Commands => Command}/ListRange.php (94%) rename lib/Predis/{Commands => Command}/ListRemove.php (94%) rename lib/Predis/{Commands => Command}/ListSet.php (94%) rename lib/Predis/{Commands => Command}/ListTrim.php (94%) rename lib/Predis/{Commands => Command}/PrefixHelpers.php (77%) rename lib/Predis/{Commands => Command}/PrefixableCommand.php (83%) rename lib/Predis/{Commands/IPrefixable.php => Command/PrefixableCommandInterface.php} (85%) rename lib/Predis/{Commands/Processors/IProcessingSupport.php => Command/Processor/CommandProcessingInterface.php} (68%) rename lib/Predis/{Commands/Processors/ICommandProcessorChain.php => Command/Processor/CommandProcessorChainInterface.php} (63%) rename lib/Predis/{Commands/Processors/ICommandProcessor.php => Command/Processor/CommandProcessorInterface.php} (66%) rename lib/Predis/{Commands/Processors => Command/Processor}/KeyPrefixProcessor.php (78%) rename lib/Predis/{Commands/Processors => Command/Processor}/ProcessorChain.php (80%) rename lib/Predis/{Commands => Command}/PubSubPublish.php (95%) rename lib/Predis/{Commands => Command}/PubSubSubscribe.php (88%) rename lib/Predis/{Commands => Command}/PubSubSubscribeByPattern.php (95%) rename lib/Predis/{Commands => Command}/PubSubUnsubscribe.php (88%) rename lib/Predis/{Commands => Command}/PubSubUnsubscribeByPattern.php (95%) rename lib/Predis/{Commands => Command}/ScriptedCommand.php (98%) rename lib/Predis/{Commands => Command}/ServerBackgroundRewriteAOF.php (89%) rename lib/Predis/{Commands => Command}/ServerBackgroundSave.php (90%) rename lib/Predis/{Commands => Command}/ServerClient.php (95%) rename lib/Predis/{Commands => Command}/ServerConfig.php (90%) rename lib/Predis/{Commands => Command}/ServerDatabaseSize.php (88%) rename lib/Predis/{Commands => Command}/ServerEval.php (91%) rename lib/Predis/{Commands => Command}/ServerEvalSHA.php (94%) rename lib/Predis/{Commands => Command}/ServerFlushAll.php (88%) rename lib/Predis/{Commands => Command}/ServerFlushDatabase.php (88%) rename lib/Predis/{Commands => Command}/ServerInfo.php (97%) rename lib/Predis/{Commands => Command}/ServerInfoV26x.php (98%) rename lib/Predis/{Commands => Command}/ServerLastSave.php (88%) rename lib/Predis/{Commands => Command}/ServerMonitor.php (88%) rename lib/Predis/{Commands => Command}/ServerObject.php (89%) rename lib/Predis/{Commands => Command}/ServerSave.php (89%) rename lib/Predis/{Commands => Command}/ServerScript.php (89%) rename lib/Predis/{Commands => Command}/ServerShutdown.php (88%) rename lib/Predis/{Commands => Command}/ServerSlaveOf.php (92%) rename lib/Predis/{Commands => Command}/ServerSlowlog.php (93%) rename lib/Predis/{Commands => Command}/SetAdd.php (96%) rename lib/Predis/{Commands => Command}/SetCardinality.php (94%) rename lib/Predis/{Commands => Command}/SetDifference.php (94%) rename lib/Predis/{Commands => Command}/SetDifferenceStore.php (94%) rename lib/Predis/{Commands => Command}/SetIntersection.php (89%) rename lib/Predis/{Commands => Command}/SetIntersectionStore.php (89%) rename lib/Predis/{Commands => Command}/SetIsMember.php (95%) rename lib/Predis/{Commands => Command}/SetMembers.php (94%) rename lib/Predis/{Commands => Command}/SetMove.php (88%) rename lib/Predis/{Commands => Command}/SetPop.php (94%) rename lib/Predis/{Commands => Command}/SetRandomMember.php (94%) rename lib/Predis/{Commands => Command}/SetRemove.php (96%) rename lib/Predis/{Commands => Command}/SetUnion.php (94%) rename lib/Predis/{Commands => Command}/SetUnionStore.php (94%) rename lib/Predis/{Commands => Command}/StringAppend.php (94%) rename lib/Predis/{Commands => Command}/StringDecrement.php (94%) rename lib/Predis/{Commands => Command}/StringDecrementBy.php (94%) rename lib/Predis/{Commands => Command}/StringGet.php (94%) rename lib/Predis/{Commands => Command}/StringGetBit.php (94%) rename lib/Predis/{Commands => Command}/StringGetMultiple.php (89%) rename lib/Predis/{Commands => Command}/StringGetRange.php (94%) rename lib/Predis/{Commands => Command}/StringGetSet.php (94%) rename lib/Predis/{Commands => Command}/StringIncrement.php (94%) rename lib/Predis/{Commands => Command}/StringIncrementBy.php (94%) rename lib/Predis/{Commands => Command}/StringIncrementByFloat.php (95%) rename lib/Predis/{Commands => Command}/StringPreciseSetExpire.php (94%) rename lib/Predis/{Commands => Command}/StringSet.php (94%) rename lib/Predis/{Commands => Command}/StringSetBit.php (94%) rename lib/Predis/{Commands => Command}/StringSetExpire.php (94%) rename lib/Predis/{Commands => Command}/StringSetMultiple.php (92%) rename lib/Predis/{Commands => Command}/StringSetMultiplePreserve.php (95%) rename lib/Predis/{Commands => Command}/StringSetPreserve.php (95%) rename lib/Predis/{Commands => Command}/StringSetRange.php (94%) rename lib/Predis/{Commands => Command}/StringStrlen.php (94%) rename lib/Predis/{Commands => Command}/StringSubstr.php (94%) rename lib/Predis/{Commands => Command}/TransactionDiscard.php (88%) rename lib/Predis/{Commands => Command}/TransactionExec.php (88%) rename lib/Predis/{Commands => Command}/TransactionMulti.php (88%) rename lib/Predis/{Commands => Command}/TransactionUnwatch.php (90%) rename lib/Predis/{Commands => Command}/TransactionWatch.php (90%) rename lib/Predis/{Commands => Command}/ZSetAdd.php (97%) rename lib/Predis/{Commands => Command}/ZSetCardinality.php (94%) rename lib/Predis/{Commands => Command}/ZSetCount.php (94%) rename lib/Predis/{Commands => Command}/ZSetIncrementBy.php (94%) rename lib/Predis/{Commands => Command}/ZSetIntersectionStore.php (94%) rename lib/Predis/{Commands => Command}/ZSetRange.php (97%) rename lib/Predis/{Commands => Command}/ZSetRangeByScore.php (98%) rename lib/Predis/{Commands => Command}/ZSetRank.php (94%) rename lib/Predis/{Commands => Command}/ZSetRemove.php (96%) rename lib/Predis/{Commands => Command}/ZSetRemoveRangeByRank.php (95%) rename lib/Predis/{Commands => Command}/ZSetRemoveRangeByScore.php (95%) rename lib/Predis/{Commands => Command}/ZSetReverseRange.php (94%) rename lib/Predis/{Commands => Command}/ZSetReverseRangeByScore.php (95%) rename lib/Predis/{Commands => Command}/ZSetReverseRank.php (94%) rename lib/Predis/{Commands => Command}/ZSetScore.php (94%) rename lib/Predis/{Commands => Command}/ZSetUnionStore.php (98%) rename lib/Predis/{Network/ConnectionBase.php => Connection/AbstractConnection.php} (81%) rename lib/Predis/{Network/IConnectionCluster.php => Connection/ClusterConnectionInterface.php} (60%) rename lib/Predis/{Network/IConnectionComposable.php => Connection/ComposableConnectionInterface.php} (80%) rename lib/Predis/{Network => Connection}/ComposableStreamConnection.php (81%) rename lib/Predis/{Network => Connection}/ConnectionException.php (94%) rename lib/Predis/{Network/IConnection.php => Connection/ConnectionInterface.php} (66%) rename lib/Predis/{Network => Connection}/MasterSlaveReplication.php (92%) rename lib/Predis/{Network => Connection}/PhpiredisConnection.php (90%) rename lib/Predis/{Network => Connection}/PredisCluster.php (82%) rename lib/Predis/{Network/IConnectionReplication.php => Connection/ReplicationConnectionInterface.php} (66%) rename lib/Predis/{Network/IConnectionSingle.php => Connection/SingleConnectionInterface.php} (78%) rename lib/Predis/{Network => Connection}/StreamConnection.php (91%) rename lib/Predis/{Network => Connection}/WebdisConnection.php (86%) rename lib/Predis/{IConnectionFactory.php => ConnectionFactoryInterface.php} (59%) rename lib/Predis/{IConnectionParameters.php => ConnectionParametersInterface.php} (96%) rename lib/Predis/Distribution/{IDistributionStrategy.php => DistributionStrategyInterface.php} (93%) rename lib/Predis/Distribution/{INodeKeyGenerator.php => HashGeneratorInterface.php} (90%) rename lib/Predis/{Iterators => Iterator}/MultiBulkResponse.php (98%) rename lib/Predis/{Iterators => Iterator}/MultiBulkResponseSimple.php (89%) rename lib/Predis/{Iterators => Iterator}/MultiBulkResponseTuple.php (98%) rename lib/Predis/{ => Monitor}/MonitorContext.php (97%) rename lib/Predis/{Options/Option.php => Option/AbstractOption.php} (70%) rename lib/Predis/{Options => Option}/ClientCluster.php (66%) rename lib/Predis/{Options => Option}/ClientConnectionFactory.php (74%) rename lib/Predis/{Options => Option}/ClientOptions.php (93%) rename lib/Predis/{Options/IClientOptions.php => Option/ClientOptionsInterface.php} (86%) rename lib/Predis/{Options => Option}/ClientPrefix.php (71%) rename lib/Predis/{Options => Option}/ClientProfile.php (76%) rename lib/Predis/{Options => Option}/ClientReplication.php (57%) rename lib/Predis/{Options => Option}/CustomOption.php (87%) rename lib/Predis/{Options/IOption.php => Option/OptionInterface.php} (76%) rename lib/Predis/Pipeline/{IPipelineExecutor.php => PipelineExecutorInterface.php} (73%) rename lib/Predis/{Profiles => Profile}/ServerProfile.php (82%) rename lib/Predis/{Profiles/IServerProfile.php => Profile/ServerProfileInterface.php} (92%) create mode 100644 lib/Predis/Profile/ServerVersion12.php create mode 100644 lib/Predis/Profile/ServerVersion20.php create mode 100644 lib/Predis/Profile/ServerVersion22.php create mode 100644 lib/Predis/Profile/ServerVersion24.php rename lib/Predis/{Profiles => Profile}/ServerVersionNext.php (53%) delete mode 100644 lib/Predis/Profiles/ServerVersion12.php delete mode 100644 lib/Predis/Profiles/ServerVersion20.php delete mode 100644 lib/Predis/Profiles/ServerVersion22.php delete mode 100644 lib/Predis/Profiles/ServerVersion24.php rename lib/Predis/Protocol/{ICommandSerializer.php => CommandSerializerInterface.php} (72%) rename lib/Predis/Protocol/{IComposableProtocolProcessor.php => ComposableProtocolInterface.php} (70%) rename lib/Predis/Protocol/{IProtocolProcessor.php => ProtocolInterface.php} (67%) rename lib/Predis/Protocol/{IResponseHandler.php => ResponseHandlerInterface.php} (71%) rename lib/Predis/Protocol/{IResponseReader.php => ResponseReaderInterface.php} (71%) rename lib/Predis/{IRedisServerError.php => ResponseErrorInterface.php} (91%) rename lib/Predis/{IReplyObject.php => ResponseObjectInterface.php} (91%) rename tests/Predis/{Commands => Command}/CommandTest.php (84%) rename tests/Predis/{Commands => Command}/ConnectionAuthTest.php (93%) rename tests/Predis/{Commands => Command}/ConnectionEchoTest.php (95%) rename tests/Predis/{Commands => Command}/ConnectionPingTest.php (94%) rename tests/Predis/{Commands => Command}/ConnectionQuitTest.php (94%) rename tests/Predis/{Commands => Command}/ConnectionSelectTest.php (95%) rename tests/Predis/{Commands => Command}/HashDeleteTest.php (97%) rename tests/Predis/{Commands => Command}/HashExistsTest.php (96%) rename tests/Predis/{Commands => Command}/HashGetAllTest.php (97%) rename tests/Predis/{Commands => Command}/HashGetMultipleTest.php (97%) rename tests/Predis/{Commands => Command}/HashGetTest.php (96%) rename tests/Predis/{Commands => Command}/HashIncrementByFloatTest.php (97%) rename tests/Predis/{Commands => Command}/HashIncrementByTest.php (97%) rename tests/Predis/{Commands => Command}/HashKeysTest.php (97%) rename tests/Predis/{Commands => Command}/HashLengthTest.php (96%) rename tests/Predis/{Commands => Command}/HashSetMultipleTest.php (97%) rename tests/Predis/{Commands => Command}/HashSetPreserveTest.php (96%) rename tests/Predis/{Commands => Command}/HashSetTest.php (97%) rename tests/Predis/{Commands => Command}/HashValuesTest.php (96%) rename tests/Predis/{Commands => Command}/KeyDeleteTest.php (97%) rename tests/Predis/{Commands => Command}/KeyExistsTest.php (96%) rename tests/Predis/{Commands => Command}/KeyExpireAtTest.php (97%) rename tests/Predis/{Commands => Command}/KeyExpireTest.php (97%) rename tests/Predis/{Commands => Command}/KeyKeysTest.php (96%) rename tests/Predis/{Commands => Command}/KeyKeysV12xTest.php (95%) rename tests/Predis/{Commands => Command}/KeyMoveTest.php (97%) rename tests/Predis/{Commands => Command}/KeyPersistTest.php (96%) rename tests/Predis/{Commands => Command}/KeyPreciseExpireAtTest.php (96%) rename tests/Predis/{Commands => Command}/KeyPreciseExpireTest.php (97%) rename tests/Predis/{Commands => Command}/KeyPreciseTimeToLiveTest.php (96%) rename tests/Predis/{Commands => Command}/KeyRandomTest.php (95%) rename tests/Predis/{Commands => Command}/KeyRenamePreserveTest.php (96%) rename tests/Predis/{Commands => Command}/KeyRenameTest.php (96%) rename tests/Predis/{Commands => Command}/KeySortTest.php (99%) rename tests/Predis/{Commands => Command}/KeyTimeToLiveTest.php (96%) rename tests/Predis/{Commands => Command}/KeyTypeTest.php (96%) rename tests/Predis/{Commands => Command}/ListIndexTest.php (97%) rename tests/Predis/{Commands => Command}/ListInsertTest.php (97%) rename tests/Predis/{Commands => Command}/ListLengthTest.php (96%) rename tests/Predis/{Commands => Command}/ListPopFirstBlockingTest.php (96%) rename tests/Predis/{Commands => Command}/ListPopFirstTest.php (96%) rename tests/Predis/{Commands => Command}/ListPopLastBlockingTest.php (96%) rename tests/Predis/{Commands => Command}/ListPopLastPushHeadBlockingTest.php (95%) rename tests/Predis/{Commands => Command}/ListPopLastPushHeadTest.php (97%) rename tests/Predis/{Commands => Command}/ListPopLastTest.php (97%) rename tests/Predis/{Commands => Command}/ListPushHeadTest.php (97%) rename tests/Predis/{Commands => Command}/ListPushHeadXTest.php (97%) rename tests/Predis/{Commands => Command}/ListPushTailTest.php (97%) rename tests/Predis/{Commands => Command}/ListPushTailXTest.php (97%) rename tests/Predis/{Commands => Command}/ListRangeTest.php (98%) rename tests/Predis/{Commands => Command}/ListRemoveTest.php (97%) rename tests/Predis/{Commands => Command}/ListSetTest.php (97%) rename tests/Predis/{Commands => Command}/ListTrimTest.php (98%) rename tests/Predis/{Commands => Command}/PrefixHelpersTest.php (95%) rename tests/Predis/{Commands => Command}/PrefixableCommandTest.php (81%) rename tests/Predis/{Commands/Processors => Command/Processor}/KeyPrefixProcessorTest.php (86%) rename tests/Predis/{Commands/Processors => Command/Processor}/ProcessorChainTest.php (63%) rename tests/Predis/{Commands => Command}/PubSubPublishTest.php (96%) rename tests/Predis/{Commands => Command}/PubSubSubscribeByPatternTest.php (98%) rename tests/Predis/{Commands => Command}/PubSubSubscribeTest.php (98%) rename tests/Predis/{Commands => Command}/PubSubUnsubscribeByPatternTest.php (97%) rename tests/Predis/{Commands => Command}/PubSubUnsubscribeTest.php (97%) rename tests/Predis/{Commands => Command}/ScriptedCommandTest.php (85%) rename tests/Predis/{Commands => Command}/ServerBackgroundRewriteAOFTest.php (92%) rename tests/Predis/{Commands => Command}/ServerBackgroundSaveTest.php (92%) rename tests/Predis/{Commands => Command}/ServerClientTest.php (98%) rename tests/Predis/{Commands => Command}/ServerConfigTest.php (98%) rename tests/Predis/{Commands => Command}/ServerDatabaseSizeTest.php (94%) rename tests/Predis/{Commands => Command}/ServerEvalSHATest.php (97%) rename tests/Predis/{Commands => Command}/ServerEvalTest.php (97%) rename tests/Predis/{Commands => Command}/ServerFlushAllTest.php (93%) rename tests/Predis/{Commands => Command}/ServerFlushDatabaseTest.php (94%) rename tests/Predis/{Commands => Command}/ServerInfoTest.php (99%) rename tests/Predis/{Commands => Command}/ServerInfoV26xTest.php (99%) rename tests/Predis/{Commands => Command}/ServerLastSaveTest.php (94%) rename tests/Predis/{Commands => Command}/ServerMonitorTest.php (94%) rename tests/Predis/{Commands => Command}/ServerObjectTest.php (97%) rename tests/Predis/{Commands => Command}/ServerSaveTest.php (93%) rename tests/Predis/{Commands => Command}/ServerScriptTest.php (97%) rename tests/Predis/{Commands => Command}/ServerShutdownTest.php (91%) rename tests/Predis/{Commands => Command}/ServerSlaveOfTest.php (96%) rename tests/Predis/{Commands => Command}/ServerSlowlogTest.php (97%) rename tests/Predis/{Commands => Command}/SetAddTest.php (97%) rename tests/Predis/{Commands => Command}/SetCardinalityTest.php (96%) rename tests/Predis/{Commands => Command}/SetDifferenceStoreTest.php (97%) rename tests/Predis/{Commands => Command}/SetDifferenceTest.php (97%) rename tests/Predis/{Commands => Command}/SetIntersectionStoreTest.php (98%) rename tests/Predis/{Commands => Command}/SetIntersectionTest.php (97%) rename tests/Predis/{Commands => Command}/SetIsMemberTest.php (97%) rename tests/Predis/{Commands => Command}/SetMembersTest.php (96%) rename tests/Predis/{Commands => Command}/SetMoveTest.php (97%) rename tests/Predis/{Commands => Command}/SetPopTest.php (96%) rename tests/Predis/{Commands => Command}/SetRandomMemberTest.php (96%) rename tests/Predis/{Commands => Command}/SetRemoveTest.php (97%) rename tests/Predis/{Commands => Command}/SetUnionStoreTest.php (97%) rename tests/Predis/{Commands => Command}/SetUnionTest.php (97%) rename tests/Predis/{Commands => Command}/StringAppendTest.php (97%) rename tests/Predis/{Commands => Command}/StringDecrementByTest.php (97%) rename tests/Predis/{Commands => Command}/StringDecrementTest.php (97%) rename tests/Predis/{Commands => Command}/StringGetBitTest.php (97%) rename tests/Predis/{Commands => Command}/StringGetMultipleTest.php (97%) rename tests/Predis/{Commands => Command}/StringGetRangeTest.php (97%) rename tests/Predis/{Commands => Command}/StringGetSetTest.php (96%) rename tests/Predis/{Commands => Command}/StringGetTest.php (97%) rename tests/Predis/{Commands => Command}/StringIncrementByFloatTest.php (97%) rename tests/Predis/{Commands => Command}/StringIncrementByTest.php (97%) rename tests/Predis/{Commands => Command}/StringIncrementTest.php (96%) rename tests/Predis/{Commands => Command}/StringPreciseSetExpireTest.php (97%) rename tests/Predis/{Commands => Command}/StringSetBitTest.php (98%) rename tests/Predis/{Commands => Command}/StringSetExpireTest.php (97%) rename tests/Predis/{Commands => Command}/StringSetMultiplePreserveTest.php (96%) rename tests/Predis/{Commands => Command}/StringSetMultipleTest.php (96%) rename tests/Predis/{Commands => Command}/StringSetRangeTest.php (97%) rename tests/Predis/{Commands => Command}/StringSetTest.php (96%) rename tests/Predis/{Commands => Command}/StringStrlenTest.php (96%) rename tests/Predis/{Commands => Command}/StringSubstrTest.php (95%) rename tests/Predis/{Commands => Command}/TransactionDiscardTest.php (95%) rename tests/Predis/{Commands => Command}/TransactionExecTest.php (96%) rename tests/Predis/{Commands => Command}/TransactionMultiTest.php (92%) rename tests/Predis/{Commands => Command}/TransactionUnwatchTest.php (95%) rename tests/Predis/{Commands => Command}/TransactionWatchTest.php (97%) rename tests/Predis/{Commands => Command}/ZSetAddTest.php (97%) rename tests/Predis/{Commands => Command}/ZSetCardinalityTest.php (96%) rename tests/Predis/{Commands => Command}/ZSetCountTest.php (97%) rename tests/Predis/{Commands => Command}/ZSetIncrementByTest.php (96%) rename tests/Predis/{Commands => Command}/ZSetIntersectionStoreTest.php (98%) rename tests/Predis/{Commands => Command}/ZSetRangeByScoreTest.php (98%) rename tests/Predis/{Commands => Command}/ZSetRangeTest.php (98%) rename tests/Predis/{Commands => Command}/ZSetRankTest.php (97%) rename tests/Predis/{Commands => Command}/ZSetRemoveRangeByRankTest.php (97%) rename tests/Predis/{Commands => Command}/ZSetRemoveRangeByScoreTest.php (96%) rename tests/Predis/{Commands => Command}/ZSetRemoveTest.php (97%) rename tests/Predis/{Commands => Command}/ZSetReverseRangeByScoreTest.php (98%) rename tests/Predis/{Commands => Command}/ZSetReverseRangeTest.php (98%) rename tests/Predis/{Commands => Command}/ZSetReverseRankTest.php (96%) rename tests/Predis/{Commands => Command}/ZSetScoreTest.php (97%) rename tests/Predis/{Commands => Command}/ZSetUnionStoreTest.php (98%) rename tests/Predis/{Network => Connection}/ConnectionExceptionTest.php (73%) rename tests/Predis/{Network => Connection}/MasterSlaveReplicationTest.php (98%) rename tests/Predis/{Network => Connection}/PhpiredisConnectionTest.php (96%) rename tests/Predis/{Network => Connection}/PredisClusterTest.php (98%) rename tests/Predis/{Network => Connection}/StreamConnectionTest.php (95%) rename tests/Predis/{Network => Connection}/WebdisConnectionTest.php (90%) rename tests/Predis/{Iterators => Iterator}/MultiBulkResponseSimpleTest.php (96%) rename tests/Predis/{Iterators => Iterator}/MultiBulkResponseTupleTest.php (91%) rename tests/Predis/{ => Monitor}/MonitorContextTest.php (89%) rename tests/Predis/{Options/OptionTest.php => Option/AbstractOptionTest.php} (68%) rename tests/Predis/{Options => Option}/ClientClusterTest.php (67%) rename tests/Predis/{Options => Option}/ClientConnectionFactoryTest.php (62%) rename tests/Predis/{Options => Option}/ClientOptionsTest.php (68%) rename tests/Predis/{Options => Option}/ClientPrefixTest.php (65%) rename tests/Predis/{Options => Option}/ClientProfileTest.php (71%) rename tests/Predis/{Options => Option}/CustomOptionTest.php (84%) rename tests/Predis/{Profiles => Profile}/ServerProfileTest.php (82%) rename tests/Predis/{Profiles => Profile}/ServerVersion12Test.php (99%) rename tests/Predis/{Profiles => Profile}/ServerVersion20Test.php (99%) rename tests/Predis/{Profiles => Profile}/ServerVersion22Test.php (99%) rename tests/Predis/{Profiles => Profile}/ServerVersion24Test.php (99%) rename tests/Predis/{Profiles => Profile}/ServerVersionNextTest.php (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd56a351..9fb261b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,70 @@ +v0.8.0 (201x-xx-xx) +=============================================================================== + +- Some namespaces have been renamed: + + - `Predis\Network` => `Predis\Connection` + - `Predis\Profiles` => `Predis\Profile` + - `Predis\Iterators` => `Predis\Iterator` + - `Predis\Options` => `Predis\Option` + - `Predis\Commands` => `Predis\Command` + - `Predis\Commands\Processors` => `Predis\Command\Processor` + +- Some interfaces have been renamed: + + - `Predis\IReplyObject` => `Predis\ResponseObjectInterface` + - `Predis\IRedisServerError` => `Predis\ResponseErrorInterface` + - `Predis\IConnectionFactory` => `Predis\ConnectionFactoryInterface` + - `Predis\IConnectionParameters` => `Predis\ConnectionParametersInterface` + - `Predis\Options\IOption` => `Predis\Option\OptionInterface` + - `Predis\Options\IClientOptions` => `Predis\Option\ClientOptionsInterface` + - `Predis\Profile\IServerProfile` => `Predis\Profile\ServerProfileInterface` + - `Predis\Pipeline\IPipelineExecutor` + => `Predis\Pipeline\PipelineExecutorInterface` + - `Predis\Distribution\INodeKeyGenerator` + => `Predis\Distribution\HashGeneratorInterface` + - `Predis\Distribution\IDistributionStrategy` + => `Predis\Distribution\DistributionStrategyInterface` + - `Predis\Protocol\IProtocolProcessor` => `Predis\Protocol\ProtocolInterface` + - `Predis\Protocol\IResponseReader` + => `Predis\Protocol\ResponseReaderInterface` + - `Predis\Protocol\IResponseHandler` + => `Predis\Protocol\ResponseHandlerInterface` + - `Predis\Protocol\ICommandSerializer` + => `Predis\Protocol\CommandSerializerInterface` + - `Predis\Protocol\IComposableProtocolProcessor` + => `Predis\Protocol\ComposableProtocolInterface` + - `Predis\Network\IConnection` => `Predis\Connection\ConnectionInterface` + - `Predis\Network\IConnectionSingle` + => `Predis\Connection\SingleConnectionInterface` + - `Predis\Network\IConnectionComposable` + => `Predis\Connection\ComposableConnectionInterface` + - `Predis\Network\IConnectionCluster` + => `Predis\Connection\ClusterConnectionInterface` + - `Predis\Network\IConnectionReplication` + => `Predis\Connection\ReplicationConnectionInterface` + - `Predis\Commands\ICommand` => `Predis\Command\CommandInterface` + - `Predis\Commands\IPrefixable` + => `Predis\Command\PrefixableCommandInterface` + - `Predis\Command\Processor\ICommandProcessor` + => `Predis\Command\Processor\CommandProcessorInterface` + - `Predis\Command\Processor\ICommandProcessorChain` + => `Predis\Command\Processor\CommandProcessorChainInterface` + - `Predis\Command\Processor\IProcessingSupport` + => `Predis\Command\Processor\CommandProcessingInterface` + +- Some classes have been renamed: + + - `Predis\Commands\Command` => `Predis\Command\AbstractCommand` + - `Predis\Network\ConnectionBase` => `Predis\Connection\AbstractConnection` + +- Some interfaces and classes have been moved to different namespaces: + + - `Predis\MonitorContext` is now under the `Predis\Monitor`. + +- `Predis\Options\Option` is now abstract, see `Predis\Option\AbstractOption`. + + v0.7.2 (2012-xx-xx) =============================================================================== diff --git a/FAQ.PERFORMANCES.md b/FAQ.PERFORMANCES.md index f33828f1..aedb42c5 100644 --- a/FAQ.PERFORMANCES.md +++ b/FAQ.PERFORMANCES.md @@ -56,7 +56,7 @@ official Redis C client library) with a thin layer that exposes its features to get the benefits of a faster protocol parser just by adding a single line of code in your application: $client = new Predis\Client('tcp://127.0.0.1', array( - 'connections' => array('tcp' => 'Predis\Network\PhpiredisConnection') + 'connections' => array('tcp' => 'Predis\Connection\PhpiredisConnection') )); As simple as it is, nothing will really change in the way you use the library in your application. So, diff --git a/README.md b/README.md index e4f92c78..f12a7e84 100644 --- a/README.md +++ b/README.md @@ -114,11 +114,11 @@ $replies = $redis->pipeline(function($pipe) { Predis allows developers to create new connection classes to add support for new protocols or override the existing ones and provide a different implementation compared to the default classes. This can be -obtained by subclassing the `Predis\Network\IConnectionSingle` interface. +obtained by implementing `Predis\Connection\SingleConnectionInterface`. ``` php isInstantiable()) { throw new RuntimeException("Class $class must be instantiable, abstract classes or interfaces are not allowed."); } - if (!$reflection->implementsInterface('Predis\Commands\ICommand')) { - throw new RuntimeException("Class $class must implement the Predis\Commands\ICommand interface."); + if (!$reflection->implementsInterface('Predis\Command\CommandInterface')) { + throw new RuntimeException("Class $class must implement Predis\Command\CommandInterface."); } $instance = $reflection->newInstance(); @@ -148,7 +148,7 @@ class CommandTestCaseGenerator file_put_contents($options['output'], $this->generate()); } - protected function getTestCaseBuffer(ICommand $instance) + protected function getTestCaseBuffer(CommandInterface $instance) { $id = $instance->getId(); $fqn = get_class($instance); @@ -167,7 +167,7 @@ class CommandTestCaseGenerator * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -226,7 +226,7 @@ class $class extends CommandTestCase PHP; - if ($instance instanceof IPrefixable) { + if ($instance instanceof PrefixableCommandInterface) { $buffer .=<<nodes[$count > 1 ? abs(crc32($key) % $count) : 0]; } - public function generateKey($value) + public function hash($value) { return crc32($value); } diff --git a/examples/MasterSlaveReplicationComplex.php b/examples/MasterSlaveReplicationComplex.php index 22886b17..3de571e9 100644 --- a/examples/MasterSlaveReplicationComplex.php +++ b/examples/MasterSlaveReplicationComplex.php @@ -13,14 +13,14 @@ require 'SharedConfigurations.php'; // Predis allows to set Lua scripts as read-only operations in the context of // replication. This works for both EVAL and EVALSHA and also for the client-side -// abstraction built upon them (Predis\Commands\ScriptedCommand). This example +// abstraction built upon them (Predis\Command\ScriptedCommand). This example // shows a slightly more complex configuration that injects a new scripted command // in the server profile used by the new client instance and marks it marks it as // a read-only operation for replication so that it will be executed on slaves. -use Predis\Profiles\ServerProfile; -use Predis\Commands\ScriptedCommand; -use Predis\Network\MasterSlaveReplication; +use Predis\Profile\ServerProfile; +use Predis\Command\ScriptedCommand; +use Predis\Connection\MasterSlaveReplication; // ------------------------------------------------------------------------- // diff --git a/examples/ServerSideScripting.php b/examples/ServerSideScripting.php index d71e52da..e863cbec 100644 --- a/examples/ServerSideScripting.php +++ b/examples/ServerSideScripting.php @@ -14,11 +14,11 @@ require 'SharedConfigurations.php'; // This example will not work with versions of Redis < 2.6. // // Additionally to the EVAL command defined in the current development profile, the new -// Predis\Commands\ScriptedCommand base class can be used to build an higher abstraction +// Predis\Command\ScriptedCommand base class can be used to build an higher abstraction // for our "scripted" commands so that they will appear just like any other command on // the client-side. This is a quick example used to implement INCREX. -use Predis\Commands\ScriptedCommand; +use Predis\Command\ScriptedCommand; class IncrementExistingKey extends ScriptedCommand { diff --git a/examples/SimpleDebuggableConnection.php b/examples/SimpleDebuggableConnection.php index 1823506e..24738929 100644 --- a/examples/SimpleDebuggableConnection.php +++ b/examples/SimpleDebuggableConnection.php @@ -12,8 +12,8 @@ require 'SharedConfigurations.php'; use Predis\ConnectionParameters; -use Predis\Commands\ICommand; -use Predis\Network\StreamConnection; +use Predis\Command\CommandInterface; +use Predis\Connection\StreamConnection; class SimpleDebuggableConnection extends StreamConnection { @@ -27,7 +27,7 @@ class SimpleDebuggableConnection extends StreamConnection parent::connect(); } - private function storeDebug(ICommand $command, $direction) + private function storeDebug(CommandInterface $command, $direction) { $firtsArg = $command->getArgument(0); $timestamp = round(microtime(true) - $this->tstart, 4); @@ -40,14 +40,14 @@ class SimpleDebuggableConnection extends StreamConnection $this->debugBuffer[] = $debug; } - public function writeCommand(ICommand $command) + public function writeCommand(CommandInterface $command) { parent::writeCommand($command); $this->storeDebug($command, '->'); } - public function readResponse(ICommand $command) + public function readResponse(CommandInterface $command) { $reply = parent::readResponse($command); $this->storeDebug($command, '<-'); diff --git a/lib/Predis/Client.php b/lib/Predis/Client.php index 9060c15e..8a7e335b 100644 --- a/lib/Predis/Client.php +++ b/lib/Predis/Client.php @@ -11,14 +11,14 @@ namespace Predis; -use Predis\Commands\ICommand; -use Predis\Options\IClientOptions; -use Predis\Network\IConnection; -use Predis\Network\IConnectionSingle; -use Predis\Profiles\IServerProfile; -use Predis\Options\ClientOptions; -use Predis\Profiles\ServerProfile; +use Predis\Command\CommandInterface; +use Predis\Option\ClientOptionsInterface; +use Predis\Connection\ConnectionInterface; +use Predis\Profile\ServerProfileInterface; +use Predis\Option\ClientOptions; +use Predis\Profile\ServerProfile; use Predis\PubSub\PubSubContext; +use Predis\Monitor\MonitorContext; use Predis\Pipeline\PipelineContext; use Predis\Transaction\MultiExecContext; @@ -52,9 +52,9 @@ class Client } /** - * Creates an instance of Predis\Options\ClientOptions from various types of - * arguments (string, array, Predis\Profiles\ServerProfile) or returns the - * passed object if it is an instance of Predis\Options\ClientOptions. + * Creates an instance of Predis\Option\ClientOptions from various types of + * arguments (string, array, Predis\Profile\ServerProfile) or returns the + * passed object if it is an instance of Predis\Option\ClientOptions. * * @param mixed $options Client options. * @return ClientOptions @@ -67,10 +67,10 @@ class Client if (is_array($options)) { return new ClientOptions($options); } - if ($options instanceof IClientOptions) { + if ($options instanceof ClientOptionsInterface) { return $options; } - if ($options instanceof IServerProfile || is_string($options)) { + if ($options instanceof ServerProfileInterface || is_string($options)) { return new ClientOptions(array('profile' => $options)); } @@ -80,14 +80,14 @@ class Client /** * Initializes one or multiple connection (cluster) objects from various * types of arguments (string, array) or returns the passed object if it - * implements the Predis\Network\IConnection interface. + * implements Predis\Connection\ConnectionInterface. * * @param mixed $parameters Connection parameters or instance. - * @return IConnection + * @return ConnectionInterface */ protected function initializeConnection($parameters) { - if ($parameters instanceof IConnection) { + if ($parameters instanceof ConnectionInterface) { return $parameters; } @@ -106,7 +106,7 @@ class Client /** * Returns the server profile used by the client. * - * @return IServerProfile + * @return ServerProfileInterface */ public function getProfile() { @@ -126,7 +126,7 @@ class Client /** * Returns the connection factory object used by the client. * - * @return IConnectionFactory + * @return ConnectionFactoryInterface */ public function getConnectionFactory() { @@ -191,7 +191,7 @@ class Client * one of the connection instances identified by its alias. * * @param string $id The alias of a connection when connected to a cluster. - * @return IConnection + * @return ConnectionInterface */ public function getConnection($id = null) { @@ -224,7 +224,7 @@ class Client * * @param string $method The name of a Redis command. * @param array $arguments The arguments for the command. - * @return ICommand + * @return CommandInterface */ public function createCommand($method, $arguments = array()) { @@ -234,10 +234,10 @@ class Client /** * Executes the specified Redis command. * - * @param ICommand $command A Redis command. + * @param CommandInterface $command A Redis command. * @return mixed */ - public function executeCommand(ICommand $command) + public function executeCommand(CommandInterface $command) { return $this->connection->executeCommand($command); } @@ -245,10 +245,10 @@ class Client /** * Executes the specified Redis command on all the nodes of a cluster. * - * @param ICommand $command A Redis command. + * @param CommandInterface $command A Redis command. * @return array */ - public function executeCommandOnShards(ICommand $command) + public function executeCommandOnShards(CommandInterface $command) { if (Helpers::isCluster($this->connection)) { $replies = array(); diff --git a/lib/Predis/Commands/Command.php b/lib/Predis/Command/AbstractCommand.php similarity index 93% rename from lib/Predis/Commands/Command.php rename to lib/Predis/Command/AbstractCommand.php index 672bd534..f8ef5bc0 100644 --- a/lib/Predis/Commands/Command.php +++ b/lib/Predis/Command/AbstractCommand.php @@ -9,17 +9,17 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; -use Predis\Distribution\INodeKeyGenerator; +use Predis\Distribution\HashGeneratorInterface; /** * Base class for Redis commands. * * @author Daniele Alessandri */ -abstract class Command implements ICommand +abstract class AbstractCommand implements CommandInterface { private $hash; private $arguments = array(); @@ -113,7 +113,7 @@ abstract class Command implements ICommand /** * {@inheritdoc} */ - public function getHash(INodeKeyGenerator $distributor) + public function getHash(HashGeneratorInterface $hasher) { if (isset($this->hash)) { return $this->hash; @@ -121,7 +121,7 @@ abstract class Command implements ICommand if ($this->canBeHashed()) { $key = Helpers::extractKeyTag($this->arguments[0]); - $this->hash = $distributor->generateKey($key); + $this->hash = $hasher->hash($key); return $this->hash; } diff --git a/lib/Predis/Commands/ICommand.php b/lib/Predis/Command/CommandInterface.php similarity index 84% rename from lib/Predis/Commands/ICommand.php rename to lib/Predis/Command/CommandInterface.php index fb274fc6..41b4a176 100644 --- a/lib/Predis/Commands/ICommand.php +++ b/lib/Predis/Command/CommandInterface.php @@ -9,15 +9,15 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; -use Predis\Distribution\INodeKeyGenerator; +use Predis\Distribution\HashGeneratorInterface; /** * Defines an abstraction representing a Redis command. * @author Daniele Alessandri */ -interface ICommand +interface CommandInterface { /** * Gets the ID of a Redis command. @@ -30,10 +30,10 @@ interface ICommand * Returns an hash of the command using the provided algorithm against the * key (used to calculate the distribution of keys with client-side sharding). * - * @param INodeKeyGenerator $distributor Distribution algorithm. + * @param HashGeneratorInterface $hasher Distribution algorithm. * @return int */ - public function getHash(INodeKeyGenerator $distributor); + public function getHash(HashGeneratorInterface $hasher); /** * Sets the arguments of the command. diff --git a/lib/Predis/Commands/ConnectionAuth.php b/lib/Predis/Command/ConnectionAuth.php similarity index 88% rename from lib/Predis/Commands/ConnectionAuth.php rename to lib/Predis/Command/ConnectionAuth.php index 78df9adc..c12f3e2c 100644 --- a/lib/Predis/Commands/ConnectionAuth.php +++ b/lib/Predis/Command/ConnectionAuth.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/auth * @author Daniele Alessandri */ -class ConnectionAuth extends Command +class ConnectionAuth extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ConnectionEcho.php b/lib/Predis/Command/ConnectionEcho.php similarity index 88% rename from lib/Predis/Commands/ConnectionEcho.php rename to lib/Predis/Command/ConnectionEcho.php index cd6a15ba..ed504953 100644 --- a/lib/Predis/Commands/ConnectionEcho.php +++ b/lib/Predis/Command/ConnectionEcho.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/echo * @author Daniele Alessandri */ -class ConnectionEcho extends Command +class ConnectionEcho extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ConnectionPing.php b/lib/Predis/Command/ConnectionPing.php similarity index 90% rename from lib/Predis/Commands/ConnectionPing.php rename to lib/Predis/Command/ConnectionPing.php index e8c3e6a3..f011594c 100644 --- a/lib/Predis/Commands/ConnectionPing.php +++ b/lib/Predis/Command/ConnectionPing.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/ping * @author Daniele Alessandri */ -class ConnectionPing extends Command +class ConnectionPing extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ConnectionQuit.php b/lib/Predis/Command/ConnectionQuit.php similarity index 88% rename from lib/Predis/Commands/ConnectionQuit.php rename to lib/Predis/Command/ConnectionQuit.php index e0cb6e05..905ede5b 100644 --- a/lib/Predis/Commands/ConnectionQuit.php +++ b/lib/Predis/Command/ConnectionQuit.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/quit * @author Daniele Alessandri */ -class ConnectionQuit extends Command +class ConnectionQuit extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ConnectionSelect.php b/lib/Predis/Command/ConnectionSelect.php similarity index 88% rename from lib/Predis/Commands/ConnectionSelect.php rename to lib/Predis/Command/ConnectionSelect.php index 18b9c818..b784b230 100644 --- a/lib/Predis/Commands/ConnectionSelect.php +++ b/lib/Predis/Command/ConnectionSelect.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/select * @author Daniele Alessandri */ -class ConnectionSelect extends Command +class ConnectionSelect extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/HashDelete.php b/lib/Predis/Command/HashDelete.php similarity index 96% rename from lib/Predis/Commands/HashDelete.php rename to lib/Predis/Command/HashDelete.php index aa9724af..ae726bbc 100644 --- a/lib/Predis/Commands/HashDelete.php +++ b/lib/Predis/Command/HashDelete.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; diff --git a/lib/Predis/Commands/HashExists.php b/lib/Predis/Command/HashExists.php similarity index 95% rename from lib/Predis/Commands/HashExists.php rename to lib/Predis/Command/HashExists.php index 5cf995bb..a9d620a0 100644 --- a/lib/Predis/Commands/HashExists.php +++ b/lib/Predis/Command/HashExists.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/hexists diff --git a/lib/Predis/Commands/HashGet.php b/lib/Predis/Command/HashGet.php similarity index 94% rename from lib/Predis/Commands/HashGet.php rename to lib/Predis/Command/HashGet.php index 1288d80a..b18583af 100644 --- a/lib/Predis/Commands/HashGet.php +++ b/lib/Predis/Command/HashGet.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/hget diff --git a/lib/Predis/Commands/HashGetAll.php b/lib/Predis/Command/HashGetAll.php similarity index 92% rename from lib/Predis/Commands/HashGetAll.php rename to lib/Predis/Command/HashGetAll.php index 5470ba72..58dad44e 100644 --- a/lib/Predis/Commands/HashGetAll.php +++ b/lib/Predis/Command/HashGetAll.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; -use Predis\Iterators\MultiBulkResponseTuple; +use Predis\Iterator\MultiBulkResponseTuple; /** * @link http://redis.io/commands/hgetall diff --git a/lib/Predis/Commands/HashGetMultiple.php b/lib/Predis/Command/HashGetMultiple.php similarity index 96% rename from lib/Predis/Commands/HashGetMultiple.php rename to lib/Predis/Command/HashGetMultiple.php index 2680c159..722721b9 100644 --- a/lib/Predis/Commands/HashGetMultiple.php +++ b/lib/Predis/Command/HashGetMultiple.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; diff --git a/lib/Predis/Commands/HashIncrementBy.php b/lib/Predis/Command/HashIncrementBy.php similarity index 94% rename from lib/Predis/Commands/HashIncrementBy.php rename to lib/Predis/Command/HashIncrementBy.php index 5a23a120..1c43e637 100644 --- a/lib/Predis/Commands/HashIncrementBy.php +++ b/lib/Predis/Command/HashIncrementBy.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/hincrby diff --git a/lib/Predis/Commands/HashIncrementByFloat.php b/lib/Predis/Command/HashIncrementByFloat.php similarity index 95% rename from lib/Predis/Commands/HashIncrementByFloat.php rename to lib/Predis/Command/HashIncrementByFloat.php index b3600329..75970588 100644 --- a/lib/Predis/Commands/HashIncrementByFloat.php +++ b/lib/Predis/Command/HashIncrementByFloat.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/hincrbyfloat diff --git a/lib/Predis/Commands/HashKeys.php b/lib/Predis/Command/HashKeys.php similarity index 94% rename from lib/Predis/Commands/HashKeys.php rename to lib/Predis/Command/HashKeys.php index 3e6fcaf7..279f09a9 100644 --- a/lib/Predis/Commands/HashKeys.php +++ b/lib/Predis/Command/HashKeys.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/hkeys diff --git a/lib/Predis/Commands/HashLength.php b/lib/Predis/Command/HashLength.php similarity index 94% rename from lib/Predis/Commands/HashLength.php rename to lib/Predis/Command/HashLength.php index 321a969e..b2a59c0a 100644 --- a/lib/Predis/Commands/HashLength.php +++ b/lib/Predis/Command/HashLength.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/hlen diff --git a/lib/Predis/Commands/HashSet.php b/lib/Predis/Command/HashSet.php similarity index 95% rename from lib/Predis/Commands/HashSet.php rename to lib/Predis/Command/HashSet.php index 35033a81..588afc40 100644 --- a/lib/Predis/Commands/HashSet.php +++ b/lib/Predis/Command/HashSet.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/hset diff --git a/lib/Predis/Commands/HashSetMultiple.php b/lib/Predis/Command/HashSetMultiple.php similarity index 97% rename from lib/Predis/Commands/HashSetMultiple.php rename to lib/Predis/Command/HashSetMultiple.php index e697edce..f84485fc 100644 --- a/lib/Predis/Commands/HashSetMultiple.php +++ b/lib/Predis/Command/HashSetMultiple.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/hmset diff --git a/lib/Predis/Commands/HashSetPreserve.php b/lib/Predis/Command/HashSetPreserve.php similarity index 95% rename from lib/Predis/Commands/HashSetPreserve.php rename to lib/Predis/Command/HashSetPreserve.php index f9fab017..3e9890aa 100644 --- a/lib/Predis/Commands/HashSetPreserve.php +++ b/lib/Predis/Command/HashSetPreserve.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/hsetnx diff --git a/lib/Predis/Commands/HashValues.php b/lib/Predis/Command/HashValues.php similarity index 94% rename from lib/Predis/Commands/HashValues.php rename to lib/Predis/Command/HashValues.php index a41da350..fec31167 100644 --- a/lib/Predis/Commands/HashValues.php +++ b/lib/Predis/Command/HashValues.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/hvals diff --git a/lib/Predis/Commands/KeyDelete.php b/lib/Predis/Command/KeyDelete.php similarity index 90% rename from lib/Predis/Commands/KeyDelete.php rename to lib/Predis/Command/KeyDelete.php index 93c07f87..e85fa343 100644 --- a/lib/Predis/Commands/KeyDelete.php +++ b/lib/Predis/Command/KeyDelete.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; @@ -17,7 +17,7 @@ use Predis\Helpers; * @link http://redis.io/commands/del * @author Daniele Alessandri */ -class KeyDelete extends Command implements IPrefixable +class KeyDelete extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/KeyExists.php b/lib/Predis/Command/KeyExists.php similarity index 95% rename from lib/Predis/Commands/KeyExists.php rename to lib/Predis/Command/KeyExists.php index 9155ba21..7f877cdb 100644 --- a/lib/Predis/Commands/KeyExists.php +++ b/lib/Predis/Command/KeyExists.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/exists diff --git a/lib/Predis/Commands/KeyExpire.php b/lib/Predis/Command/KeyExpire.php similarity index 95% rename from lib/Predis/Commands/KeyExpire.php rename to lib/Predis/Command/KeyExpire.php index 89ad1273..9db8e029 100644 --- a/lib/Predis/Commands/KeyExpire.php +++ b/lib/Predis/Command/KeyExpire.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/expire diff --git a/lib/Predis/Commands/KeyExpireAt.php b/lib/Predis/Command/KeyExpireAt.php similarity index 95% rename from lib/Predis/Commands/KeyExpireAt.php rename to lib/Predis/Command/KeyExpireAt.php index 29f56af1..1f6db38f 100644 --- a/lib/Predis/Commands/KeyExpireAt.php +++ b/lib/Predis/Command/KeyExpireAt.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/expireat diff --git a/lib/Predis/Commands/KeyKeys.php b/lib/Predis/Command/KeyKeys.php similarity index 95% rename from lib/Predis/Commands/KeyKeys.php rename to lib/Predis/Command/KeyKeys.php index 3689a8cd..ebf10c23 100644 --- a/lib/Predis/Commands/KeyKeys.php +++ b/lib/Predis/Command/KeyKeys.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/keys diff --git a/lib/Predis/Commands/KeyKeysV12x.php b/lib/Predis/Command/KeyKeysV12x.php similarity index 95% rename from lib/Predis/Commands/KeyKeysV12x.php rename to lib/Predis/Command/KeyKeysV12x.php index 1eccae93..2e0d3c92 100644 --- a/lib/Predis/Commands/KeyKeysV12x.php +++ b/lib/Predis/Command/KeyKeysV12x.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/keys diff --git a/lib/Predis/Commands/KeyMove.php b/lib/Predis/Command/KeyMove.php similarity index 96% rename from lib/Predis/Commands/KeyMove.php rename to lib/Predis/Command/KeyMove.php index 7a86003b..4c7bf42b 100644 --- a/lib/Predis/Commands/KeyMove.php +++ b/lib/Predis/Command/KeyMove.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/move diff --git a/lib/Predis/Commands/KeyPersist.php b/lib/Predis/Command/KeyPersist.php similarity index 95% rename from lib/Predis/Commands/KeyPersist.php rename to lib/Predis/Command/KeyPersist.php index c8f65cad..5c6b23cf 100644 --- a/lib/Predis/Commands/KeyPersist.php +++ b/lib/Predis/Command/KeyPersist.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/persist diff --git a/lib/Predis/Commands/KeyPreciseExpire.php b/lib/Predis/Command/KeyPreciseExpire.php similarity index 94% rename from lib/Predis/Commands/KeyPreciseExpire.php rename to lib/Predis/Command/KeyPreciseExpire.php index a3916842..3fb86787 100644 --- a/lib/Predis/Commands/KeyPreciseExpire.php +++ b/lib/Predis/Command/KeyPreciseExpire.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/pexpire diff --git a/lib/Predis/Commands/KeyPreciseExpireAt.php b/lib/Predis/Command/KeyPreciseExpireAt.php similarity index 94% rename from lib/Predis/Commands/KeyPreciseExpireAt.php rename to lib/Predis/Command/KeyPreciseExpireAt.php index ef270675..14697f2a 100644 --- a/lib/Predis/Commands/KeyPreciseExpireAt.php +++ b/lib/Predis/Command/KeyPreciseExpireAt.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/pexpireat diff --git a/lib/Predis/Commands/KeyPreciseTimeToLive.php b/lib/Predis/Command/KeyPreciseTimeToLive.php similarity index 94% rename from lib/Predis/Commands/KeyPreciseTimeToLive.php rename to lib/Predis/Command/KeyPreciseTimeToLive.php index 70413fc7..92e3a029 100644 --- a/lib/Predis/Commands/KeyPreciseTimeToLive.php +++ b/lib/Predis/Command/KeyPreciseTimeToLive.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/pttl diff --git a/lib/Predis/Commands/KeyRandom.php b/lib/Predis/Command/KeyRandom.php similarity index 91% rename from lib/Predis/Commands/KeyRandom.php rename to lib/Predis/Command/KeyRandom.php index 51c34f61..367eac54 100644 --- a/lib/Predis/Commands/KeyRandom.php +++ b/lib/Predis/Command/KeyRandom.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/randomkey * @author Daniele Alessandri */ -class KeyRandom extends Command +class KeyRandom extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/KeyRename.php b/lib/Predis/Command/KeyRename.php similarity index 86% rename from lib/Predis/Commands/KeyRename.php rename to lib/Predis/Command/KeyRename.php index 7dea6275..2f4b63cd 100644 --- a/lib/Predis/Commands/KeyRename.php +++ b/lib/Predis/Command/KeyRename.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/rename * @author Daniele Alessandri */ -class KeyRename extends Command implements IPrefixable +class KeyRename extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/KeyRenamePreserve.php b/lib/Predis/Command/KeyRenamePreserve.php similarity index 95% rename from lib/Predis/Commands/KeyRenamePreserve.php rename to lib/Predis/Command/KeyRenamePreserve.php index 2553aa46..1db8b7da 100644 --- a/lib/Predis/Commands/KeyRenamePreserve.php +++ b/lib/Predis/Command/KeyRenamePreserve.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/renamenx diff --git a/lib/Predis/Commands/KeySort.php b/lib/Predis/Command/KeySort.php similarity index 96% rename from lib/Predis/Commands/KeySort.php rename to lib/Predis/Command/KeySort.php index 6bc0e8b6..2ef07606 100644 --- a/lib/Predis/Commands/KeySort.php +++ b/lib/Predis/Command/KeySort.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/sort * @author Daniele Alessandri */ -class KeySort extends Command implements IPrefixable +class KeySort extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/KeyTimeToLive.php b/lib/Predis/Command/KeyTimeToLive.php similarity index 94% rename from lib/Predis/Commands/KeyTimeToLive.php rename to lib/Predis/Command/KeyTimeToLive.php index 724f41cd..103885a6 100644 --- a/lib/Predis/Commands/KeyTimeToLive.php +++ b/lib/Predis/Command/KeyTimeToLive.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/ttl diff --git a/lib/Predis/Commands/KeyType.php b/lib/Predis/Command/KeyType.php similarity index 94% rename from lib/Predis/Commands/KeyType.php rename to lib/Predis/Command/KeyType.php index 461de985..b2baf9b4 100644 --- a/lib/Predis/Commands/KeyType.php +++ b/lib/Predis/Command/KeyType.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/type diff --git a/lib/Predis/Commands/ListIndex.php b/lib/Predis/Command/ListIndex.php similarity index 94% rename from lib/Predis/Commands/ListIndex.php rename to lib/Predis/Command/ListIndex.php index 281b3554..9762ebf8 100644 --- a/lib/Predis/Commands/ListIndex.php +++ b/lib/Predis/Command/ListIndex.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/lindex diff --git a/lib/Predis/Commands/ListInsert.php b/lib/Predis/Command/ListInsert.php similarity index 94% rename from lib/Predis/Commands/ListInsert.php rename to lib/Predis/Command/ListInsert.php index fd196e9e..289f9b45 100644 --- a/lib/Predis/Commands/ListInsert.php +++ b/lib/Predis/Command/ListInsert.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/linsert diff --git a/lib/Predis/Commands/ListLength.php b/lib/Predis/Command/ListLength.php similarity index 94% rename from lib/Predis/Commands/ListLength.php rename to lib/Predis/Command/ListLength.php index 18091a0c..c46dad4f 100644 --- a/lib/Predis/Commands/ListLength.php +++ b/lib/Predis/Command/ListLength.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/llen diff --git a/lib/Predis/Commands/ListPopFirst.php b/lib/Predis/Command/ListPopFirst.php similarity index 94% rename from lib/Predis/Commands/ListPopFirst.php rename to lib/Predis/Command/ListPopFirst.php index 9a750d07..f1afc4e4 100644 --- a/lib/Predis/Commands/ListPopFirst.php +++ b/lib/Predis/Command/ListPopFirst.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/lpop diff --git a/lib/Predis/Commands/ListPopFirstBlocking.php b/lib/Predis/Command/ListPopFirstBlocking.php similarity index 90% rename from lib/Predis/Commands/ListPopFirstBlocking.php rename to lib/Predis/Command/ListPopFirstBlocking.php index 5a348be9..95d52dc5 100644 --- a/lib/Predis/Commands/ListPopFirstBlocking.php +++ b/lib/Predis/Command/ListPopFirstBlocking.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/blpop * @author Daniele Alessandri */ -class ListPopFirstBlocking extends Command implements IPrefixable +class ListPopFirstBlocking extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ListPopLast.php b/lib/Predis/Command/ListPopLast.php similarity index 94% rename from lib/Predis/Commands/ListPopLast.php rename to lib/Predis/Command/ListPopLast.php index 8d2a33a0..a161f908 100644 --- a/lib/Predis/Commands/ListPopLast.php +++ b/lib/Predis/Command/ListPopLast.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/rpop diff --git a/lib/Predis/Commands/ListPopLastBlocking.php b/lib/Predis/Command/ListPopLastBlocking.php similarity index 94% rename from lib/Predis/Commands/ListPopLastBlocking.php rename to lib/Predis/Command/ListPopLastBlocking.php index 777e1eed..fc3d4214 100644 --- a/lib/Predis/Commands/ListPopLastBlocking.php +++ b/lib/Predis/Command/ListPopLastBlocking.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/brpop diff --git a/lib/Predis/Commands/ListPopLastPushHead.php b/lib/Predis/Command/ListPopLastPushHead.php similarity index 86% rename from lib/Predis/Commands/ListPopLastPushHead.php rename to lib/Predis/Command/ListPopLastPushHead.php index 7084b635..12052bb2 100644 --- a/lib/Predis/Commands/ListPopLastPushHead.php +++ b/lib/Predis/Command/ListPopLastPushHead.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/rpoplpush * @author Daniele Alessandri */ -class ListPopLastPushHead extends Command implements IPrefixable +class ListPopLastPushHead extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ListPopLastPushHeadBlocking.php b/lib/Predis/Command/ListPopLastPushHeadBlocking.php similarity index 86% rename from lib/Predis/Commands/ListPopLastPushHeadBlocking.php rename to lib/Predis/Command/ListPopLastPushHeadBlocking.php index 7da1efe5..bc785674 100644 --- a/lib/Predis/Commands/ListPopLastPushHeadBlocking.php +++ b/lib/Predis/Command/ListPopLastPushHeadBlocking.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/brpoplpush * @author Daniele Alessandri */ -class ListPopLastPushHeadBlocking extends Command implements IPrefixable +class ListPopLastPushHeadBlocking extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ListPushHead.php b/lib/Predis/Command/ListPushHead.php similarity index 94% rename from lib/Predis/Commands/ListPushHead.php rename to lib/Predis/Command/ListPushHead.php index 02bf6f62..6dcb61ba 100644 --- a/lib/Predis/Commands/ListPushHead.php +++ b/lib/Predis/Command/ListPushHead.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/lpush diff --git a/lib/Predis/Commands/ListPushHeadX.php b/lib/Predis/Command/ListPushHeadX.php similarity index 94% rename from lib/Predis/Commands/ListPushHeadX.php rename to lib/Predis/Command/ListPushHeadX.php index 9a4ee57d..2cb671ec 100644 --- a/lib/Predis/Commands/ListPushHeadX.php +++ b/lib/Predis/Command/ListPushHeadX.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/lpushx diff --git a/lib/Predis/Commands/ListPushTail.php b/lib/Predis/Command/ListPushTail.php similarity index 96% rename from lib/Predis/Commands/ListPushTail.php rename to lib/Predis/Command/ListPushTail.php index 32d98d1b..5c71aeb4 100644 --- a/lib/Predis/Commands/ListPushTail.php +++ b/lib/Predis/Command/ListPushTail.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; diff --git a/lib/Predis/Commands/ListPushTailX.php b/lib/Predis/Command/ListPushTailX.php similarity index 94% rename from lib/Predis/Commands/ListPushTailX.php rename to lib/Predis/Command/ListPushTailX.php index 9fbb83ef..af42a52f 100644 --- a/lib/Predis/Commands/ListPushTailX.php +++ b/lib/Predis/Command/ListPushTailX.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/rpushx diff --git a/lib/Predis/Commands/ListRange.php b/lib/Predis/Command/ListRange.php similarity index 94% rename from lib/Predis/Commands/ListRange.php rename to lib/Predis/Command/ListRange.php index c3390baa..2b2e945e 100644 --- a/lib/Predis/Commands/ListRange.php +++ b/lib/Predis/Command/ListRange.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/lrange diff --git a/lib/Predis/Commands/ListRemove.php b/lib/Predis/Command/ListRemove.php similarity index 94% rename from lib/Predis/Commands/ListRemove.php rename to lib/Predis/Command/ListRemove.php index ceb40cd0..98f88540 100644 --- a/lib/Predis/Commands/ListRemove.php +++ b/lib/Predis/Command/ListRemove.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/lrem diff --git a/lib/Predis/Commands/ListSet.php b/lib/Predis/Command/ListSet.php similarity index 94% rename from lib/Predis/Commands/ListSet.php rename to lib/Predis/Command/ListSet.php index 585b2670..0ea1ee73 100644 --- a/lib/Predis/Commands/ListSet.php +++ b/lib/Predis/Command/ListSet.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/lset diff --git a/lib/Predis/Commands/ListTrim.php b/lib/Predis/Command/ListTrim.php similarity index 94% rename from lib/Predis/Commands/ListTrim.php rename to lib/Predis/Command/ListTrim.php index e22194df..80d73e5b 100644 --- a/lib/Predis/Commands/ListTrim.php +++ b/lib/Predis/Command/ListTrim.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/ltrim diff --git a/lib/Predis/Commands/PrefixHelpers.php b/lib/Predis/Command/PrefixHelpers.php similarity index 77% rename from lib/Predis/Commands/PrefixHelpers.php rename to lib/Predis/Command/PrefixHelpers.php index 98180c6e..4bc5675b 100644 --- a/lib/Predis/Commands/PrefixHelpers.php +++ b/lib/Predis/Command/PrefixHelpers.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * Class that defines a few helpers method for prefixing keys. @@ -21,10 +21,10 @@ class PrefixHelpers /** * Applies the specified prefix only the first argument. * - * @param ICommand $command Command instance. + * @param CommandInterface $command Command instance. * @param string $prefix Prefix string. */ - public static function first(ICommand $command, $prefix) + public static function first(CommandInterface $command, $prefix) { if ($arguments = $command->getArguments()) { $arguments[0] = "$prefix{$arguments[0]}"; @@ -35,10 +35,10 @@ class PrefixHelpers /** * Applies the specified prefix to all the arguments. * - * @param ICommand $command Command instance. + * @param CommandInterface $command Command instance. * @param string $prefix Prefix string. */ - public static function all(ICommand $command, $prefix) + public static function all(CommandInterface $command, $prefix) { $arguments = $command->getArguments(); @@ -52,10 +52,10 @@ class PrefixHelpers /** * Applies the specified prefix only to even arguments in the list. * - * @param ICommand $command Command instance. + * @param CommandInterface $command Command instance. * @param string $prefix Prefix string. */ - public static function interleaved(ICommand $command, $prefix) + public static function interleaved(CommandInterface $command, $prefix) { $arguments = $command->getArguments(); $length = count($arguments); @@ -70,10 +70,10 @@ class PrefixHelpers /** * Applies the specified prefix to all the arguments but the last one. * - * @param ICommand $command Command instance. + * @param CommandInterface $command Command instance. * @param string $prefix Prefix string. */ - public static function skipLast(ICommand $command, $prefix) + public static function skipLast(CommandInterface $command, $prefix) { $arguments = $command->getArguments(); $length = count($arguments); diff --git a/lib/Predis/Commands/PrefixableCommand.php b/lib/Predis/Command/PrefixableCommand.php similarity index 83% rename from lib/Predis/Commands/PrefixableCommand.php rename to lib/Predis/Command/PrefixableCommand.php index 21289d88..7112e87d 100644 --- a/lib/Predis/Commands/PrefixableCommand.php +++ b/lib/Predis/Command/PrefixableCommand.php @@ -9,14 +9,14 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * Base class for Redis commands with prefixable keys. * * @author Daniele Alessandri */ -abstract class PrefixableCommand extends Command implements IPrefixable +abstract class PrefixableCommand extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/IPrefixable.php b/lib/Predis/Command/PrefixableCommandInterface.php similarity index 85% rename from lib/Predis/Commands/IPrefixable.php rename to lib/Predis/Command/PrefixableCommandInterface.php index 87415f8b..acb99a22 100644 --- a/lib/Predis/Commands/IPrefixable.php +++ b/lib/Predis/Command/PrefixableCommandInterface.php @@ -9,16 +9,14 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; - -use Predis\Distribution\INodeKeyGenerator; +namespace Predis\Command; /** * Defines a command whose keys can be prefixed. * * @author Daniele Alessandri */ -interface IPrefixable +interface PrefixableCommandInterface { /** * Prefixes all the keys found in the arguments of the command. diff --git a/lib/Predis/Commands/Processors/IProcessingSupport.php b/lib/Predis/Command/Processor/CommandProcessingInterface.php similarity index 68% rename from lib/Predis/Commands/Processors/IProcessingSupport.php rename to lib/Predis/Command/Processor/CommandProcessingInterface.php index 3e5a2987..376d4651 100644 --- a/lib/Predis/Commands/Processors/IProcessingSupport.php +++ b/lib/Predis/Command/Processor/CommandProcessingInterface.php @@ -9,26 +9,26 @@ * file that was distributed with this source code. */ -namespace Predis\Commands\Processors; +namespace Predis\Command\Processor; /** * Defines an object that can process commands using command processors. * * @author Daniele Alessandri */ -interface IProcessingSupport +interface CommandProcessingInterface { /** * Associates a command processor. * - * @param ICommandProcessor $processor The command processor. + * @param CommandProcessorInterface $processor The command processor. */ - public function setProcessor(ICommandProcessor $processor); + public function setProcessor(CommandProcessorInterface $processor); /** * Returns the associated command processor. * - * @return ICommandProcessor + * @return CommandProcessorInterface */ public function getProcessor(); } diff --git a/lib/Predis/Commands/Processors/ICommandProcessorChain.php b/lib/Predis/Command/Processor/CommandProcessorChainInterface.php similarity index 63% rename from lib/Predis/Commands/Processors/ICommandProcessorChain.php rename to lib/Predis/Command/Processor/CommandProcessorChainInterface.php index d82bd879..2985ac91 100644 --- a/lib/Predis/Commands/Processors/ICommandProcessorChain.php +++ b/lib/Predis/Command/Processor/CommandProcessorChainInterface.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands\Processors; +namespace Predis\Command\Processor; /** * A command processor chain processes a command using multiple chained command @@ -17,21 +17,21 @@ namespace Predis\Commands\Processors; * * @author Daniele Alessandri */ -interface ICommandProcessorChain extends ICommandProcessor, \IteratorAggregate, \Countable +interface CommandProcessorChainInterface extends CommandProcessorInterface, \IteratorAggregate, \Countable { /** * Adds a command processor. * - * @param ICommandProcessor $processor A command processor. + * @param CommandProcessorInterface $processor A command processor. */ - public function add(ICommandProcessor $processor); + public function add(CommandProcessorInterface $processor); /** * Removes a command processor from the chain. * - * @param ICommandProcessor $processor A command processor. + * @param CommandProcessorInterface $processor A command processor. */ - public function remove(ICommandProcessor $processor); + public function remove(CommandProcessorInterface $processor); /** * Returns an ordered list of the command processors in the chain. diff --git a/lib/Predis/Commands/Processors/ICommandProcessor.php b/lib/Predis/Command/Processor/CommandProcessorInterface.php similarity index 66% rename from lib/Predis/Commands/Processors/ICommandProcessor.php rename to lib/Predis/Command/Processor/CommandProcessorInterface.php index 7b530700..e23eade0 100644 --- a/lib/Predis/Commands/Processors/ICommandProcessor.php +++ b/lib/Predis/Command/Processor/CommandProcessorInterface.php @@ -9,21 +9,21 @@ * file that was distributed with this source code. */ -namespace Predis\Commands\Processors; +namespace Predis\Command\Processor; -use Predis\Commands\ICommand; +use Predis\Command\CommandInterface; /** * A command processor processes commands before they are sent to Redis. * * @author Daniele Alessandri */ -interface ICommandProcessor +interface CommandProcessorInterface { /** * Processes a Redis command. * - * @param ICommand $command Redis command. + * @param CommandInterface $command Redis command. */ - public function process(ICommand $command); + public function process(CommandInterface $command); } diff --git a/lib/Predis/Commands/Processors/KeyPrefixProcessor.php b/lib/Predis/Command/Processor/KeyPrefixProcessor.php similarity index 78% rename from lib/Predis/Commands/Processors/KeyPrefixProcessor.php rename to lib/Predis/Command/Processor/KeyPrefixProcessor.php index 5dbac31f..3fa4182c 100644 --- a/lib/Predis/Commands/Processors/KeyPrefixProcessor.php +++ b/lib/Predis/Command/Processor/KeyPrefixProcessor.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace Predis\Commands\Processors; +namespace Predis\Command\Processor; -use Predis\Commands\ICommand; -use Predis\Commands\IPrefixable; +use Predis\Command\CommandInterface; +use Predis\Command\PrefixableCommandInterface; /** * Command processor that is used to prefix the keys contained in the arguments @@ -20,7 +20,7 @@ use Predis\Commands\IPrefixable; * * @author Daniele Alessandri */ -class KeyPrefixProcessor implements ICommandProcessor +class KeyPrefixProcessor implements CommandProcessorInterface { private $prefix; @@ -55,9 +55,9 @@ class KeyPrefixProcessor implements ICommandProcessor /** * {@inheritdoc} */ - public function process(ICommand $command) + public function process(CommandInterface $command) { - if ($command instanceof IPrefixable) { + if ($command instanceof PrefixableCommandInterface) { $command->prefixKeys($this->prefix); } } diff --git a/lib/Predis/Commands/Processors/ProcessorChain.php b/lib/Predis/Command/Processor/ProcessorChain.php similarity index 80% rename from lib/Predis/Commands/Processors/ProcessorChain.php rename to lib/Predis/Command/Processor/ProcessorChain.php index 867cc6b3..e15bc2a4 100644 --- a/lib/Predis/Commands/Processors/ProcessorChain.php +++ b/lib/Predis/Command/Processor/ProcessorChain.php @@ -9,21 +9,21 @@ * file that was distributed with this source code. */ -namespace Predis\Commands\Processors; +namespace Predis\Command\Processor; -use Predis\Commands\ICommand; +use Predis\Command\CommandInterface; /** * Default implementation of a command processors chain. * * @author Daniele Alessandri */ -class ProcessorChain implements ICommandProcessorChain, \ArrayAccess +class ProcessorChain implements CommandProcessorChainInterface, \ArrayAccess { private $processors = array(); /** - * @param array $processors List of instances of ICommandProcessor. + * @param array $processors List of instances of CommandProcessorInterface. */ public function __construct($processors = array()) { @@ -35,7 +35,7 @@ class ProcessorChain implements ICommandProcessorChain, \ArrayAccess /** * {@inheritdoc} */ - public function add(ICommandProcessor $processor) + public function add(CommandProcessorInterface $processor) { $this->processors[] = $processor; } @@ -43,7 +43,7 @@ class ProcessorChain implements ICommandProcessorChain, \ArrayAccess /** * {@inheritdoc} */ - public function remove(ICommandProcessor $processor) + public function remove(CommandProcessorInterface $processor) { $index = array_search($processor, $this->processors, true); if ($index !== false) { @@ -54,7 +54,7 @@ class ProcessorChain implements ICommandProcessorChain, \ArrayAccess /** * {@inheritdoc} */ - public function process(ICommand $command) + public function process(CommandInterface $command) { $count = count($this->processors); for ($i = 0; $i < $count; $i++) { @@ -111,10 +111,10 @@ class ProcessorChain implements ICommandProcessorChain, \ArrayAccess */ public function offsetSet($index, $processor) { - if (!$processor instanceof ICommandProcessor) { + if (!$processor instanceof CommandProcessorInterface) { throw new \InvalidArgumentException( 'A processor chain can hold only instances of classes implementing '. - 'the Predis\Commands\Preprocessors\ICommandProcessor interface' + 'the Predis\Command\Processor\CommandProcessorInterface interface' ); } diff --git a/lib/Predis/Commands/PubSubPublish.php b/lib/Predis/Command/PubSubPublish.php similarity index 95% rename from lib/Predis/Commands/PubSubPublish.php rename to lib/Predis/Command/PubSubPublish.php index 4a01292f..0f32d66b 100644 --- a/lib/Predis/Commands/PubSubPublish.php +++ b/lib/Predis/Command/PubSubPublish.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/publish diff --git a/lib/Predis/Commands/PubSubSubscribe.php b/lib/Predis/Command/PubSubSubscribe.php similarity index 88% rename from lib/Predis/Commands/PubSubSubscribe.php rename to lib/Predis/Command/PubSubSubscribe.php index 1f964dfc..18cbe711 100644 --- a/lib/Predis/Commands/PubSubSubscribe.php +++ b/lib/Predis/Command/PubSubSubscribe.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; @@ -17,7 +17,7 @@ use Predis\Helpers; * @link http://redis.io/commands/subscribe * @author Daniele Alessandri */ -class PubSubSubscribe extends Command implements IPrefixable +class PubSubSubscribe extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/PubSubSubscribeByPattern.php b/lib/Predis/Command/PubSubSubscribeByPattern.php similarity index 95% rename from lib/Predis/Commands/PubSubSubscribeByPattern.php rename to lib/Predis/Command/PubSubSubscribeByPattern.php index 897b0bef..f58a6394 100644 --- a/lib/Predis/Commands/PubSubSubscribeByPattern.php +++ b/lib/Predis/Command/PubSubSubscribeByPattern.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; diff --git a/lib/Predis/Commands/PubSubUnsubscribe.php b/lib/Predis/Command/PubSubUnsubscribe.php similarity index 88% rename from lib/Predis/Commands/PubSubUnsubscribe.php rename to lib/Predis/Command/PubSubUnsubscribe.php index e17c553c..c041a17a 100644 --- a/lib/Predis/Commands/PubSubUnsubscribe.php +++ b/lib/Predis/Command/PubSubUnsubscribe.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; @@ -17,7 +17,7 @@ use Predis\Helpers; * @link http://redis.io/commands/unsubscribe * @author Daniele Alessandri */ -class PubSubUnsubscribe extends Command implements IPrefixable +class PubSubUnsubscribe extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/PubSubUnsubscribeByPattern.php b/lib/Predis/Command/PubSubUnsubscribeByPattern.php similarity index 95% rename from lib/Predis/Commands/PubSubUnsubscribeByPattern.php rename to lib/Predis/Command/PubSubUnsubscribeByPattern.php index 5129c02f..f846e658 100644 --- a/lib/Predis/Commands/PubSubUnsubscribeByPattern.php +++ b/lib/Predis/Command/PubSubUnsubscribeByPattern.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/punsubscribe diff --git a/lib/Predis/Commands/ScriptedCommand.php b/lib/Predis/Command/ScriptedCommand.php similarity index 98% rename from lib/Predis/Commands/ScriptedCommand.php rename to lib/Predis/Command/ScriptedCommand.php index 7f702802..d98b2d6d 100644 --- a/lib/Predis/Commands/ScriptedCommand.php +++ b/lib/Predis/Command/ScriptedCommand.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * Base class used to implement an higher level abstraction for "virtual" diff --git a/lib/Predis/Commands/ServerBackgroundRewriteAOF.php b/lib/Predis/Command/ServerBackgroundRewriteAOF.php similarity index 89% rename from lib/Predis/Commands/ServerBackgroundRewriteAOF.php rename to lib/Predis/Command/ServerBackgroundRewriteAOF.php index 4ee29a4d..7f43291f 100644 --- a/lib/Predis/Commands/ServerBackgroundRewriteAOF.php +++ b/lib/Predis/Command/ServerBackgroundRewriteAOF.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/bgrewriteaof * @author Daniele Alessandri */ -class ServerBackgroundRewriteAOF extends Command +class ServerBackgroundRewriteAOF extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerBackgroundSave.php b/lib/Predis/Command/ServerBackgroundSave.php similarity index 90% rename from lib/Predis/Commands/ServerBackgroundSave.php rename to lib/Predis/Command/ServerBackgroundSave.php index fd656cb0..23f7b38c 100644 --- a/lib/Predis/Commands/ServerBackgroundSave.php +++ b/lib/Predis/Command/ServerBackgroundSave.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/bgsave * @author Daniele Alessandri */ -class ServerBackgroundSave extends Command +class ServerBackgroundSave extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerClient.php b/lib/Predis/Command/ServerClient.php similarity index 95% rename from lib/Predis/Commands/ServerClient.php rename to lib/Predis/Command/ServerClient.php index 213f0b35..ab08dc3f 100644 --- a/lib/Predis/Commands/ServerClient.php +++ b/lib/Predis/Command/ServerClient.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/client * @author Daniele Alessandri */ -class ServerClient extends Command +class ServerClient extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerConfig.php b/lib/Predis/Command/ServerConfig.php similarity index 90% rename from lib/Predis/Commands/ServerConfig.php rename to lib/Predis/Command/ServerConfig.php index 8bfd5e94..22c6e328 100644 --- a/lib/Predis/Commands/ServerConfig.php +++ b/lib/Predis/Command/ServerConfig.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; -use Predis\Iterators\MultiBulkResponseTuple; +use Predis\Iterator\MultiBulkResponseTuple; /** * @link http://redis.io/commands/config-set @@ -19,7 +19,7 @@ use Predis\Iterators\MultiBulkResponseTuple; * @link http://redis.io/commands/config-resetstat * @author Daniele Alessandri */ -class ServerConfig extends Command +class ServerConfig extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerDatabaseSize.php b/lib/Predis/Command/ServerDatabaseSize.php similarity index 88% rename from lib/Predis/Commands/ServerDatabaseSize.php rename to lib/Predis/Command/ServerDatabaseSize.php index 945735a7..7a539232 100644 --- a/lib/Predis/Commands/ServerDatabaseSize.php +++ b/lib/Predis/Command/ServerDatabaseSize.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/dbsize * @author Daniele Alessandri */ -class ServerDatabaseSize extends Command +class ServerDatabaseSize extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerEval.php b/lib/Predis/Command/ServerEval.php similarity index 91% rename from lib/Predis/Commands/ServerEval.php rename to lib/Predis/Command/ServerEval.php index 4b3ed4f3..f2d6766c 100644 --- a/lib/Predis/Commands/ServerEval.php +++ b/lib/Predis/Command/ServerEval.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/eval * @author Daniele Alessandri */ -class ServerEval extends Command implements IPrefixable +class ServerEval extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerEvalSHA.php b/lib/Predis/Command/ServerEvalSHA.php similarity index 94% rename from lib/Predis/Commands/ServerEvalSHA.php rename to lib/Predis/Command/ServerEvalSHA.php index 2e546fea..1e6ccc89 100644 --- a/lib/Predis/Commands/ServerEvalSHA.php +++ b/lib/Predis/Command/ServerEvalSHA.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/evalsha diff --git a/lib/Predis/Commands/ServerFlushAll.php b/lib/Predis/Command/ServerFlushAll.php similarity index 88% rename from lib/Predis/Commands/ServerFlushAll.php rename to lib/Predis/Command/ServerFlushAll.php index 0616c662..562faf80 100644 --- a/lib/Predis/Commands/ServerFlushAll.php +++ b/lib/Predis/Command/ServerFlushAll.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/flushall * @author Daniele Alessandri */ -class ServerFlushAll extends Command +class ServerFlushAll extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerFlushDatabase.php b/lib/Predis/Command/ServerFlushDatabase.php similarity index 88% rename from lib/Predis/Commands/ServerFlushDatabase.php rename to lib/Predis/Command/ServerFlushDatabase.php index 3b335611..686f2977 100644 --- a/lib/Predis/Commands/ServerFlushDatabase.php +++ b/lib/Predis/Command/ServerFlushDatabase.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/flushdb * @author Daniele Alessandri */ -class ServerFlushDatabase extends Command +class ServerFlushDatabase extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerInfo.php b/lib/Predis/Command/ServerInfo.php similarity index 97% rename from lib/Predis/Commands/ServerInfo.php rename to lib/Predis/Command/ServerInfo.php index a4edc20f..82422389 100644 --- a/lib/Predis/Commands/ServerInfo.php +++ b/lib/Predis/Command/ServerInfo.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/info * @author Daniele Alessandri */ -class ServerInfo extends Command +class ServerInfo extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerInfoV26x.php b/lib/Predis/Command/ServerInfoV26x.php similarity index 98% rename from lib/Predis/Commands/ServerInfoV26x.php rename to lib/Predis/Command/ServerInfoV26x.php index d6fb619a..e9933cc0 100644 --- a/lib/Predis/Commands/ServerInfoV26x.php +++ b/lib/Predis/Command/ServerInfoV26x.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/info diff --git a/lib/Predis/Commands/ServerLastSave.php b/lib/Predis/Command/ServerLastSave.php similarity index 88% rename from lib/Predis/Commands/ServerLastSave.php rename to lib/Predis/Command/ServerLastSave.php index 30a47752..e138cc29 100644 --- a/lib/Predis/Commands/ServerLastSave.php +++ b/lib/Predis/Command/ServerLastSave.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/lastsave * @author Daniele Alessandri */ -class ServerLastSave extends Command +class ServerLastSave extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerMonitor.php b/lib/Predis/Command/ServerMonitor.php similarity index 88% rename from lib/Predis/Commands/ServerMonitor.php rename to lib/Predis/Command/ServerMonitor.php index 1f211d48..4bf389b5 100644 --- a/lib/Predis/Commands/ServerMonitor.php +++ b/lib/Predis/Command/ServerMonitor.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/monitor * @author Daniele Alessandri */ -class ServerMonitor extends Command +class ServerMonitor extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerObject.php b/lib/Predis/Command/ServerObject.php similarity index 89% rename from lib/Predis/Commands/ServerObject.php rename to lib/Predis/Command/ServerObject.php index b6a276f5..69dd432c 100644 --- a/lib/Predis/Commands/ServerObject.php +++ b/lib/Predis/Command/ServerObject.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; @@ -17,7 +17,7 @@ use Predis\Helpers; * @link http://redis.io/commands/object * @author Daniele Alessandri */ -class ServerObject extends Command +class ServerObject extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerSave.php b/lib/Predis/Command/ServerSave.php similarity index 89% rename from lib/Predis/Commands/ServerSave.php rename to lib/Predis/Command/ServerSave.php index e30f9b11..7080da23 100644 --- a/lib/Predis/Commands/ServerSave.php +++ b/lib/Predis/Command/ServerSave.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/save * @author Daniele Alessandri */ -class ServerSave extends Command +class ServerSave extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerScript.php b/lib/Predis/Command/ServerScript.php similarity index 89% rename from lib/Predis/Commands/ServerScript.php rename to lib/Predis/Command/ServerScript.php index 2475fcf9..008c6ccb 100644 --- a/lib/Predis/Commands/ServerScript.php +++ b/lib/Predis/Command/ServerScript.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/script * @author Daniele Alessandri */ -class ServerScript extends Command +class ServerScript extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerShutdown.php b/lib/Predis/Command/ServerShutdown.php similarity index 88% rename from lib/Predis/Commands/ServerShutdown.php rename to lib/Predis/Command/ServerShutdown.php index fb92f67c..c11c3368 100644 --- a/lib/Predis/Commands/ServerShutdown.php +++ b/lib/Predis/Command/ServerShutdown.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/shutdown * @author Daniele Alessandri */ -class ServerShutdown extends Command +class ServerShutdown extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerSlaveOf.php b/lib/Predis/Command/ServerSlaveOf.php similarity index 92% rename from lib/Predis/Commands/ServerSlaveOf.php rename to lib/Predis/Command/ServerSlaveOf.php index 99a6cc9c..4c895aa4 100644 --- a/lib/Predis/Commands/ServerSlaveOf.php +++ b/lib/Predis/Command/ServerSlaveOf.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/slaveof * @author Daniele Alessandri */ -class ServerSlaveOf extends Command +class ServerSlaveOf extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ServerSlowlog.php b/lib/Predis/Command/ServerSlowlog.php similarity index 93% rename from lib/Predis/Commands/ServerSlowlog.php rename to lib/Predis/Command/ServerSlowlog.php index 0955f31b..8e80f8b1 100644 --- a/lib/Predis/Commands/ServerSlowlog.php +++ b/lib/Predis/Command/ServerSlowlog.php @@ -9,15 +9,15 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; -use Predis\Iterators\MultiBulkResponse; +use Predis\Iterator\MultiBulkResponse; /** * @link http://redis.io/commands/slowlog * @author Daniele Alessandri */ -class ServerSlowlog extends Command +class ServerSlowlog extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/SetAdd.php b/lib/Predis/Command/SetAdd.php similarity index 96% rename from lib/Predis/Commands/SetAdd.php rename to lib/Predis/Command/SetAdd.php index 6738e04a..1fc33012 100644 --- a/lib/Predis/Commands/SetAdd.php +++ b/lib/Predis/Command/SetAdd.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; diff --git a/lib/Predis/Commands/SetCardinality.php b/lib/Predis/Command/SetCardinality.php similarity index 94% rename from lib/Predis/Commands/SetCardinality.php rename to lib/Predis/Command/SetCardinality.php index 1aa5cba2..8e6e48e0 100644 --- a/lib/Predis/Commands/SetCardinality.php +++ b/lib/Predis/Command/SetCardinality.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/scard diff --git a/lib/Predis/Commands/SetDifference.php b/lib/Predis/Command/SetDifference.php similarity index 94% rename from lib/Predis/Commands/SetDifference.php rename to lib/Predis/Command/SetDifference.php index 13d05bb5..14d3f211 100644 --- a/lib/Predis/Commands/SetDifference.php +++ b/lib/Predis/Command/SetDifference.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/sdiff diff --git a/lib/Predis/Commands/SetDifferenceStore.php b/lib/Predis/Command/SetDifferenceStore.php similarity index 94% rename from lib/Predis/Commands/SetDifferenceStore.php rename to lib/Predis/Command/SetDifferenceStore.php index d0f29721..1fae8b7a 100644 --- a/lib/Predis/Commands/SetDifferenceStore.php +++ b/lib/Predis/Command/SetDifferenceStore.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/sdiffstore diff --git a/lib/Predis/Commands/SetIntersection.php b/lib/Predis/Command/SetIntersection.php similarity index 89% rename from lib/Predis/Commands/SetIntersection.php rename to lib/Predis/Command/SetIntersection.php index 0c665d6a..3b540788 100644 --- a/lib/Predis/Commands/SetIntersection.php +++ b/lib/Predis/Command/SetIntersection.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; @@ -17,7 +17,7 @@ use Predis\Helpers; * @link http://redis.io/commands/sinter * @author Daniele Alessandri */ -class SetIntersection extends Command implements IPrefixable +class SetIntersection extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/SetIntersectionStore.php b/lib/Predis/Command/SetIntersectionStore.php similarity index 89% rename from lib/Predis/Commands/SetIntersectionStore.php rename to lib/Predis/Command/SetIntersectionStore.php index 74551ee5..59e59e34 100644 --- a/lib/Predis/Commands/SetIntersectionStore.php +++ b/lib/Predis/Command/SetIntersectionStore.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/sinterstore * @author Daniele Alessandri */ -class SetIntersectionStore extends Command implements IPrefixable +class SetIntersectionStore extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/SetIsMember.php b/lib/Predis/Command/SetIsMember.php similarity index 95% rename from lib/Predis/Commands/SetIsMember.php rename to lib/Predis/Command/SetIsMember.php index f5c6b683..07735209 100644 --- a/lib/Predis/Commands/SetIsMember.php +++ b/lib/Predis/Command/SetIsMember.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/sismember diff --git a/lib/Predis/Commands/SetMembers.php b/lib/Predis/Command/SetMembers.php similarity index 94% rename from lib/Predis/Commands/SetMembers.php rename to lib/Predis/Command/SetMembers.php index 335ebe7b..3ebef0a1 100644 --- a/lib/Predis/Commands/SetMembers.php +++ b/lib/Predis/Command/SetMembers.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/smembers diff --git a/lib/Predis/Commands/SetMove.php b/lib/Predis/Command/SetMove.php similarity index 88% rename from lib/Predis/Commands/SetMove.php rename to lib/Predis/Command/SetMove.php index 57253aef..343d4eff 100644 --- a/lib/Predis/Commands/SetMove.php +++ b/lib/Predis/Command/SetMove.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/smove * @author Daniele Alessandri */ -class SetMove extends Command implements IPrefixable +class SetMove extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/SetPop.php b/lib/Predis/Command/SetPop.php similarity index 94% rename from lib/Predis/Commands/SetPop.php rename to lib/Predis/Command/SetPop.php index 078559c3..ebfec0cc 100644 --- a/lib/Predis/Commands/SetPop.php +++ b/lib/Predis/Command/SetPop.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/spop diff --git a/lib/Predis/Commands/SetRandomMember.php b/lib/Predis/Command/SetRandomMember.php similarity index 94% rename from lib/Predis/Commands/SetRandomMember.php rename to lib/Predis/Command/SetRandomMember.php index 029a9e6f..a6b6062e 100644 --- a/lib/Predis/Commands/SetRandomMember.php +++ b/lib/Predis/Command/SetRandomMember.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/srandmember diff --git a/lib/Predis/Commands/SetRemove.php b/lib/Predis/Command/SetRemove.php similarity index 96% rename from lib/Predis/Commands/SetRemove.php rename to lib/Predis/Command/SetRemove.php index 2e9ba3a9..bae506f4 100644 --- a/lib/Predis/Commands/SetRemove.php +++ b/lib/Predis/Command/SetRemove.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; diff --git a/lib/Predis/Commands/SetUnion.php b/lib/Predis/Command/SetUnion.php similarity index 94% rename from lib/Predis/Commands/SetUnion.php rename to lib/Predis/Command/SetUnion.php index bbb1ff0f..c9f322b2 100644 --- a/lib/Predis/Commands/SetUnion.php +++ b/lib/Predis/Command/SetUnion.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/sunion diff --git a/lib/Predis/Commands/SetUnionStore.php b/lib/Predis/Command/SetUnionStore.php similarity index 94% rename from lib/Predis/Commands/SetUnionStore.php rename to lib/Predis/Command/SetUnionStore.php index 0259af13..daf66c33 100644 --- a/lib/Predis/Commands/SetUnionStore.php +++ b/lib/Predis/Command/SetUnionStore.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/sunionstore diff --git a/lib/Predis/Commands/StringAppend.php b/lib/Predis/Command/StringAppend.php similarity index 94% rename from lib/Predis/Commands/StringAppend.php rename to lib/Predis/Command/StringAppend.php index d2729ba6..8d146148 100644 --- a/lib/Predis/Commands/StringAppend.php +++ b/lib/Predis/Command/StringAppend.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/append diff --git a/lib/Predis/Commands/StringDecrement.php b/lib/Predis/Command/StringDecrement.php similarity index 94% rename from lib/Predis/Commands/StringDecrement.php rename to lib/Predis/Command/StringDecrement.php index 12e6b7b1..0e45cd0d 100644 --- a/lib/Predis/Commands/StringDecrement.php +++ b/lib/Predis/Command/StringDecrement.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/decr diff --git a/lib/Predis/Commands/StringDecrementBy.php b/lib/Predis/Command/StringDecrementBy.php similarity index 94% rename from lib/Predis/Commands/StringDecrementBy.php rename to lib/Predis/Command/StringDecrementBy.php index 1123aebd..e716e0eb 100644 --- a/lib/Predis/Commands/StringDecrementBy.php +++ b/lib/Predis/Command/StringDecrementBy.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/decrby diff --git a/lib/Predis/Commands/StringGet.php b/lib/Predis/Command/StringGet.php similarity index 94% rename from lib/Predis/Commands/StringGet.php rename to lib/Predis/Command/StringGet.php index 50bdaa76..851c7100 100644 --- a/lib/Predis/Commands/StringGet.php +++ b/lib/Predis/Command/StringGet.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/get diff --git a/lib/Predis/Commands/StringGetBit.php b/lib/Predis/Command/StringGetBit.php similarity index 94% rename from lib/Predis/Commands/StringGetBit.php rename to lib/Predis/Command/StringGetBit.php index 615ab53a..954c39fd 100644 --- a/lib/Predis/Commands/StringGetBit.php +++ b/lib/Predis/Command/StringGetBit.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/getbit diff --git a/lib/Predis/Commands/StringGetMultiple.php b/lib/Predis/Command/StringGetMultiple.php similarity index 89% rename from lib/Predis/Commands/StringGetMultiple.php rename to lib/Predis/Command/StringGetMultiple.php index 17234cee..49dcf08e 100644 --- a/lib/Predis/Commands/StringGetMultiple.php +++ b/lib/Predis/Command/StringGetMultiple.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; @@ -17,7 +17,7 @@ use Predis\Helpers; * @link http://redis.io/commands/mget * @author Daniele Alessandri */ -class StringGetMultiple extends Command implements IPrefixable +class StringGetMultiple extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/StringGetRange.php b/lib/Predis/Command/StringGetRange.php similarity index 94% rename from lib/Predis/Commands/StringGetRange.php rename to lib/Predis/Command/StringGetRange.php index d66437f1..aed48536 100644 --- a/lib/Predis/Commands/StringGetRange.php +++ b/lib/Predis/Command/StringGetRange.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/getrange diff --git a/lib/Predis/Commands/StringGetSet.php b/lib/Predis/Command/StringGetSet.php similarity index 94% rename from lib/Predis/Commands/StringGetSet.php rename to lib/Predis/Command/StringGetSet.php index 0084ac8a..d4b8e230 100644 --- a/lib/Predis/Commands/StringGetSet.php +++ b/lib/Predis/Command/StringGetSet.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/getset diff --git a/lib/Predis/Commands/StringIncrement.php b/lib/Predis/Command/StringIncrement.php similarity index 94% rename from lib/Predis/Commands/StringIncrement.php rename to lib/Predis/Command/StringIncrement.php index 8adb10ec..4848afcb 100644 --- a/lib/Predis/Commands/StringIncrement.php +++ b/lib/Predis/Command/StringIncrement.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/incr diff --git a/lib/Predis/Commands/StringIncrementBy.php b/lib/Predis/Command/StringIncrementBy.php similarity index 94% rename from lib/Predis/Commands/StringIncrementBy.php rename to lib/Predis/Command/StringIncrementBy.php index 9926c48f..7fa31880 100644 --- a/lib/Predis/Commands/StringIncrementBy.php +++ b/lib/Predis/Command/StringIncrementBy.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/incrby diff --git a/lib/Predis/Commands/StringIncrementByFloat.php b/lib/Predis/Command/StringIncrementByFloat.php similarity index 95% rename from lib/Predis/Commands/StringIncrementByFloat.php rename to lib/Predis/Command/StringIncrementByFloat.php index 47835940..7e14dff3 100644 --- a/lib/Predis/Commands/StringIncrementByFloat.php +++ b/lib/Predis/Command/StringIncrementByFloat.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/incrbyfloat diff --git a/lib/Predis/Commands/StringPreciseSetExpire.php b/lib/Predis/Command/StringPreciseSetExpire.php similarity index 94% rename from lib/Predis/Commands/StringPreciseSetExpire.php rename to lib/Predis/Command/StringPreciseSetExpire.php index ad6211d8..da2cbadb 100644 --- a/lib/Predis/Commands/StringPreciseSetExpire.php +++ b/lib/Predis/Command/StringPreciseSetExpire.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/psetex diff --git a/lib/Predis/Commands/StringSet.php b/lib/Predis/Command/StringSet.php similarity index 94% rename from lib/Predis/Commands/StringSet.php rename to lib/Predis/Command/StringSet.php index 0a9b0d6b..eb3739b3 100644 --- a/lib/Predis/Commands/StringSet.php +++ b/lib/Predis/Command/StringSet.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/set diff --git a/lib/Predis/Commands/StringSetBit.php b/lib/Predis/Command/StringSetBit.php similarity index 94% rename from lib/Predis/Commands/StringSetBit.php rename to lib/Predis/Command/StringSetBit.php index cddafbc1..a92b4185 100644 --- a/lib/Predis/Commands/StringSetBit.php +++ b/lib/Predis/Command/StringSetBit.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/setbit diff --git a/lib/Predis/Commands/StringSetExpire.php b/lib/Predis/Command/StringSetExpire.php similarity index 94% rename from lib/Predis/Commands/StringSetExpire.php rename to lib/Predis/Command/StringSetExpire.php index 391ce04f..c235e2bf 100644 --- a/lib/Predis/Commands/StringSetExpire.php +++ b/lib/Predis/Command/StringSetExpire.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/setex diff --git a/lib/Predis/Commands/StringSetMultiple.php b/lib/Predis/Command/StringSetMultiple.php similarity index 92% rename from lib/Predis/Commands/StringSetMultiple.php rename to lib/Predis/Command/StringSetMultiple.php index 46259528..e7ee533b 100644 --- a/lib/Predis/Commands/StringSetMultiple.php +++ b/lib/Predis/Command/StringSetMultiple.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/mset * @author Daniele Alessandri */ -class StringSetMultiple extends Command implements IPrefixable +class StringSetMultiple extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/StringSetMultiplePreserve.php b/lib/Predis/Command/StringSetMultiplePreserve.php similarity index 95% rename from lib/Predis/Commands/StringSetMultiplePreserve.php rename to lib/Predis/Command/StringSetMultiplePreserve.php index bbe397d6..961422d9 100644 --- a/lib/Predis/Commands/StringSetMultiplePreserve.php +++ b/lib/Predis/Command/StringSetMultiplePreserve.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/msetnx diff --git a/lib/Predis/Commands/StringSetPreserve.php b/lib/Predis/Command/StringSetPreserve.php similarity index 95% rename from lib/Predis/Commands/StringSetPreserve.php rename to lib/Predis/Command/StringSetPreserve.php index 0e9088b2..d6e4a813 100644 --- a/lib/Predis/Commands/StringSetPreserve.php +++ b/lib/Predis/Command/StringSetPreserve.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/setnx diff --git a/lib/Predis/Commands/StringSetRange.php b/lib/Predis/Command/StringSetRange.php similarity index 94% rename from lib/Predis/Commands/StringSetRange.php rename to lib/Predis/Command/StringSetRange.php index 5f82b338..da30f32d 100644 --- a/lib/Predis/Commands/StringSetRange.php +++ b/lib/Predis/Command/StringSetRange.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/setrange diff --git a/lib/Predis/Commands/StringStrlen.php b/lib/Predis/Command/StringStrlen.php similarity index 94% rename from lib/Predis/Commands/StringStrlen.php rename to lib/Predis/Command/StringStrlen.php index f3f82b72..1b839add 100644 --- a/lib/Predis/Commands/StringStrlen.php +++ b/lib/Predis/Command/StringStrlen.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/strlen diff --git a/lib/Predis/Commands/StringSubstr.php b/lib/Predis/Command/StringSubstr.php similarity index 94% rename from lib/Predis/Commands/StringSubstr.php rename to lib/Predis/Command/StringSubstr.php index 5db9ba7b..671fc169 100644 --- a/lib/Predis/Commands/StringSubstr.php +++ b/lib/Predis/Command/StringSubstr.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/substr diff --git a/lib/Predis/Commands/TransactionDiscard.php b/lib/Predis/Command/TransactionDiscard.php similarity index 88% rename from lib/Predis/Commands/TransactionDiscard.php rename to lib/Predis/Command/TransactionDiscard.php index 13eb4e04..e08f7419 100644 --- a/lib/Predis/Commands/TransactionDiscard.php +++ b/lib/Predis/Command/TransactionDiscard.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/discard * @author Daniele Alessandri */ -class TransactionDiscard extends Command +class TransactionDiscard extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/TransactionExec.php b/lib/Predis/Command/TransactionExec.php similarity index 88% rename from lib/Predis/Commands/TransactionExec.php rename to lib/Predis/Command/TransactionExec.php index 9cdb1fb4..5e2d5bbc 100644 --- a/lib/Predis/Commands/TransactionExec.php +++ b/lib/Predis/Command/TransactionExec.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/exec * @author Daniele Alessandri */ -class TransactionExec extends Command +class TransactionExec extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/TransactionMulti.php b/lib/Predis/Command/TransactionMulti.php similarity index 88% rename from lib/Predis/Commands/TransactionMulti.php rename to lib/Predis/Command/TransactionMulti.php index 7bf352e7..8febe751 100644 --- a/lib/Predis/Commands/TransactionMulti.php +++ b/lib/Predis/Command/TransactionMulti.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/multi * @author Daniele Alessandri */ -class TransactionMulti extends Command +class TransactionMulti extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/TransactionUnwatch.php b/lib/Predis/Command/TransactionUnwatch.php similarity index 90% rename from lib/Predis/Commands/TransactionUnwatch.php rename to lib/Predis/Command/TransactionUnwatch.php index 40670e16..e7b17b65 100644 --- a/lib/Predis/Commands/TransactionUnwatch.php +++ b/lib/Predis/Command/TransactionUnwatch.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/unwatch * @author Daniele Alessandri */ -class TransactionUnwatch extends Command +class TransactionUnwatch extends AbstractCommand { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/TransactionWatch.php b/lib/Predis/Command/TransactionWatch.php similarity index 90% rename from lib/Predis/Commands/TransactionWatch.php rename to lib/Predis/Command/TransactionWatch.php index e3571560..7be684a1 100644 --- a/lib/Predis/Commands/TransactionWatch.php +++ b/lib/Predis/Command/TransactionWatch.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/watch * @author Daniele Alessandri */ -class TransactionWatch extends Command implements IPrefixable +class TransactionWatch extends AbstractCommand implements PrefixableCommandInterface { /** * {@inheritdoc} diff --git a/lib/Predis/Commands/ZSetAdd.php b/lib/Predis/Command/ZSetAdd.php similarity index 97% rename from lib/Predis/Commands/ZSetAdd.php rename to lib/Predis/Command/ZSetAdd.php index e369bc58..09fac5a0 100644 --- a/lib/Predis/Commands/ZSetAdd.php +++ b/lib/Predis/Command/ZSetAdd.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; diff --git a/lib/Predis/Commands/ZSetCardinality.php b/lib/Predis/Command/ZSetCardinality.php similarity index 94% rename from lib/Predis/Commands/ZSetCardinality.php rename to lib/Predis/Command/ZSetCardinality.php index 3c746e82..4e4432e6 100644 --- a/lib/Predis/Commands/ZSetCardinality.php +++ b/lib/Predis/Command/ZSetCardinality.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zcard diff --git a/lib/Predis/Commands/ZSetCount.php b/lib/Predis/Command/ZSetCount.php similarity index 94% rename from lib/Predis/Commands/ZSetCount.php rename to lib/Predis/Command/ZSetCount.php index 9eddfa2e..2d8aa9ca 100644 --- a/lib/Predis/Commands/ZSetCount.php +++ b/lib/Predis/Command/ZSetCount.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zcount diff --git a/lib/Predis/Commands/ZSetIncrementBy.php b/lib/Predis/Command/ZSetIncrementBy.php similarity index 94% rename from lib/Predis/Commands/ZSetIncrementBy.php rename to lib/Predis/Command/ZSetIncrementBy.php index aee88cbc..a32bfabd 100644 --- a/lib/Predis/Commands/ZSetIncrementBy.php +++ b/lib/Predis/Command/ZSetIncrementBy.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zincrby diff --git a/lib/Predis/Commands/ZSetIntersectionStore.php b/lib/Predis/Command/ZSetIntersectionStore.php similarity index 94% rename from lib/Predis/Commands/ZSetIntersectionStore.php rename to lib/Predis/Command/ZSetIntersectionStore.php index 23afdb8f..9f6b1094 100644 --- a/lib/Predis/Commands/ZSetIntersectionStore.php +++ b/lib/Predis/Command/ZSetIntersectionStore.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zinterstore diff --git a/lib/Predis/Commands/ZSetRange.php b/lib/Predis/Command/ZSetRange.php similarity index 97% rename from lib/Predis/Commands/ZSetRange.php rename to lib/Predis/Command/ZSetRange.php index 2f288815..d2a4f79f 100644 --- a/lib/Predis/Commands/ZSetRange.php +++ b/lib/Predis/Command/ZSetRange.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; -use Predis\Iterators\MultiBulkResponseTuple; +use Predis\Iterator\MultiBulkResponseTuple; /** * @link http://redis.io/commands/zrange diff --git a/lib/Predis/Commands/ZSetRangeByScore.php b/lib/Predis/Command/ZSetRangeByScore.php similarity index 98% rename from lib/Predis/Commands/ZSetRangeByScore.php rename to lib/Predis/Command/ZSetRangeByScore.php index bb25c3dc..cfe73aab 100644 --- a/lib/Predis/Commands/ZSetRangeByScore.php +++ b/lib/Predis/Command/ZSetRangeByScore.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zrangebyscore diff --git a/lib/Predis/Commands/ZSetRank.php b/lib/Predis/Command/ZSetRank.php similarity index 94% rename from lib/Predis/Commands/ZSetRank.php rename to lib/Predis/Command/ZSetRank.php index ff9ca8cf..41c2ae2a 100644 --- a/lib/Predis/Commands/ZSetRank.php +++ b/lib/Predis/Command/ZSetRank.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zrank diff --git a/lib/Predis/Commands/ZSetRemove.php b/lib/Predis/Command/ZSetRemove.php similarity index 96% rename from lib/Predis/Commands/ZSetRemove.php rename to lib/Predis/Command/ZSetRemove.php index 2ebb71bd..0917df45 100644 --- a/lib/Predis/Commands/ZSetRemove.php +++ b/lib/Predis/Command/ZSetRemove.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use Predis\Helpers; diff --git a/lib/Predis/Commands/ZSetRemoveRangeByRank.php b/lib/Predis/Command/ZSetRemoveRangeByRank.php similarity index 95% rename from lib/Predis/Commands/ZSetRemoveRangeByRank.php rename to lib/Predis/Command/ZSetRemoveRangeByRank.php index dc832640..45b90284 100644 --- a/lib/Predis/Commands/ZSetRemoveRangeByRank.php +++ b/lib/Predis/Command/ZSetRemoveRangeByRank.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zremrangebyrank diff --git a/lib/Predis/Commands/ZSetRemoveRangeByScore.php b/lib/Predis/Command/ZSetRemoveRangeByScore.php similarity index 95% rename from lib/Predis/Commands/ZSetRemoveRangeByScore.php rename to lib/Predis/Command/ZSetRemoveRangeByScore.php index 7b682bc0..a2b3ad8d 100644 --- a/lib/Predis/Commands/ZSetRemoveRangeByScore.php +++ b/lib/Predis/Command/ZSetRemoveRangeByScore.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zremrangebyscore diff --git a/lib/Predis/Commands/ZSetReverseRange.php b/lib/Predis/Command/ZSetReverseRange.php similarity index 94% rename from lib/Predis/Commands/ZSetReverseRange.php rename to lib/Predis/Command/ZSetReverseRange.php index 0e4f4162..e7344e0a 100644 --- a/lib/Predis/Commands/ZSetReverseRange.php +++ b/lib/Predis/Command/ZSetReverseRange.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zrevrange diff --git a/lib/Predis/Commands/ZSetReverseRangeByScore.php b/lib/Predis/Command/ZSetReverseRangeByScore.php similarity index 95% rename from lib/Predis/Commands/ZSetReverseRangeByScore.php rename to lib/Predis/Command/ZSetReverseRangeByScore.php index 16376556..cded7c1c 100644 --- a/lib/Predis/Commands/ZSetReverseRangeByScore.php +++ b/lib/Predis/Command/ZSetReverseRangeByScore.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zrevrangebyscore diff --git a/lib/Predis/Commands/ZSetReverseRank.php b/lib/Predis/Command/ZSetReverseRank.php similarity index 94% rename from lib/Predis/Commands/ZSetReverseRank.php rename to lib/Predis/Command/ZSetReverseRank.php index 8a3fb44f..feb10487 100644 --- a/lib/Predis/Commands/ZSetReverseRank.php +++ b/lib/Predis/Command/ZSetReverseRank.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zrevrank diff --git a/lib/Predis/Commands/ZSetScore.php b/lib/Predis/Command/ZSetScore.php similarity index 94% rename from lib/Predis/Commands/ZSetScore.php rename to lib/Predis/Command/ZSetScore.php index 6d63ce05..8455e4ef 100644 --- a/lib/Predis/Commands/ZSetScore.php +++ b/lib/Predis/Command/ZSetScore.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zscore diff --git a/lib/Predis/Commands/ZSetUnionStore.php b/lib/Predis/Command/ZSetUnionStore.php similarity index 98% rename from lib/Predis/Commands/ZSetUnionStore.php rename to lib/Predis/Command/ZSetUnionStore.php index d4d7c872..cf400302 100644 --- a/lib/Predis/Commands/ZSetUnionStore.php +++ b/lib/Predis/Command/ZSetUnionStore.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; /** * @link http://redis.io/commands/zunionstore diff --git a/lib/Predis/CommunicationException.php b/lib/Predis/CommunicationException.php index 47c15c38..a491a9ca 100644 --- a/lib/Predis/CommunicationException.php +++ b/lib/Predis/CommunicationException.php @@ -11,7 +11,7 @@ namespace Predis; -use Predis\Network\IConnectionSingle; +use Predis\Connection\SingleConnectionInterface; /** * Base exception class for network-related errors. @@ -23,12 +23,12 @@ abstract class CommunicationException extends PredisException private $connection; /** - * @param IConnectionSingle $connection Connection that generated the exception. + * @param SingleConnectionInterface $connection Connection that generated the exception. * @param string $message Error message. * @param int $code Error code. * @param \Exception $innerException Inner exception for wrapping the original error. */ - public function __construct(IConnectionSingle $connection, + public function __construct(SingleConnectionInterface $connection, $message = null, $code = null, \Exception $innerException = null) { parent::__construct($message, $code, $innerException); @@ -39,7 +39,7 @@ abstract class CommunicationException extends PredisException /** * Gets the connection that generated the exception. * - * @return IConnectionSingle + * @return SingleConnectionInterface */ public function getConnection() { diff --git a/lib/Predis/Network/ConnectionBase.php b/lib/Predis/Connection/AbstractConnection.php similarity index 81% rename from lib/Predis/Network/ConnectionBase.php rename to lib/Predis/Connection/AbstractConnection.php index 441f8ca7..c0e65051 100644 --- a/lib/Predis/Network/ConnectionBase.php +++ b/lib/Predis/Connection/AbstractConnection.php @@ -9,14 +9,14 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; use Predis\Helpers; -use Predis\IReplyObject; -use Predis\IConnectionParameters; +use Predis\ResponseObjectInterface; +use Predis\ConnectionParametersInterface; use Predis\ClientException; use Predis\NotSupportedException; -use Predis\Commands\ICommand; +use Predis\Command\CommandInterface; use Predis\Protocol\ProtocolException; /** @@ -24,7 +24,7 @@ use Predis\Protocol\ProtocolException; * * @author Daniele Alessandri */ -abstract class ConnectionBase implements IConnectionSingle +abstract class AbstractConnection implements SingleConnectionInterface { private $resource; private $cachedId; @@ -33,9 +33,9 @@ abstract class ConnectionBase implements IConnectionSingle protected $initCmds; /** - * @param IConnectionParameters $parameters Parameters used to initialize the connection. + * @param ConnectionParametersInterface $parameters Parameters used to initialize the connection. */ - public function __construct(IConnectionParameters $parameters) + public function __construct(ConnectionParametersInterface $parameters) { $this->initCmds = array(); $this->parameters = $this->checkParameters($parameters); @@ -54,9 +54,9 @@ abstract class ConnectionBase implements IConnectionSingle /** * Checks some of the parameters used to initialize the connection. * - * @param IConnectionParameters $parameters Parameters used to initialize the connection. + * @param ConnectionParametersInterface $parameters Parameters used to initialize the connection. */ - protected function checkParameters(IConnectionParameters $parameters) + protected function checkParameters(ConnectionParametersInterface $parameters) { switch ($parameters->scheme) { case 'unix': @@ -76,9 +76,9 @@ abstract class ConnectionBase implements IConnectionSingle * Initializes some common configurations of the underlying protocol processor * from the connection parameters. * - * @param IConnectionParameters $parameters Parameters used to initialize the connection. + * @param ConnectionParametersInterface $parameters Parameters used to initialize the connection. */ - protected function initializeProtocol(IConnectionParameters $parameters) + protected function initializeProtocol(ConnectionParametersInterface $parameters) { // NOOP } @@ -120,7 +120,7 @@ abstract class ConnectionBase implements IConnectionSingle /** * {@inheritdoc} */ - public function pushInitCommand(ICommand $command) + public function pushInitCommand(CommandInterface $command) { $this->initCmds[] = $command; } @@ -128,7 +128,7 @@ abstract class ConnectionBase implements IConnectionSingle /** * {@inheritdoc} */ - public function executeCommand(ICommand $command) + public function executeCommand(CommandInterface $command) { $this->writeCommand($command); return $this->readResponse($command); @@ -137,11 +137,11 @@ abstract class ConnectionBase implements IConnectionSingle /** * {@inheritdoc} */ - public function readResponse(ICommand $command) + public function readResponse(CommandInterface $command) { $reply = $this->read(); - if ($reply instanceof IReplyObject) { + if ($reply instanceof ResponseObjectInterface) { return $reply; } @@ -173,7 +173,7 @@ abstract class ConnectionBase implements IConnectionSingle * Helper method to handle not supported connection parameters. * * @param string $option Name of the option. - * @param IConnectionParameters $parameters Parameters used to initialize the connection. + * @param mixed $parameters Parameters used to initialize the connection. */ protected function onInvalidOption($option, $parameters = null) { diff --git a/lib/Predis/Network/IConnectionCluster.php b/lib/Predis/Connection/ClusterConnectionInterface.php similarity index 60% rename from lib/Predis/Network/IConnectionCluster.php rename to lib/Predis/Connection/ClusterConnectionInterface.php index ea48621d..5f184aba 100644 --- a/lib/Predis/Network/IConnectionCluster.php +++ b/lib/Predis/Connection/ClusterConnectionInterface.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; -use Predis\Commands\ICommand; +use Predis\Command\CommandInterface; /** * Defines a cluster of Redis servers formed by aggregating multiple @@ -19,36 +19,36 @@ use Predis\Commands\ICommand; * * @author Daniele Alessandri */ -interface IConnectionCluster extends IConnection +interface ClusterConnectionInterface extends ConnectionInterface { /** * Adds a connection instance to the cluster. * - * @param IConnectionSingle $connection Instance of a connection. + * @param SingleConnectionInterface $connection Instance of a connection. */ - public function add(IConnectionSingle $connection); + public function add(SingleConnectionInterface $connection); /** * Removes the specified connection instance from the cluster. * - * @param IConnectionSingle $connection Instance of a connection. + * @param SingleConnectionInterface $connection Instance of a connection. * @return Boolean Returns true if the connection was in the pool. */ - public function remove(IConnectionSingle $connection); + public function remove(SingleConnectionInterface $connection); /** * Gets the actual connection instance in charge of the specified command. * - * @param ICommand $command Instance of a Redis command. - * @return IConnectionSingle + * @param CommandInterface $command Instance of a Redis command. + * @return SingleConnectionInterface */ - public function getConnection(ICommand $command); + public function getConnection(CommandInterface $command); /** * Retrieves a connection instance from the cluster using an alias. * * @param string $connectionId Alias of a connection - * @return IConnectionSingle + * @return SingleConnectionInterface */ public function getConnectionById($connectionId); } diff --git a/lib/Predis/Network/IConnectionComposable.php b/lib/Predis/Connection/ComposableConnectionInterface.php similarity index 80% rename from lib/Predis/Network/IConnectionComposable.php rename to lib/Predis/Connection/ComposableConnectionInterface.php index f41945f1..8b63536d 100644 --- a/lib/Predis/Network/IConnectionComposable.php +++ b/lib/Predis/Connection/ComposableConnectionInterface.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; -use Predis\Protocol\IProtocolProcessor; +use Predis\Protocol\ProtocolInterface; /** * Defines a connection object used to communicate with a single Redis server @@ -20,14 +20,14 @@ use Predis\Protocol\IProtocolProcessor; * * @author Daniele Alessandri */ -interface IConnectionComposable extends IConnectionSingle +interface ComposableConnectionInterface extends SingleConnectionInterface { /** * Sets the protocol processor used by the connection. * - * @param IProtocolProcessor $protocol Protocol processor. + * @param ProtocolInterface $protocol Protocol processor. */ - public function setProtocol(IProtocolProcessor $protocol); + public function setProtocol(ProtocolInterface $protocol); /** * Gets the protocol processor used by the connection. diff --git a/lib/Predis/Network/ComposableStreamConnection.php b/lib/Predis/Connection/ComposableStreamConnection.php similarity index 81% rename from lib/Predis/Network/ComposableStreamConnection.php rename to lib/Predis/Connection/ComposableStreamConnection.php index 696bc627..c0fe9790 100644 --- a/lib/Predis/Network/ComposableStreamConnection.php +++ b/lib/Predis/Connection/ComposableStreamConnection.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; -use Predis\IConnectionParameters; -use Predis\Commands\ICommand; -use Predis\Protocol\IProtocolProcessor; +use Predis\ConnectionParametersInterface; +use Predis\Command\CommandInterface; +use Predis\Protocol\ProtocolInterface; use Predis\Protocol\Text\TextProtocol; /** @@ -22,15 +22,15 @@ use Predis\Protocol\Text\TextProtocol; * * @author Daniele Alessandri */ -class ComposableStreamConnection extends StreamConnection implements IConnectionComposable +class ComposableStreamConnection extends StreamConnection implements ComposableConnectionInterface { private $protocol; /** - * @param IConnectionParameters $parameters Parameters used to initialize the connection. - * @param IProtocolProcessor $protocol A protocol processor. + * @param ConnectionParametersInterface $parameters Parameters used to initialize the connection. + * @param ProtocolInterface $protocol A protocol processor. */ - public function __construct(IConnectionParameters $parameters, IProtocolProcessor $protocol = null) + public function __construct(ConnectionParametersInterface $parameters, ProtocolInterface $protocol = null) { $this->setProtocol($protocol ?: new TextProtocol()); @@ -40,7 +40,7 @@ class ComposableStreamConnection extends StreamConnection implements IConnection /** * {@inheritdoc} */ - protected function initializeProtocol(IConnectionParameters $parameters) + protected function initializeProtocol(ConnectionParametersInterface $parameters) { $this->protocol->setOption('throw_errors', $parameters->throw_errors); $this->protocol->setOption('iterable_multibulk', $parameters->iterable_multibulk); @@ -49,7 +49,7 @@ class ComposableStreamConnection extends StreamConnection implements IConnection /** * {@inheritdoc} */ - public function setProtocol(IProtocolProcessor $protocol) + public function setProtocol(ProtocolInterface $protocol) { if ($protocol === null) { throw new \InvalidArgumentException("The protocol instance cannot be a null value"); @@ -120,7 +120,7 @@ class ComposableStreamConnection extends StreamConnection implements IConnection /** * {@inheritdoc} */ - public function writeCommand(ICommand $command) + public function writeCommand(CommandInterface $command) { $this->protocol->write($this, $command); } diff --git a/lib/Predis/Network/ConnectionException.php b/lib/Predis/Connection/ConnectionException.php similarity index 94% rename from lib/Predis/Network/ConnectionException.php rename to lib/Predis/Connection/ConnectionException.php index b85970e0..ef2e9d73 100644 --- a/lib/Predis/Network/ConnectionException.php +++ b/lib/Predis/Connection/ConnectionException.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; use Predis\CommunicationException; diff --git a/lib/Predis/Network/IConnection.php b/lib/Predis/Connection/ConnectionInterface.php similarity index 66% rename from lib/Predis/Network/IConnection.php rename to lib/Predis/Connection/ConnectionInterface.php index 212378aa..b30de09f 100644 --- a/lib/Predis/Network/IConnection.php +++ b/lib/Predis/Connection/ConnectionInterface.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; -use Predis\Commands\ICommand; +use Predis\Command\CommandInterface; /** * Defines a connection object used to communicate with one or multiple @@ -19,7 +19,7 @@ use Predis\Commands\ICommand; * * @author Daniele Alessandri */ -interface IConnection +interface ConnectionInterface { /** * Opens the connection. @@ -41,23 +41,23 @@ interface IConnection /** * Write a Redis command on the connection. * - * @param ICommand $command Instance of a Redis command. + * @param CommandInterface $command Instance of a Redis command. */ - public function writeCommand(ICommand $command); + public function writeCommand(CommandInterface $command); /** * Reads the reply for a Redis command from the connection. * - * @param ICommand $command Instance of a Redis command. + * @param CommandInterface $command Instance of a Redis command. * @return mixed */ - public function readResponse(ICommand $command); + public function readResponse(CommandInterface $command); /** * Writes a Redis command to the connection and reads back the reply. * - * @param ICommand $command Instance of a Redis command. + * @param CommandInterface $command Instance of a Redis command. * @return mixed */ - public function executeCommand(ICommand $command); + public function executeCommand(CommandInterface $command); } diff --git a/lib/Predis/Network/MasterSlaveReplication.php b/lib/Predis/Connection/MasterSlaveReplication.php similarity index 92% rename from lib/Predis/Network/MasterSlaveReplication.php rename to lib/Predis/Connection/MasterSlaveReplication.php index 91bab9b1..474850a8 100644 --- a/lib/Predis/Network/MasterSlaveReplication.php +++ b/lib/Predis/Connection/MasterSlaveReplication.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; -use Predis\Commands\ICommand; +use Predis\Command\CommandInterface; use Predis\NotSupportedException; /** @@ -21,7 +21,7 @@ use Predis\NotSupportedException; * * @author Daniele Alessandri */ -class MasterSlaveReplication implements IConnectionReplication +class MasterSlaveReplication implements ReplicationConnectionInterface { private $disallowed = array(); private $readonly = array(); @@ -60,7 +60,7 @@ class MasterSlaveReplication implements IConnectionReplication /** * {@inheritdoc} */ - public function add(IConnectionSingle $connection) + public function add(SingleConnectionInterface $connection) { $alias = $connection->getParameters()->alias; @@ -77,7 +77,7 @@ class MasterSlaveReplication implements IConnectionReplication /** * {@inheritdoc} */ - public function remove(IConnectionSingle $connection) + public function remove(SingleConnectionInterface $connection) { if ($connection->getParameters()->alias === 'master') { $this->master = null; @@ -100,7 +100,7 @@ class MasterSlaveReplication implements IConnectionReplication /** * {@inheritdoc} */ - public function getConnection(ICommand $command) + public function getConnection(CommandInterface $command) { if ($this->current === null) { $this->check(); @@ -142,7 +142,7 @@ class MasterSlaveReplication implements IConnectionReplication { $this->check(); - if (!$connection instanceof IConnectionSingle) { + if (!$connection instanceof SingleConnectionInterface) { $connection = $this->getConnectionById($connection); } if ($connection !== $this->master && !in_array($connection, $this->slaves, true)) { @@ -179,7 +179,7 @@ class MasterSlaveReplication implements IConnectionReplication /** * Returns a random slave. * - * @return IConnectionSingle + * @return SingleConnectionInterface */ protected function pickSlave() { @@ -223,7 +223,7 @@ class MasterSlaveReplication implements IConnectionReplication /** * {@inheritdoc} */ - public function writeCommand(ICommand $command) + public function writeCommand(CommandInterface $command) { $this->getConnection($command)->writeCommand($command); } @@ -231,7 +231,7 @@ class MasterSlaveReplication implements IConnectionReplication /** * {@inheritdoc} */ - public function readResponse(ICommand $command) + public function readResponse(CommandInterface $command) { return $this->getConnection($command)->readResponse($command); } @@ -239,7 +239,7 @@ class MasterSlaveReplication implements IConnectionReplication /** * {@inheritdoc} */ - public function executeCommand(ICommand $command) + public function executeCommand(CommandInterface $command) { return $this->getConnection($command)->executeCommand($command); } @@ -248,10 +248,10 @@ class MasterSlaveReplication implements IConnectionReplication * Returns if the specified command performs a read-only operation * against a key stored on Redis. * - * @param ICommand $command Instance of Redis command. + * @param CommandInterface $command Instance of Redis command. * @return Boolean */ - protected function isReadOperation(ICommand $command) + protected function isReadOperation(CommandInterface $command) { if (isset($this->disallowed[$id = $command->getId()])) { throw new NotSupportedException("The command $id is not allowed in replication mode"); @@ -284,10 +284,10 @@ class MasterSlaveReplication implements IConnectionReplication * Checks if a SORT command is a readable operation by parsing the arguments * array of the specified commad instance. * - * @param ICommand $command Instance of Redis command. + * @param CommandInterface $command Instance of Redis command. * @return Boolean */ - private function isSortReadOnly(ICommand $command) + private function isSortReadOnly(CommandInterface $command) { $arguments = $command->getArguments(); return ($c = count($arguments)) === 1 ? true : $arguments[$c - 2] !== 'STORE'; diff --git a/lib/Predis/Network/PhpiredisConnection.php b/lib/Predis/Connection/PhpiredisConnection.php similarity index 90% rename from lib/Predis/Network/PhpiredisConnection.php rename to lib/Predis/Connection/PhpiredisConnection.php index a23c850a..6bb634c7 100644 --- a/lib/Predis/Network/PhpiredisConnection.php +++ b/lib/Predis/Connection/PhpiredisConnection.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; -use Predis\Commands\ICommand; -use Predis\IConnectionParameters; +use Predis\Command\CommandInterface; +use Predis\ConnectionParametersInterface; use Predis\ResponseError; use Predis\ResponseQueued; use Predis\ClientException; @@ -38,14 +38,14 @@ use Predis\NotSupportedException; * @link http://github.com/seppo0010/phpiredis * @author Daniele Alessandri */ -class PhpiredisConnection extends ConnectionBase +class PhpiredisConnection extends AbstractConnection { private $reader; /** * {@inheritdoc} */ - public function __construct(IConnectionParameters $parameters) + public function __construct(ConnectionParametersInterface $parameters) { if (!function_exists('socket_create')) { throw new NotSupportedException( @@ -71,7 +71,7 @@ class PhpiredisConnection extends ConnectionBase /** * {@inheritdoc} */ - protected function checkParameters(IConnectionParameters $parameters) + protected function checkParameters(ConnectionParametersInterface $parameters) { if ($parameters->isSetByUser('iterable_multibulk')) { $this->onInvalidOption('iterable_multibulk', $parameters); @@ -108,7 +108,7 @@ class PhpiredisConnection extends ConnectionBase /** * {@inheritdoc} */ - protected function initializeProtocol(IConnectionParameters $parameters) + protected function initializeProtocol(ConnectionParametersInterface $parameters) { $this->initializeReader($parameters->throw_errors); } @@ -191,9 +191,9 @@ class PhpiredisConnection extends ConnectionBase * Sets options on the socket resource from the connection parameters. * * @param resource $socket Socket resource. - * @param IConnectionParameters $parameters Parameters used to initialize the connection. + * @param ConnectionParametersInterface $parameters Parameters used to initialize the connection. */ - private function setSocketOptions($socket, IConnectionParameters $parameters) + private function setSocketOptions($socket, ConnectionParametersInterface $parameters) { if ($parameters->scheme !== 'tcp') { return; @@ -230,10 +230,10 @@ class PhpiredisConnection extends ConnectionBase /** * Gets the address from the connection parameters. * - * @param IConnectionParameters $parameters Parameters used to initialize the connection. + * @param ConnectionParametersInterface $parameters Parameters used to initialize the connection. * @return string */ - private function getAddress(IConnectionParameters $parameters) + private function getAddress(ConnectionParametersInterface $parameters) { if ($parameters->scheme === 'unix') { return $parameters->path; @@ -254,10 +254,10 @@ class PhpiredisConnection extends ConnectionBase /** * Opens the actual connection to the server with a timeout. * - * @param IConnectionParameters $parameters Parameters used to initialize the connection. + * @param ConnectionParametersInterface $parameters Parameters used to initialize the connection. * @return string */ - private function connectWithTimeout(IConnectionParameters $parameters) { + private function connectWithTimeout(ConnectionParametersInterface $parameters) { $host = self::getAddress($parameters); $socket = $this->getResource(); @@ -378,7 +378,7 @@ class PhpiredisConnection extends ConnectionBase /** * {@inheritdoc} */ - public function writeCommand(ICommand $command) + public function writeCommand(CommandInterface $command) { $cmdargs = $command->getArguments(); array_unshift($cmdargs, $command->getId()); diff --git a/lib/Predis/Network/PredisCluster.php b/lib/Predis/Connection/PredisCluster.php similarity index 82% rename from lib/Predis/Network/PredisCluster.php rename to lib/Predis/Connection/PredisCluster.php index 7d8e8eec..81d65939 100644 --- a/lib/Predis/Network/PredisCluster.php +++ b/lib/Predis/Connection/PredisCluster.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; -use Predis\Commands\ICommand; -use Predis\Distribution\IDistributionStrategy; +use Predis\Command\CommandInterface; +use Predis\Distribution\DistributionStrategyInterface; use Predis\Helpers; use Predis\ClientException; use Predis\NotSupportedException; @@ -25,15 +25,15 @@ use Predis\Distribution\HashRing; * @author Daniele Alessandri * @todo Add the ability to remove connections from pool. */ -class PredisCluster implements IConnectionCluster, \IteratorAggregate, \Countable +class PredisCluster implements ClusterConnectionInterface, \IteratorAggregate, \Countable { private $pool; private $distributor; /** - * @param IDistributionStrategy $distributor Distribution strategy used by the cluster. + * @param DistributionStrategyInterface $distributor Distribution strategy used by the cluster. */ - public function __construct(IDistributionStrategy $distributor = null) + public function __construct(DistributionStrategyInterface $distributor = null) { $this->pool = array(); $this->distributor = $distributor ?: new HashRing(); @@ -76,7 +76,7 @@ class PredisCluster implements IConnectionCluster, \IteratorAggregate, \Countabl /** * {@inheritdoc} */ - public function add(IConnectionSingle $connection) + public function add(SingleConnectionInterface $connection) { $parameters = $connection->getParameters(); @@ -94,7 +94,7 @@ class PredisCluster implements IConnectionCluster, \IteratorAggregate, \Countabl /** * {@inheritdoc} */ - public function remove(IConnectionSingle $connection) + public function remove(SingleConnectionInterface $connection) { if (($id = array_search($connection, $this->pool, true)) !== false) { unset($this->pool[$id]); @@ -124,7 +124,7 @@ class PredisCluster implements IConnectionCluster, \IteratorAggregate, \Countabl /** * {@inheritdoc} */ - public function getConnection(ICommand $command) + public function getConnection(CommandInterface $command) { $cmdHash = $command->getHash($this->distributor); @@ -151,12 +151,12 @@ class PredisCluster implements IConnectionCluster, \IteratorAggregate, \Countabl * Retrieves a connection instance from the cluster using a key. * * @param string $key Key of a Redis value. - * @return IConnectionSingle + * @return SingleConnectionInterface */ public function getConnectionByKey($key) { $hashablePart = Helpers::extractKeyTag($key); - $keyHash = $this->distributor->generateKey($hashablePart); + $keyHash = $this->distributor->hash($hashablePart); return $this->distributor->get($keyHash); } @@ -180,7 +180,7 @@ class PredisCluster implements IConnectionCluster, \IteratorAggregate, \Countabl /** * {@inheritdoc} */ - public function writeCommand(ICommand $command) + public function writeCommand(CommandInterface $command) { $this->getConnection($command)->writeCommand($command); } @@ -188,7 +188,7 @@ class PredisCluster implements IConnectionCluster, \IteratorAggregate, \Countabl /** * {@inheritdoc} */ - public function readResponse(ICommand $command) + public function readResponse(CommandInterface $command) { return $this->getConnection($command)->readResponse($command); } @@ -196,7 +196,7 @@ class PredisCluster implements IConnectionCluster, \IteratorAggregate, \Countabl /** * {@inheritdoc} */ - public function executeCommand(ICommand $command) + public function executeCommand(CommandInterface $command) { return $this->getConnection($command)->executeCommand($command); } diff --git a/lib/Predis/Network/IConnectionReplication.php b/lib/Predis/Connection/ReplicationConnectionInterface.php similarity index 66% rename from lib/Predis/Network/IConnectionReplication.php rename to lib/Predis/Connection/ReplicationConnectionInterface.php index 9c97a854..0f8b91cd 100644 --- a/lib/Predis/Network/IConnectionReplication.php +++ b/lib/Predis/Connection/ReplicationConnectionInterface.php @@ -9,45 +9,45 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; -use Predis\Commands\ICommand; +use Predis\Command\CommandInterface; /** * Defines a group of Redis servers in a master/slave replication configuration. * * @author Daniele Alessandri */ -interface IConnectionReplication extends IConnection +interface ReplicationConnectionInterface extends ConnectionInterface { /** * Adds a connection instance to the cluster. * - * @param IConnectionSingle $connection Instance of a connection. + * @param SingleConnectionInterface $connection Instance of a connection. */ - public function add(IConnectionSingle $connection); + public function add(SingleConnectionInterface $connection); /** * Removes the specified connection instance from the cluster. * - * @param IConnectionSingle $connection Instance of a connection. + * @param SingleConnectionInterface $connection Instance of a connection. * @return Boolean Returns true if the connection was in the pool. */ - public function remove(IConnectionSingle $connection); + public function remove(SingleConnectionInterface $connection); /** * Gets the actual connection instance in charge of the specified command. * - * @param ICommand $command Instance of a Redis command. - * @return IConnectionSingle + * @param CommandInterface $command Instance of a Redis command. + * @return SingleConnectionInterface */ - public function getConnection(ICommand $command); + public function getConnection(CommandInterface $command); /** * Retrieves a connection instance from the cluster using an alias. * * @param string $connectionId Alias of a connection - * @return IConnectionSingle + * @return SingleConnectionInterface */ public function getConnectionById($connectionId); @@ -61,21 +61,21 @@ interface IConnectionReplication extends IConnection /** * Retrieves the connection object currently being used. * - * @return IConnectionSingle + * @return SingleConnectionInterface */ public function getCurrent(); /** * Retrieves the connection object to the master Redis server. * - * @return IConnectionSingle + * @return SingleConnectionInterface */ public function getMaster(); /** * Retrieves a list of connection objects to slaves Redis servers. * - * @return IConnectionSingle + * @return SingleConnectionInterface */ public function getSlaves(); } diff --git a/lib/Predis/Network/IConnectionSingle.php b/lib/Predis/Connection/SingleConnectionInterface.php similarity index 78% rename from lib/Predis/Network/IConnectionSingle.php rename to lib/Predis/Connection/SingleConnectionInterface.php index e5ba8392..9b080c2b 100644 --- a/lib/Predis/Network/IConnectionSingle.php +++ b/lib/Predis/Connection/SingleConnectionInterface.php @@ -9,16 +9,16 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; -use Predis\Commands\ICommand; +use Predis\Command\CommandInterface; /** * Defines a connection object used to communicate with a single Redis server. * * @author Daniele Alessandri */ -interface IConnectionSingle extends IConnection +interface SingleConnectionInterface extends ConnectionInterface { /** * Returns a string representation of the connection. @@ -37,7 +37,7 @@ interface IConnectionSingle extends IConnection /** * Gets the parameters used to initialize the connection object. * - * @return IConnectionParameters + * @return ConnectionParametersInterface */ public function getParameters(); @@ -45,10 +45,9 @@ interface IConnectionSingle extends IConnection * Pushes the instance of a Redis command to the queue of commands executed * when the actual connection to a server is estabilished. * - * @param ICommand $command Instance of a Redis command. - * @return IConnectionParameters + * @param CommandInterface $command Instance of a Redis command. */ - public function pushInitCommand(ICommand $command); + public function pushInitCommand(CommandInterface $command); /** * Reads a reply from the server. diff --git a/lib/Predis/Network/StreamConnection.php b/lib/Predis/Connection/StreamConnection.php similarity index 91% rename from lib/Predis/Network/StreamConnection.php rename to lib/Predis/Connection/StreamConnection.php index a2ac9f7e..ba0fcf30 100644 --- a/lib/Predis/Network/StreamConnection.php +++ b/lib/Predis/Connection/StreamConnection.php @@ -9,22 +9,22 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; use Predis\ResponseError; use Predis\ResponseQueued; use Predis\ServerException; use Predis\NotSupportedException; -use Predis\IConnectionParameters; -use Predis\Commands\ICommand; -use Predis\Iterators\MultiBulkResponseSimple; +use Predis\ConnectionParametersInterface; +use Predis\Command\CommandInterface; +use Predis\Iterator\MultiBulkResponseSimple; /** * Connection abstraction to Redis servers based on PHP's streams. * * @author Daniele Alessandri */ -class StreamConnection extends ConnectionBase +class StreamConnection extends AbstractConnection { private $mbiterable; private $throwErrors; @@ -44,7 +44,7 @@ class StreamConnection extends ConnectionBase /** * {@inheritdoc} */ - protected function initializeProtocol(IConnectionParameters $parameters) + protected function initializeProtocol(ConnectionParametersInterface $parameters) { $this->throwErrors = $parameters->throw_errors; $this->mbiterable = $parameters->iterable_multibulk; @@ -64,10 +64,10 @@ class StreamConnection extends ConnectionBase /** * Initializes a TCP stream resource. * - * @param IConnectionParameters $parameters Parameters used to initialize the connection. + * @param ConnectionParametersInterface $parameters Parameters used to initialize the connection. * @return resource */ - private function tcpStreamInitializer(IConnectionParameters $parameters) + private function tcpStreamInitializer(ConnectionParametersInterface $parameters) { $uri = "tcp://{$parameters->host}:{$parameters->port}/"; @@ -101,10 +101,10 @@ class StreamConnection extends ConnectionBase /** * Initializes a UNIX stream resource. * - * @param IConnectionParameters $parameters Parameters used to initialize the connection. + * @param ConnectionParametersInterface $parameters Parameters used to initialize the connection. * @return resource */ - private function unixStreamInitializer(IConnectionParameters $parameters) + private function unixStreamInitializer(ConnectionParametersInterface $parameters) { $uri = "unix://{$parameters->path}"; @@ -266,7 +266,7 @@ class StreamConnection extends ConnectionBase /** * {@inheritdoc} */ - public function writeCommand(ICommand $command) + public function writeCommand(CommandInterface $command) { $commandId = $command->getId(); $arguments = $command->getArguments(); diff --git a/lib/Predis/Network/WebdisConnection.php b/lib/Predis/Connection/WebdisConnection.php similarity index 86% rename from lib/Predis/Network/WebdisConnection.php rename to lib/Predis/Connection/WebdisConnection.php index c0e1f639..b82017b1 100644 --- a/lib/Predis/Network/WebdisConnection.php +++ b/lib/Predis/Connection/WebdisConnection.php @@ -9,15 +9,16 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; -use Predis\Commands\ICommand; -use Predis\IConnectionParameters; +use Predis\Command\CommandInterface; +use Predis\ResponseObjectInterface; +use Predis\ConnectionParametersInterface; use Predis\ResponseError; use Predis\ServerException; use Predis\NotSupportedException; use Predis\Protocol\ProtocolException; -use Predis\Network\ConnectionException; +use Predis\Connection\ConnectionException; const ERR_MSG_EXTENSION = 'The %s extension must be loaded in order to be able to use this connection class'; @@ -37,16 +38,16 @@ const ERR_MSG_EXTENSION = 'The %s extension must be loaded in order to be able t * @link http://github.com/seppo0010/phpiredis * @author Daniele Alessandri */ -class WebdisConnection implements IConnectionSingle +class WebdisConnection implements SingleConnectionInterface { private $parameters; private $resource; private $reader; /** - * @param IConnectionParameters $parameters Parameters used to initialize the connection. + * @param ConnectionParametersInterface $parameters Parameters used to initialize the connection. */ - public function __construct(IConnectionParameters $parameters) + public function __construct(ConnectionParametersInterface $parameters) { $this->parameters = $parameters; @@ -94,10 +95,10 @@ class WebdisConnection implements IConnectionSingle /** * Initializes cURL. * - * @param IConnectionParameters $parameters Parameters used to initialize the connection. + * @param ConnectionParametersInterface $parameters Parameters used to initialize the connection. * @return resource */ - private function initializeCurl(IConnectionParameters $parameters) + private function initializeCurl(ConnectionParametersInterface $parameters) { $options = array( CURLOPT_FAILONERROR => true, @@ -121,10 +122,10 @@ class WebdisConnection implements IConnectionSingle /** * Initializes phpiredis' protocol reader. * - * @param IConnectionParameters $parameters Parameters used to initialize the connection. + * @param ConnectionParametersInterface $parameters Parameters used to initialize the connection. * @return resource */ - private function initializeReader(IConnectionParameters $parameters) + private function initializeReader(ConnectionParametersInterface $parameters) { $reader = phpiredis_reader_create(); @@ -206,10 +207,10 @@ class WebdisConnection implements IConnectionSingle /** * Checks if the specified command is supported by this connection class. * - * @param ICommand $command The instance of a Redis command. + * @param CommandInterface $command The instance of a Redis command. * @return string */ - protected function getCommandId(ICommand $command) + protected function getCommandId(CommandInterface $command) { switch (($commandId = $command->getId())) { case 'AUTH': @@ -230,7 +231,7 @@ class WebdisConnection implements IConnectionSingle /** * {@inheritdoc} */ - public function writeCommand(ICommand $command) + public function writeCommand(CommandInterface $command) { $this->throwNotSupportedException(__FUNCTION__); } @@ -238,7 +239,7 @@ class WebdisConnection implements IConnectionSingle /** * {@inheritdoc} */ - public function readResponse(ICommand $command) + public function readResponse(CommandInterface $command) { $this->throwNotSupportedException(__FUNCTION__); } @@ -246,7 +247,7 @@ class WebdisConnection implements IConnectionSingle /** * {@inheritdoc} */ - public function executeCommand(ICommand $command) + public function executeCommand(CommandInterface $command) { $resource = $this->resource; $commandId = $this->getCommandId($command); @@ -271,7 +272,7 @@ class WebdisConnection implements IConnectionSingle if ($readerState === PHPIREDIS_READER_STATE_COMPLETE) { $reply = phpiredis_reader_get_reply($this->reader); - if ($reply instanceof IReplyObject) { + if ($reply instanceof ResponseObjectInterface) { return $reply; } return $command->parseResponse($reply); @@ -301,7 +302,7 @@ class WebdisConnection implements IConnectionSingle /** * {@inheritdoc} */ - public function pushInitCommand(ICommand $command) + public function pushInitCommand(CommandInterface $command) { $this->throwNotSupportedException(__FUNCTION__); } diff --git a/lib/Predis/ConnectionFactory.php b/lib/Predis/ConnectionFactory.php index 975df79e..b0ee1969 100644 --- a/lib/Predis/ConnectionFactory.php +++ b/lib/Predis/ConnectionFactory.php @@ -11,20 +11,19 @@ namespace Predis; -use Predis\Profiles\IServerProfile; -use Predis\Network\IConnectionSingle; -use Predis\Network\IConnectionCluster; -use Predis\Network\IConnectionReplication; -use Predis\Profiles\ServerProfile; +use Predis\Profile\ServerProfileInterface; +use Predis\Connection\SingleConnectionInterface; +use Predis\Connection\ClusterConnectionInterface; +use Predis\Connection\ReplicationConnectionInterface; +use Predis\Profile\ServerProfile; /** * Provides a default factory for Redis connections that maps URI schemes - * to connection classes implementing the Predis\Network\IConnectionSingle - * interface. + * to connection classes implementing Predis\Connection\SingleConnectionInterface. * * @author Daniele Alessandri */ -class ConnectionFactory implements IConnectionFactory +class ConnectionFactory implements ConnectionFactoryInterface { private $schemes; @@ -44,15 +43,15 @@ class ConnectionFactory implements IConnectionFactory protected function getDefaultSchemes() { return array( - 'tcp' => 'Predis\Network\StreamConnection', - 'unix' => 'Predis\Network\StreamConnection', - 'http' => 'Predis\Network\WebdisConnection', + 'tcp' => 'Predis\Connection\StreamConnection', + 'unix' => 'Predis\Connection\StreamConnection', + 'http' => 'Predis\Connection\WebdisConnection', ); } /** * Checks if the provided argument represents a valid connection class - * implementing the Predis\Network\IConnectionSingle interface. Optionally, + * implementing Predis\Connection\SingleConnectionInterface. Optionally, * callable objects are used for lazy initialization of connection objects. * * @param mixed $initializer FQN of a connection class or a callable for lazy initialization. @@ -66,7 +65,7 @@ class ConnectionFactory implements IConnectionFactory $initializerReflection = new \ReflectionClass($initializer); - if (!$initializerReflection->isSubclassOf('Predis\Network\IConnectionSingle')) { + if (!$initializerReflection->isSubclassOf('Predis\Connection\SingleConnectionInterface')) { throw new \InvalidArgumentException( 'A connection initializer must be a valid connection class or a callable object' ); @@ -94,9 +93,9 @@ class ConnectionFactory implements IConnectionFactory /** * {@inheritdoc} */ - public function create($parameters, IServerProfile $profile = null) + public function create($parameters, ServerProfileInterface $profile = null) { - if (!$parameters instanceof IConnectionParameters) { + if (!$parameters instanceof ConnectionParametersInterface) { $parameters = new ConnectionParameters($parameters ?: array()); } @@ -114,10 +113,10 @@ class ConnectionFactory implements IConnectionFactory } $connection = call_user_func($initializer, $parameters, $profile); - if (!$connection instanceof IConnectionSingle) { + if (!$connection instanceof SingleConnectionInterface) { throw new \InvalidArgumentException( 'Objects returned by connection initializers must implement ' . - 'the Predis\Network\IConnectionSingle interface' + 'Predis\Connection\SingleConnectionInterface' ); } @@ -127,10 +126,10 @@ class ConnectionFactory implements IConnectionFactory /** * {@inheritdoc} */ - public function createCluster(IConnectionCluster $cluster, $parameters, IServerProfile $profile = null) + public function createCluster(ClusterConnectionInterface $cluster, $parameters, ServerProfileInterface $profile = null) { foreach ($parameters as $node) { - $cluster->add($node instanceof IConnectionSingle ? $node : $this->create($node, $profile)); + $cluster->add($node instanceof SingleConnectionInterface ? $node : $this->create($node, $profile)); } return $cluster; @@ -139,10 +138,10 @@ class ConnectionFactory implements IConnectionFactory /** * {@inheritdoc} */ - public function createReplication(IConnectionReplication $replication, $parameters, IServerProfile $profile = null) + public function createReplication(ReplicationConnectionInterface $replication, $parameters, ServerProfileInterface $profile = null) { foreach ($parameters as $node) { - $replication->add($node instanceof IConnectionSingle ? $node : $this->create($node, $profile)); + $replication->add($node instanceof SingleConnectionInterface ? $node : $this->create($node, $profile)); } return $replication; @@ -151,10 +150,10 @@ class ConnectionFactory implements IConnectionFactory /** * Prepares a connection object after its initialization. * - * @param IConnectionSingle $connection Instance of a connection object. - * @param IServerProfile $profile $connection Instance of a connection object. + * @param SingleConnectionInterface $connection Instance of a connection object. + * @param ServerProfileInterface $profile $connection Instance of a connection object. */ - protected function prepareConnection(IConnectionSingle $connection, IServerProfile $profile) + protected function prepareConnection(SingleConnectionInterface $connection, ServerProfileInterface $profile) { $parameters = $connection->getParameters(); diff --git a/lib/Predis/IConnectionFactory.php b/lib/Predis/ConnectionFactoryInterface.php similarity index 59% rename from lib/Predis/IConnectionFactory.php rename to lib/Predis/ConnectionFactoryInterface.php index 581510a4..80efead4 100644 --- a/lib/Predis/IConnectionFactory.php +++ b/lib/Predis/ConnectionFactoryInterface.php @@ -11,17 +11,17 @@ namespace Predis; -use Predis\Profiles\IServerProfile; -use Predis\Network\IConnectionCluster; -use Predis\Network\IConnectionReplication; +use Predis\Profile\ServerProfileInterface; +use Predis\Connection\ClusterConnectionInterface; +use Predis\Connection\ReplicationConnectionInterface; /** * Interface that must be implemented by classes that provide their own mechanism - * to create and initialize new instances of Predis\Network\IConnectionSingle. + * to create and initialize new instances of Predis\Connection\SingleConnectionInterface. * * @author Daniele Alessandri */ -interface IConnectionFactory +interface ConnectionFactoryInterface { /** * Defines or overrides the connection class identified by a scheme prefix. @@ -42,25 +42,25 @@ interface IConnectionFactory * Creates a new connection object. * * @param mixed $parameters Parameters for the connection. - * @return Predis\Network\IConnectionSingle + * @return Predis\Connection\SingleConnectionInterface */ - public function create($parameters, IServerProfile $profile = null); + public function create($parameters, ServerProfileInterface $profile = null); /** * Prepares a cluster of connection objects. * - * @param IConnectionCluster Instance of a connection cluster class. + * @param ClusterConnectionInterface Instance of a connection cluster class. * @param array $parameters List of parameters for each connection object. - * @return Predis\Network\IConnectionCluster + * @return Predis\Connection\ClusterConnectionInterface */ - public function createCluster(IConnectionCluster $cluster, $parameters, IServerProfile $profile = null); + public function createCluster(ClusterConnectionInterface $cluster, $parameters, ServerProfileInterface $profile = null); /** * Prepares a master / slave replication configuration. * - * @param IConnectionReplication Instance of a connection cluster class. + * @param ReplicationConnectionInterface Instance of a connection cluster class. * @param array $parameters List of parameters for each connection object. - * @return Predis\Network\IConnectionReplication + * @return Predis\Connection\ReplicationConnectionInterface */ - public function createReplication(IConnectionReplication $replication, $parameters, IServerProfile $profile = null); + public function createReplication(ReplicationConnectionInterface $replication, $parameters, ServerProfileInterface $profile = null); } diff --git a/lib/Predis/ConnectionParameters.php b/lib/Predis/ConnectionParameters.php index 230c3837..c0e2187c 100644 --- a/lib/Predis/ConnectionParameters.php +++ b/lib/Predis/ConnectionParameters.php @@ -11,15 +11,14 @@ namespace Predis; -use Predis\IConnectionParameters; -use Predis\Options\IOption; +use Predis\Option\OptionInterface; /** * Handles parsing and validation of connection parameters. * * @author Daniele Alessandri */ -class ConnectionParameters implements IConnectionParameters +class ConnectionParameters implements ConnectionParametersInterface { private static $defaultParameters; private static $validators; @@ -87,7 +86,7 @@ class ConnectionParameters implements IConnectionParameters * Defines a default value and a validator for the specified parameter. * * @param string $parameter Name of the parameter. - * @param mixed $default Default value or an instance of IOption. + * @param mixed $default Default value or an instance of OptionInterface. * @param mixed $callable A validator callback. */ public static function define($parameter, $default, $callable = null) @@ -95,7 +94,7 @@ class ConnectionParameters implements IConnectionParameters self::ensureDefaults(); self::$defaultParameters[$parameter] = $default; - if ($default instanceof IOption) { + if ($default instanceof OptionInterface) { self::$validators[$parameter] = $default; return; } @@ -178,7 +177,7 @@ class ConnectionParameters implements IConnectionParameters { $value = $this->parameters[$parameter]; - if ($value instanceof IOption) { + if ($value instanceof OptionInterface) { $this->parameters[$parameter] = ($value = $value->getDefault()); } diff --git a/lib/Predis/IConnectionParameters.php b/lib/Predis/ConnectionParametersInterface.php similarity index 96% rename from lib/Predis/IConnectionParameters.php rename to lib/Predis/ConnectionParametersInterface.php index d215c778..a6d8818c 100644 --- a/lib/Predis/IConnectionParameters.php +++ b/lib/Predis/ConnectionParametersInterface.php @@ -17,7 +17,7 @@ namespace Predis; * * @author Daniele Alessandri */ -interface IConnectionParameters +interface ConnectionParametersInterface { /** * Checks if the specified parameters is set. diff --git a/lib/Predis/Distribution/IDistributionStrategy.php b/lib/Predis/Distribution/DistributionStrategyInterface.php similarity index 93% rename from lib/Predis/Distribution/IDistributionStrategy.php rename to lib/Predis/Distribution/DistributionStrategyInterface.php index 42b97350..d4553b73 100644 --- a/lib/Predis/Distribution/IDistributionStrategy.php +++ b/lib/Predis/Distribution/DistributionStrategyInterface.php @@ -17,7 +17,7 @@ namespace Predis\Distribution; * * @author Daniele Alessandri */ -interface IDistributionStrategy extends INodeKeyGenerator +interface DistributionStrategyInterface extends HashGeneratorInterface { /** * Adds a node to the distributor with an optional weight. diff --git a/lib/Predis/Distribution/INodeKeyGenerator.php b/lib/Predis/Distribution/HashGeneratorInterface.php similarity index 90% rename from lib/Predis/Distribution/INodeKeyGenerator.php rename to lib/Predis/Distribution/HashGeneratorInterface.php index 690bb39a..0695512d 100644 --- a/lib/Predis/Distribution/INodeKeyGenerator.php +++ b/lib/Predis/Distribution/HashGeneratorInterface.php @@ -17,7 +17,7 @@ namespace Predis\Distribution; * * @author Daniele Alessandri */ -interface INodeKeyGenerator +interface HashGeneratorInterface { /** * Generates an hash that is used by the distributor algorithm @@ -25,5 +25,5 @@ interface INodeKeyGenerator * @param string $value Value used to generate the hash. * @return int */ - public function generateKey($value); + public function hash($value); } diff --git a/lib/Predis/Distribution/HashRing.php b/lib/Predis/Distribution/HashRing.php index 12eff18e..a72f51b8 100644 --- a/lib/Predis/Distribution/HashRing.php +++ b/lib/Predis/Distribution/HashRing.php @@ -19,7 +19,7 @@ namespace Predis\Distribution; * @author Daniele Alessandri * @author Lorenzo Castelli */ -class HashRing implements IDistributionStrategy +class HashRing implements DistributionStrategyInterface { const DEFAULT_REPLICAS = 128; const DEFAULT_WEIGHT = 100; @@ -170,7 +170,7 @@ class HashRing implements IDistributionStrategy * @param string $value Input value. * @return int */ - public function generateKey($value) + public function hash($value) { return crc32($value); } diff --git a/lib/Predis/Distribution/KetamaPureRing.php b/lib/Predis/Distribution/KetamaPureRing.php index 3868b4f9..3dbd2cd6 100644 --- a/lib/Predis/Distribution/KetamaPureRing.php +++ b/lib/Predis/Distribution/KetamaPureRing.php @@ -51,7 +51,7 @@ class KetamaPureRing extends HashRing /** * {@inheritdoc} */ - public function generateKey($value) + public function hash($value) { $hash = unpack('V', md5($value, true)); return $hash[1]; diff --git a/lib/Predis/Helpers.php b/lib/Predis/Helpers.php index 3038f129..b1b2b606 100644 --- a/lib/Predis/Helpers.php +++ b/lib/Predis/Helpers.php @@ -11,9 +11,9 @@ namespace Predis; -use Predis\Network\IConnection; -use Predis\Network\IConnectionCluster; -use Predis\Network\IConnectionReplication; +use Predis\Connection\ConnectionInterface; +use Predis\Connection\ClusterConnectionInterface; +use Predis\Connection\ReplicationConnectionInterface; /** * Defines a few helper methods. @@ -25,23 +25,23 @@ class Helpers /** * Checks if the specified connection represents an aggregation of connections. * - * @param IConnection $connection Connection object. + * @param ConnectionInterface $connection Connection object. * @return Boolean */ - public static function isAggregated(IConnection $connection) + public static function isAggregated(ConnectionInterface $connection) { - return $connection instanceof IConnectionCluster || $connection instanceof IConnectionReplication; + return $connection instanceof ClusterConnectionInterface || $connection instanceof ReplicationConnectionInterface; } /** * Checks if the specified connection represents a cluster. * - * @param IConnection $connection Connection object. + * @param ConnectionInterface $connection Connection object. * @return Boolean */ - public static function isCluster(IConnection $connection) + public static function isCluster(ConnectionInterface $connection) { - return $connection instanceof IConnectionCluster; + return $connection instanceof ClusterConnectionInterface; } /** diff --git a/lib/Predis/Iterators/MultiBulkResponse.php b/lib/Predis/Iterator/MultiBulkResponse.php similarity index 98% rename from lib/Predis/Iterators/MultiBulkResponse.php rename to lib/Predis/Iterator/MultiBulkResponse.php index 8ceb59b5..7c01a962 100644 --- a/lib/Predis/Iterators/MultiBulkResponse.php +++ b/lib/Predis/Iterator/MultiBulkResponse.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Iterators; +namespace Predis\Iterator; /** * Iterator that abstracts the access to multibulk replies and allows diff --git a/lib/Predis/Iterators/MultiBulkResponseSimple.php b/lib/Predis/Iterator/MultiBulkResponseSimple.php similarity index 89% rename from lib/Predis/Iterators/MultiBulkResponseSimple.php rename to lib/Predis/Iterator/MultiBulkResponseSimple.php index 4f37307c..c93d82ae 100644 --- a/lib/Predis/Iterators/MultiBulkResponseSimple.php +++ b/lib/Predis/Iterator/MultiBulkResponseSimple.php @@ -9,10 +9,9 @@ * file that was distributed with this source code. */ -namespace Predis\Iterators; +namespace Predis\Iterator; -use Predis\Network\IConnection; -use Predis\Network\IConnectionSingle; +use Predis\Connection\SingleConnectionInterface; /** * Streams a multibulk reply. @@ -24,10 +23,10 @@ class MultiBulkResponseSimple extends MultiBulkResponse private $connection; /** - * @param IConnectionSingle $connection Connection to Redis. + * @param SingleConnectionInterface $connection Connection to Redis. * @param int $size Number of elements of the multibulk reply. */ - public function __construct(IConnectionSingle $connection, $size) + public function __construct(SingleConnectionInterface $connection, $size) { $this->connection = $connection; $this->position = 0; diff --git a/lib/Predis/Iterators/MultiBulkResponseTuple.php b/lib/Predis/Iterator/MultiBulkResponseTuple.php similarity index 98% rename from lib/Predis/Iterators/MultiBulkResponseTuple.php rename to lib/Predis/Iterator/MultiBulkResponseTuple.php index 163669e9..da5a014e 100644 --- a/lib/Predis/Iterators/MultiBulkResponseTuple.php +++ b/lib/Predis/Iterator/MultiBulkResponseTuple.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Iterators; +namespace Predis\Iterator; /** * Abstracts the access to a streamable list of tuples represented diff --git a/lib/Predis/MonitorContext.php b/lib/Predis/Monitor/MonitorContext.php similarity index 97% rename from lib/Predis/MonitorContext.php rename to lib/Predis/Monitor/MonitorContext.php index 82af112e..dba2bfa3 100644 --- a/lib/Predis/MonitorContext.php +++ b/lib/Predis/Monitor/MonitorContext.php @@ -9,7 +9,11 @@ * file that was distributed with this source code. */ -namespace Predis; +namespace Predis\Monitor; + +use Predis\Client; +use Predis\Helpers; +use Predis\NotSupportedException; /** * Client-side abstraction of a Redis MONITOR context. diff --git a/lib/Predis/Options/Option.php b/lib/Predis/Option/AbstractOption.php similarity index 70% rename from lib/Predis/Options/Option.php rename to lib/Predis/Option/AbstractOption.php index 3ab85ccf..92506cd5 100644 --- a/lib/Predis/Options/Option.php +++ b/lib/Predis/Option/AbstractOption.php @@ -9,19 +9,19 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; /** * Implements a client option. * * @author Daniele Alessandri */ -class Option implements IOption +abstract class AbstractOption implements OptionInterface { /** * {@inheritdoc} */ - public function filter(IClientOptions $options, $value) + public function filter(ClientOptionsInterface $options, $value) { return $value; } @@ -29,7 +29,7 @@ class Option implements IOption /** * {@inheritdoc} */ - public function getDefault(IClientOptions $options) + public function getDefault(ClientOptionsInterface $options) { return null; } @@ -37,7 +37,7 @@ class Option implements IOption /** * {@inheritdoc} */ - public function __invoke(IClientOptions $options, $value) + public function __invoke(ClientOptionsInterface $options, $value) { if (isset($value)) { return $this->filter($options, $value); diff --git a/lib/Predis/Options/ClientCluster.php b/lib/Predis/Option/ClientCluster.php similarity index 66% rename from lib/Predis/Options/ClientCluster.php rename to lib/Predis/Option/ClientCluster.php index 09c51b3e..04a30679 100644 --- a/lib/Predis/Options/ClientCluster.php +++ b/lib/Predis/Option/ClientCluster.php @@ -9,28 +9,28 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; -use Predis\Network\IConnectionCluster; -use Predis\Network\PredisCluster; +use Predis\Connection\ClusterConnectionInterface; +use Predis\Connection\PredisCluster; /** * Option class that returns a connection cluster to be used by a client. * * @author Daniele Alessandri */ -class ClientCluster extends Option +class ClientCluster extends AbstractOption { /** - * Checks if the specified value is a valid instance of IConnectionCluster. + * Checks if the specified value is a valid instance of ClusterConnectionInterface. * - * @param IConnectionCluster $cluster Instance of a connection cluster. - * @return IConnectionCluster + * @param ClusterConnectionInterface $cluster Instance of a connection cluster. + * @return ClusterConnectionInterface */ protected function checkInstance($cluster) { - if (!$cluster instanceof IConnectionCluster) { - throw new \InvalidArgumentException('Instance of Predis\Network\IConnectionCluster expected'); + if (!$cluster instanceof ClusterConnectionInterface) { + throw new \InvalidArgumentException('Instance of Predis\Connection\ClusterConnectionInterface expected'); } return $cluster; @@ -39,7 +39,7 @@ class ClientCluster extends Option /** * {@inheritdoc} */ - public function filter(IClientOptions $options, $value) + public function filter(ClientOptionsInterface $options, $value) { if (is_callable($value)) { return $this->checkInstance(call_user_func($value, $options)); @@ -52,11 +52,11 @@ class ClientCluster extends Option /** * Returns an initializer for the specified FQN or type. * - * @param string $fqnOrType Type of cluster or FQN of a class implementing IConnectionCluster. - * @param IClientOptions $options Instance of the client options. + * @param string $fqnOrType Type of cluster or FQN of a class implementing ClusterConnectionInterface. + * @param ClientOptionsInterface $options Instance of the client options. * @return \Closure */ - protected function getInitializer(IClientOptions $options, $fqnOrType) + protected function getInitializer(ClientOptionsInterface $options, $fqnOrType) { switch ($fqnOrType) { case 'predis': @@ -76,7 +76,7 @@ class ClientCluster extends Option /** * {@inheritdoc} */ - public function getDefault(IClientOptions $options) + public function getDefault(ClientOptionsInterface $options) { return new PredisCluster(); } diff --git a/lib/Predis/Options/ClientConnectionFactory.php b/lib/Predis/Option/ClientConnectionFactory.php similarity index 74% rename from lib/Predis/Options/ClientConnectionFactory.php rename to lib/Predis/Option/ClientConnectionFactory.php index 737c0003..742b90fb 100644 --- a/lib/Predis/Options/ClientConnectionFactory.php +++ b/lib/Predis/Option/ClientConnectionFactory.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; -use Predis\IConnectionFactory; +use Predis\ConnectionFactoryInterface; use Predis\ConnectionFactory; /** @@ -19,14 +19,14 @@ use Predis\ConnectionFactory; * * @author Daniele Alessandri */ -class ClientConnectionFactory extends Option +class ClientConnectionFactory extends AbstractOption { /** * {@inheritdoc} */ - public function filter(IClientOptions $options, $value) + public function filter(ClientOptionsInterface $options, $value) { - if ($value instanceof IConnectionFactory) { + if ($value instanceof ConnectionFactoryInterface) { return $value; } if (is_array($value)) { @@ -37,8 +37,8 @@ class ClientConnectionFactory extends Option return $factory; } if (is_string($value) && class_exists($value)) { - if (!($factory = new $value()) && !$factory instanceof IConnectionFactory) { - throw new \InvalidArgumentException("Class $value must be an instance of Predis\IConnectionFactory"); + if (!($factory = new $value()) && !$factory instanceof ConnectionFactoryInterface) { + throw new \InvalidArgumentException("Class $value must be an instance of Predis\ConnectionFactoryInterface"); } return $factory; } @@ -49,7 +49,7 @@ class ClientConnectionFactory extends Option /** * {@inheritdoc} */ - public function getDefault(IClientOptions $options) + public function getDefault(ClientOptionsInterface $options) { return new ConnectionFactory(); } diff --git a/lib/Predis/Options/ClientOptions.php b/lib/Predis/Option/ClientOptions.php similarity index 93% rename from lib/Predis/Options/ClientOptions.php rename to lib/Predis/Option/ClientOptions.php index d95a9d2c..c04fe66f 100644 --- a/lib/Predis/Options/ClientOptions.php +++ b/lib/Predis/Option/ClientOptions.php @@ -9,14 +9,14 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; /** * Class that manages client options with filtering and conversion. * * @author Daniele Alessandri */ -class ClientOptions implements IClientOptions +class ClientOptions implements ClientOptionsInterface { private $handlers; private $defined; @@ -97,7 +97,7 @@ class ClientOptions implements IClientOptions if (isset($this->handlers[$option])) { $handler = $this->handlers[$option]; - $value = $handler instanceof IOption ? $handler->getDefault($this) : $handler($this); + $value = $handler instanceof OptionInterface ? $handler->getDefault($this) : $handler($this); $this->options[$option] = $value; return $value; diff --git a/lib/Predis/Options/IClientOptions.php b/lib/Predis/Option/ClientOptionsInterface.php similarity index 86% rename from lib/Predis/Options/IClientOptions.php rename to lib/Predis/Option/ClientOptionsInterface.php index ebbce433..543e18a7 100644 --- a/lib/Predis/Options/IClientOptions.php +++ b/lib/Predis/Option/ClientOptionsInterface.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; /** * Marker interface defining a client options bag. * * @author Daniele Alessandri */ -interface IClientOptions +interface ClientOptionsInterface { } diff --git a/lib/Predis/Options/ClientPrefix.php b/lib/Predis/Option/ClientPrefix.php similarity index 71% rename from lib/Predis/Options/ClientPrefix.php rename to lib/Predis/Option/ClientPrefix.php index c5b3e754..01a166a1 100644 --- a/lib/Predis/Options/ClientPrefix.php +++ b/lib/Predis/Option/ClientPrefix.php @@ -9,21 +9,21 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; -use Predis\Commands\Processors\KeyPrefixProcessor; +use Predis\Command\Processor\KeyPrefixProcessor; /** * Option class that handles the prefixing of keys in commands. * * @author Daniele Alessandri */ -class ClientPrefix extends Option +class ClientPrefix extends AbstractOption { /** * {@inheritdoc} */ - public function filter(IClientOptions $options, $value) + public function filter(ClientOptionsInterface $options, $value) { return new KeyPrefixProcessor($value); } diff --git a/lib/Predis/Options/ClientProfile.php b/lib/Predis/Option/ClientProfile.php similarity index 76% rename from lib/Predis/Options/ClientProfile.php rename to lib/Predis/Option/ClientProfile.php index 64ac2fc3..8eaebd13 100644 --- a/lib/Predis/Options/ClientProfile.php +++ b/lib/Predis/Option/ClientProfile.php @@ -9,22 +9,22 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; -use Predis\Profiles\ServerProfile; -use Predis\Profiles\IServerProfile; +use Predis\Profile\ServerProfile; +use Predis\Profile\ServerProfileInterface; /** * Option class that handles server profiles to be used by a client. * * @author Daniele Alessandri */ -class ClientProfile extends Option +class ClientProfile extends AbstractOption { /** * {@inheritdoc} */ - public function filter(IClientOptions $options, $value) + public function filter(ClientOptionsInterface $options, $value) { if (is_string($value)) { $value = ServerProfile::get($value); @@ -37,7 +37,7 @@ class ClientProfile extends Option $value = call_user_func($value, $options); } - if (!$value instanceof IServerProfile) { + if (!$value instanceof ServerProfileInterface) { throw new \InvalidArgumentException('Invalid value for the profile option'); } @@ -47,7 +47,7 @@ class ClientProfile extends Option /** * {@inheritdoc} */ - public function getDefault(IClientOptions $options) + public function getDefault(ClientOptionsInterface $options) { $profile = ServerProfile::getDefault(); if (isset($options->prefix)) { diff --git a/lib/Predis/Options/ClientReplication.php b/lib/Predis/Option/ClientReplication.php similarity index 57% rename from lib/Predis/Options/ClientReplication.php rename to lib/Predis/Option/ClientReplication.php index 0d5b6b3f..8ea49bc7 100644 --- a/lib/Predis/Options/ClientReplication.php +++ b/lib/Predis/Option/ClientReplication.php @@ -9,28 +9,28 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; -use Predis\Network\IConnectionReplication; -use Predis\Network\MasterSlaveReplication; +use Predis\Connection\ReplicationConnectionInterface; +use Predis\Connection\MasterSlaveReplication; /** * Option class that returns a replication connection be used by a client. * * @author Daniele Alessandri */ -class ClientReplication extends Option +class ClientReplication extends AbstractOption { /** - * Checks if the specified value is a valid instance of IConnectionReplication. + * Checks if the specified value is a valid instance of ReplicationConnectionInterface. * - * @param IConnectionReplication $cluster Instance of a connection cluster. - * @return IConnectionReplication + * @param ReplicationConnectionInterface $connection Instance of a replication connection. + * @return ReplicationConnectionInterface */ protected function checkInstance($connection) { - if (!$connection instanceof IConnectionReplication) { - throw new \InvalidArgumentException('Instance of Predis\Network\IConnectionReplication expected'); + if (!$connection instanceof ReplicationConnectionInterface) { + throw new \InvalidArgumentException('Instance of Predis\Connection\ReplicationConnectionInterface expected'); } return $connection; @@ -39,12 +39,12 @@ class ClientReplication extends Option /** * {@inheritdoc} */ - public function filter(IClientOptions $options, $value) + public function filter(ClientOptionsInterface $options, $value) { if (is_callable($value)) { $connection = call_user_func($value, $options); - if (!$connection instanceof IConnectionReplication) { - throw new \InvalidArgumentException('Instance of Predis\Network\IConnectionReplication expected'); + if (!$connection instanceof ReplicationConnectionInterface) { + throw new \InvalidArgumentException('Instance of Predis\Connection\ReplicationConnectionInterface expected'); } return $connection; } @@ -53,8 +53,8 @@ class ClientReplication extends Option if (!class_exists($value)) { throw new \InvalidArgumentException("Class $value does not exist"); } - if (!($connection = new $value()) instanceof IConnectionReplication) { - throw new \InvalidArgumentException('Instance of Predis\Network\IConnectionReplication expected'); + if (!($connection = new $value()) instanceof ReplicationConnectionInterface) { + throw new \InvalidArgumentException('Instance of Predis\Connection\ReplicationConnectionInterface expected'); } return $connection; } @@ -67,7 +67,7 @@ class ClientReplication extends Option /** * {@inheritdoc} */ - public function getDefault(IClientOptions $options) + public function getDefault(ClientOptionsInterface $options) { return new MasterSlaveReplication(); } diff --git a/lib/Predis/Options/CustomOption.php b/lib/Predis/Option/CustomOption.php similarity index 87% rename from lib/Predis/Options/CustomOption.php rename to lib/Predis/Option/CustomOption.php index 6070aa6f..dac29f39 100644 --- a/lib/Predis/Options/CustomOption.php +++ b/lib/Predis/Option/CustomOption.php @@ -9,14 +9,14 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; /** * Implements a generic class used to dinamically define a client option. * * @author Daniele Alessandri */ -class CustomOption implements IOption +class CustomOption implements OptionInterface { private $filter; private $default; @@ -53,7 +53,7 @@ class CustomOption implements IOption /** * {@inheritdoc} */ - public function filter(IClientOptions $options, $value) + public function filter(ClientOptionsInterface $options, $value) { if (isset($value)) { if ($this->filter === null) { @@ -68,7 +68,7 @@ class CustomOption implements IOption /** * {@inheritdoc} */ - public function getDefault(IClientOptions $options) + public function getDefault(ClientOptionsInterface $options) { if (!isset($this->default)) { return; @@ -81,7 +81,7 @@ class CustomOption implements IOption /** * {@inheritdoc} */ - public function __invoke(IClientOptions $options, $value) + public function __invoke(ClientOptionsInterface $options, $value) { if (isset($value)) { return $this->filter($options, $value); diff --git a/lib/Predis/Options/IOption.php b/lib/Predis/Option/OptionInterface.php similarity index 76% rename from lib/Predis/Options/IOption.php rename to lib/Predis/Option/OptionInterface.php index be235820..415b8c1b 100644 --- a/lib/Predis/Options/IOption.php +++ b/lib/Predis/Option/OptionInterface.php @@ -9,14 +9,14 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; /** * Interface that defines a client option. * * @author Daniele Alessandri */ -interface IOption +interface OptionInterface { /** * Filters (and optionally converts) the passed value. @@ -24,7 +24,7 @@ interface IOption * @param mixed $value Input value. * @return mixed */ - public function filter(IClientOptions $options, $value); + public function filter(ClientOptionsInterface $options, $value); /** * Returns a default value for the option. @@ -32,7 +32,7 @@ interface IOption * @param mixed $value Input value. * @return mixed */ - public function getDefault(IClientOptions $options); + public function getDefault(ClientOptionsInterface $options); /** * Filters a value and, if no value is specified, returns @@ -41,5 +41,5 @@ interface IOption * @param mixed $value Input value. * @return mixed */ - public function __invoke(IClientOptions $options, $value); + public function __invoke(ClientOptionsInterface $options, $value); } diff --git a/lib/Predis/Pipeline/FireAndForgetExecutor.php b/lib/Predis/Pipeline/FireAndForgetExecutor.php index 9c66fa41..e44aa8ae 100644 --- a/lib/Predis/Pipeline/FireAndForgetExecutor.php +++ b/lib/Predis/Pipeline/FireAndForgetExecutor.php @@ -11,7 +11,7 @@ namespace Predis\Pipeline; -use Predis\Network\IConnection; +use Predis\Connection\ConnectionInterface; /** * Implements a pipeline executor strategy that writes a list of commands to @@ -19,12 +19,12 @@ use Predis\Network\IConnection; * * @author Daniele Alessandri */ -class FireAndForgetExecutor implements IPipelineExecutor +class FireAndForgetExecutor implements PipelineExecutorInterface { /** * {@inheritdoc} */ - public function execute(IConnection $connection, &$commands) + public function execute(ConnectionInterface $connection, &$commands) { foreach ($commands as $command) { $connection->writeCommand($command); diff --git a/lib/Predis/Pipeline/PipelineContext.php b/lib/Predis/Pipeline/PipelineContext.php index f647eac9..128b8ddb 100644 --- a/lib/Predis/Pipeline/PipelineContext.php +++ b/lib/Predis/Pipeline/PipelineContext.php @@ -14,8 +14,8 @@ namespace Predis\Pipeline; use Predis\Client; use Predis\Helpers; use Predis\ClientException; -use Predis\Commands\ICommand; -use Predis\Network\IConnectionReplication; +use Predis\Command\CommandInterface; +use Predis\Connection\ReplicationConnectionInterface; /** * Abstraction of a pipeline context where write and read operations @@ -48,7 +48,7 @@ class PipelineContext * * @param Client Client instance used by the context. * @param array Options for the context initialization. - * @return IPipelineExecutor + * @return PipelineExecutorInterface */ protected function createExecutor(Client $client, Array $options) { @@ -58,10 +58,10 @@ class PipelineContext if (isset($options['executor'])) { $executor = $options['executor']; - if (!$executor instanceof IPipelineExecutor) { + if (!$executor instanceof PipelineExecutorInterface) { throw new \InvalidArgumentException( 'The executor option accepts only instances ' . - 'of Predis\Pipeline\IPipelineExecutor' + 'of Predis\Pipeline\PipelineExecutorInterface' ); } return $executor; @@ -93,9 +93,9 @@ class PipelineContext /** * Queues a command instance into the pipeline buffer. * - * @param ICommand $command Command to queue in the buffer. + * @param CommandInterface $command Command to queue in the buffer. */ - protected function recordCommand(ICommand $command) + protected function recordCommand(CommandInterface $command) { $this->pipeline[] = $command; } @@ -103,9 +103,9 @@ class PipelineContext /** * Queues a command instance into the pipeline buffer. * - * @param ICommand $command Command to queue in the buffer. + * @param CommandInterface $command Command to queue in the buffer. */ - public function executeCommand(ICommand $command) + public function executeCommand(CommandInterface $command) { $this->recordCommand($command); } @@ -124,7 +124,7 @@ class PipelineContext // TODO: it would be better to use a dedicated pipeline executor // for classes implementing master/slave replication. - if ($connection instanceof IConnectionReplication) { + if ($connection instanceof ReplicationConnectionInterface) { $connection->switchTo('master'); } @@ -198,7 +198,7 @@ class PipelineContext /** * Returns the underlying pipeline executor used by the pipeline object. * - * @return IPipelineExecutor + * @return PipelineExecutorInterface */ public function getExecutor() { diff --git a/lib/Predis/Pipeline/IPipelineExecutor.php b/lib/Predis/Pipeline/PipelineExecutorInterface.php similarity index 73% rename from lib/Predis/Pipeline/IPipelineExecutor.php rename to lib/Predis/Pipeline/PipelineExecutorInterface.php index 9f6dfd09..0b2a518b 100644 --- a/lib/Predis/Pipeline/IPipelineExecutor.php +++ b/lib/Predis/Pipeline/PipelineExecutorInterface.php @@ -11,7 +11,7 @@ namespace Predis\Pipeline; -use Predis\Network\IConnection; +use Predis\Connection\ConnectionInterface; /** * Defines a strategy to write a list of commands to the network @@ -19,14 +19,14 @@ use Predis\Network\IConnection; * * @author Daniele Alessandri */ -interface IPipelineExecutor +interface PipelineExecutorInterface { /** * Writes a list of commands to the network and reads back their replies. * - * @param IConnection $connection Connection to Redis. + * @param ConnectionInterface $connection Connection to Redis. * @param array $commands List of commands. * @return array */ - public function execute(IConnection $connection, &$commands); + public function execute(ConnectionInterface $connection, &$commands); } diff --git a/lib/Predis/Pipeline/SafeClusterExecutor.php b/lib/Predis/Pipeline/SafeClusterExecutor.php index c78bbdfb..d6ef21bb 100644 --- a/lib/Predis/Pipeline/SafeClusterExecutor.php +++ b/lib/Predis/Pipeline/SafeClusterExecutor.php @@ -13,7 +13,7 @@ namespace Predis\Pipeline; use Predis\ServerException; use Predis\CommunicationException; -use Predis\Network\IConnection; +use Predis\Connection\ConnectionInterface; /** * Implements a pipeline executor strategy for connection clusters that does @@ -22,12 +22,12 @@ use Predis\Network\IConnection; * * @author Daniele Alessandri */ -class SafeClusterExecutor implements IPipelineExecutor +class SafeClusterExecutor implements PipelineExecutorInterface { /** * {@inheritdoc} */ - public function execute(IConnection $connection, &$commands) + public function execute(ConnectionInterface $connection, &$commands) { $connectionExceptions = array(); $sizeofPipe = count($commands); diff --git a/lib/Predis/Pipeline/SafeExecutor.php b/lib/Predis/Pipeline/SafeExecutor.php index b50d188f..e4aa63f7 100644 --- a/lib/Predis/Pipeline/SafeExecutor.php +++ b/lib/Predis/Pipeline/SafeExecutor.php @@ -13,7 +13,7 @@ namespace Predis\Pipeline; use Predis\ServerException; use Predis\CommunicationException; -use Predis\Network\IConnection; +use Predis\Connection\ConnectionInterface; /** * Implements a pipeline executor strategy that does not fail when an error is @@ -21,12 +21,12 @@ use Predis\Network\IConnection; * * @author Daniele Alessandri */ -class SafeExecutor implements IPipelineExecutor +class SafeExecutor implements PipelineExecutorInterface { /** * {@inheritdoc} */ - public function execute(IConnection $connection, &$commands) + public function execute(ConnectionInterface $connection, &$commands) { $sizeofPipe = count($commands); $values = array(); diff --git a/lib/Predis/Pipeline/StandardExecutor.php b/lib/Predis/Pipeline/StandardExecutor.php index 1bbf6d01..8f0439c4 100644 --- a/lib/Predis/Pipeline/StandardExecutor.php +++ b/lib/Predis/Pipeline/StandardExecutor.php @@ -12,7 +12,7 @@ namespace Predis\Pipeline; use Predis\ServerException; -use Predis\Network\IConnection; +use Predis\Connection\ConnectionInterface; /** * Implements the standard pipeline executor strategy used @@ -21,12 +21,12 @@ use Predis\Network\IConnection; * * @author Daniele Alessandri */ -class StandardExecutor implements IPipelineExecutor +class StandardExecutor implements PipelineExecutorInterface { /** * {@inheritdoc} */ - public function execute(IConnection $connection, &$commands) + public function execute(ConnectionInterface $connection, &$commands) { $sizeofPipe = count($commands); $values = array(); diff --git a/lib/Predis/Profiles/ServerProfile.php b/lib/Predis/Profile/ServerProfile.php similarity index 82% rename from lib/Predis/Profiles/ServerProfile.php rename to lib/Predis/Profile/ServerProfile.php index 2bec123c..01e23abd 100644 --- a/lib/Predis/Profiles/ServerProfile.php +++ b/lib/Predis/Profile/ServerProfile.php @@ -9,18 +9,18 @@ * file that was distributed with this source code. */ -namespace Predis\Profiles; +namespace Predis\Profile; use Predis\ClientException; -use Predis\Commands\Processors\ICommandProcessor; -use Predis\Commands\Processors\IProcessingSupport; +use Predis\Command\Processor\CommandProcessorInterface; +use Predis\Command\Processor\CommandProcessingInterface; /** * Base class that implements common functionalities of server profiles. * * @author Daniele Alessandri */ -abstract class ServerProfile implements IServerProfile, IProcessingSupport +abstract class ServerProfile implements ServerProfileInterface, CommandProcessingInterface { private static $profiles; @@ -46,7 +46,7 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport /** * Returns the default server profile. * - * @return IServerProfile + * @return ServerProfileInterface */ public static function getDefault() { @@ -56,7 +56,7 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport /** * Returns the development server profile. * - * @return IServerProfile + * @return ServerProfileInterface */ public static function getDevelopment() { @@ -72,13 +72,13 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport private static function getDefaultProfiles() { return array( - '1.2' => 'Predis\Profiles\ServerVersion12', - '2.0' => 'Predis\Profiles\ServerVersion20', - '2.2' => 'Predis\Profiles\ServerVersion22', - '2.4' => 'Predis\Profiles\ServerVersion24', - '2.6' => 'Predis\Profiles\ServerVersionNext', - 'default' => 'Predis\Profiles\ServerVersion24', - 'dev' => 'Predis\Profiles\ServerVersionNext', + '1.2' => 'Predis\Profile\ServerVersion12', + '2.0' => 'Predis\Profile\ServerVersion20', + '2.2' => 'Predis\Profile\ServerVersion22', + '2.4' => 'Predis\Profile\ServerVersion24', + '2.6' => 'Predis\Profile\ServerVersionNext', + 'default' => 'Predis\Profile\ServerVersion24', + 'dev' => 'Predis\Profile\ServerVersionNext', ); } @@ -86,7 +86,7 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport * Registers a new server profile. * * @param string $alias Profile version or alias. - * @param string $profileClass FQN of a class implementing Predis\Profiles\IServerProfile. + * @param string $profileClass FQN of a class implementing Predis\Profile\ServerProfileInterface. */ public static function define($alias, $profileClass) { @@ -96,7 +96,7 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport $profileReflection = new \ReflectionClass($profileClass); - if (!$profileReflection->isSubclassOf('Predis\Profiles\IServerProfile')) { + if (!$profileReflection->isSubclassOf('Predis\Profile\ServerProfileInterface')) { throw new \InvalidArgumentException("Cannot register '$profileClass' as it is not a valid profile class"); } @@ -107,7 +107,7 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport * Returns the specified server profile. * * @param string $version Profile version or alias. - * @return IServerProfile + * @return ServerProfileInterface */ public static function get($version) { @@ -196,12 +196,12 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport * Defines a new commands in the server profile. * * @param string $alias Command ID. - * @param string $command FQN of a class implementing Predis\Commands\ICommand. + * @param string $command FQN of a class implementing Predis\Command\CommandInterface. */ public function defineCommand($alias, $command) { $commandReflection = new \ReflectionClass($command); - if (!$commandReflection->isSubclassOf('Predis\Commands\ICommand')) { + if (!$commandReflection->isSubclassOf('Predis\Command\CommandInterface')) { throw new \InvalidArgumentException("Cannot register '$command' as it is not a valid Redis command"); } $this->commands[strtolower($alias)] = $command; @@ -210,7 +210,7 @@ abstract class ServerProfile implements IServerProfile, IProcessingSupport /** * {@inheritdoc} */ - public function setProcessor(ICommandProcessor $processor = null) + public function setProcessor(CommandProcessorInterface $processor = null) { $this->processor = $processor; } diff --git a/lib/Predis/Profiles/IServerProfile.php b/lib/Predis/Profile/ServerProfileInterface.php similarity index 92% rename from lib/Predis/Profiles/IServerProfile.php rename to lib/Predis/Profile/ServerProfileInterface.php index d1cf8273..8e5458bd 100644 --- a/lib/Predis/Profiles/IServerProfile.php +++ b/lib/Predis/Profile/ServerProfileInterface.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Profiles; +namespace Predis\Profile; /** @@ -19,7 +19,7 @@ namespace Predis\Profiles; * * @author Daniele Alessandri */ -interface IServerProfile +interface ServerProfileInterface { /** * Gets a profile version corresponding to a Redis version. @@ -49,7 +49,7 @@ interface IServerProfile * * @param string $method Command ID. * @param array $arguments Arguments for the command. - * @return Predis\Commands\ICommand + * @return Predis\Command\CommandInterface */ public function createCommand($method, $arguments = array()); } diff --git a/lib/Predis/Profile/ServerVersion12.php b/lib/Predis/Profile/ServerVersion12.php new file mode 100644 index 00000000..4e339a7c --- /dev/null +++ b/lib/Predis/Profile/ServerVersion12.php @@ -0,0 +1,125 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Predis\Profile; + +/** + * Server profile for Redis v1.2.x. + * + * @author Daniele Alessandri + */ +class ServerVersion12 extends ServerProfile +{ + /** + * {@inheritdoc} + */ + public function getVersion() + { + return '1.2'; + } + + /** + * {@inheritdoc} + */ + public function getSupportedCommands() + { + return array( + /* ---------------- Redis 1.2 ---------------- */ + + /* commands operating on the key space */ + 'exists' => 'Predis\Command\KeyExists', + 'del' => 'Predis\Command\KeyDelete', + 'type' => 'Predis\Command\KeyType', + 'keys' => 'Predis\Command\KeyKeysV12x', + 'randomkey' => 'Predis\Command\KeyRandom', + 'rename' => 'Predis\Command\KeyRename', + 'renamenx' => 'Predis\Command\KeyRenamePreserve', + 'expire' => 'Predis\Command\KeyExpire', + 'expireat' => 'Predis\Command\KeyExpireAt', + 'ttl' => 'Predis\Command\KeyTimeToLive', + 'move' => 'Predis\Command\KeyMove', + 'sort' => 'Predis\Command\KeySort', + + /* commands operating on string values */ + 'set' => 'Predis\Command\StringSet', + 'setnx' => 'Predis\Command\StringSetPreserve', + 'mset' => 'Predis\Command\StringSetMultiple', + 'msetnx' => 'Predis\Command\StringSetMultiplePreserve', + 'get' => 'Predis\Command\StringGet', + 'mget' => 'Predis\Command\StringGetMultiple', + 'getset' => 'Predis\Command\StringGetSet', + 'incr' => 'Predis\Command\StringIncrement', + 'incrby' => 'Predis\Command\StringIncrementBy', + 'decr' => 'Predis\Command\StringDecrement', + 'decrby' => 'Predis\Command\StringDecrementBy', + + /* commands operating on lists */ + 'rpush' => 'Predis\Command\ListPushTail', + 'lpush' => 'Predis\Command\ListPushHead', + 'llen' => 'Predis\Command\ListLength', + 'lrange' => 'Predis\Command\ListRange', + 'ltrim' => 'Predis\Command\ListTrim', + 'lindex' => 'Predis\Command\ListIndex', + 'lset' => 'Predis\Command\ListSet', + 'lrem' => 'Predis\Command\ListRemove', + 'lpop' => 'Predis\Command\ListPopFirst', + 'rpop' => 'Predis\Command\ListPopLast', + 'rpoplpush' => 'Predis\Command\ListPopLastPushHead', + + /* commands operating on sets */ + 'sadd' => 'Predis\Command\SetAdd', + 'srem' => 'Predis\Command\SetRemove', + 'spop' => 'Predis\Command\SetPop', + 'smove' => 'Predis\Command\SetMove', + 'scard' => 'Predis\Command\SetCardinality', + 'sismember' => 'Predis\Command\SetIsMember', + 'sinter' => 'Predis\Command\SetIntersection', + 'sinterstore' => 'Predis\Command\SetIntersectionStore', + 'sunion' => 'Predis\Command\SetUnion', + 'sunionstore' => 'Predis\Command\SetUnionStore', + 'sdiff' => 'Predis\Command\SetDifference', + 'sdiffstore' => 'Predis\Command\SetDifferenceStore', + 'smembers' => 'Predis\Command\SetMembers', + 'srandmember' => 'Predis\Command\SetRandomMember', + + /* commands operating on sorted sets */ + 'zadd' => 'Predis\Command\ZSetAdd', + 'zincrby' => 'Predis\Command\ZSetIncrementBy', + 'zrem' => 'Predis\Command\ZSetRemove', + 'zrange' => 'Predis\Command\ZSetRange', + 'zrevrange' => 'Predis\Command\ZSetReverseRange', + 'zrangebyscore' => 'Predis\Command\ZSetRangeByScore', + 'zcard' => 'Predis\Command\ZSetCardinality', + 'zscore' => 'Predis\Command\ZSetScore', + 'zremrangebyscore' => 'Predis\Command\ZSetRemoveRangeByScore', + + /* connection related commands */ + 'ping' => 'Predis\Command\ConnectionPing', + 'auth' => 'Predis\Command\ConnectionAuth', + 'select' => 'Predis\Command\ConnectionSelect', + 'echo' => 'Predis\Command\ConnectionEcho', + 'quit' => 'Predis\Command\ConnectionQuit', + + /* remote server control commands */ + 'info' => 'Predis\Command\ServerInfo', + 'slaveof' => 'Predis\Command\ServerSlaveOf', + 'monitor' => 'Predis\Command\ServerMonitor', + 'dbsize' => 'Predis\Command\ServerDatabaseSize', + 'flushdb' => 'Predis\Command\ServerFlushDatabase', + 'flushall' => 'Predis\Command\ServerFlushAll', + 'save' => 'Predis\Command\ServerSave', + 'bgsave' => 'Predis\Command\ServerBackgroundSave', + 'lastsave' => 'Predis\Command\ServerLastSave', + 'shutdown' => 'Predis\Command\ServerShutdown', + 'bgrewriteaof' => 'Predis\Command\ServerBackgroundRewriteAOF', + ); + } +} diff --git a/lib/Predis/Profile/ServerVersion20.php b/lib/Predis/Profile/ServerVersion20.php new file mode 100644 index 00000000..42b0b088 --- /dev/null +++ b/lib/Predis/Profile/ServerVersion20.php @@ -0,0 +1,174 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Predis\Profile; + +/** + * Server profile for Redis v2.0.x. + * + * @author Daniele Alessandri + */ +class ServerVersion20 extends ServerProfile +{ + /** + * {@inheritdoc} + */ + public function getVersion() + { + return '2.0'; + } + + /** + * {@inheritdoc} + */ + public function getSupportedCommands() + { + return array( + /* ---------------- Redis 1.2 ---------------- */ + + /* commands operating on the key space */ + 'exists' => 'Predis\Command\KeyExists', + 'del' => 'Predis\Command\KeyDelete', + 'type' => 'Predis\Command\KeyType', + 'keys' => 'Predis\Command\KeyKeys', + 'randomkey' => 'Predis\Command\KeyRandom', + 'rename' => 'Predis\Command\KeyRename', + 'renamenx' => 'Predis\Command\KeyRenamePreserve', + 'expire' => 'Predis\Command\KeyExpire', + 'expireat' => 'Predis\Command\KeyExpireAt', + 'ttl' => 'Predis\Command\KeyTimeToLive', + 'move' => 'Predis\Command\KeyMove', + 'sort' => 'Predis\Command\KeySort', + + /* commands operating on string values */ + 'set' => 'Predis\Command\StringSet', + 'setnx' => 'Predis\Command\StringSetPreserve', + 'mset' => 'Predis\Command\StringSetMultiple', + 'msetnx' => 'Predis\Command\StringSetMultiplePreserve', + 'get' => 'Predis\Command\StringGet', + 'mget' => 'Predis\Command\StringGetMultiple', + 'getset' => 'Predis\Command\StringGetSet', + 'incr' => 'Predis\Command\StringIncrement', + 'incrby' => 'Predis\Command\StringIncrementBy', + 'decr' => 'Predis\Command\StringDecrement', + 'decrby' => 'Predis\Command\StringDecrementBy', + + /* commands operating on lists */ + 'rpush' => 'Predis\Command\ListPushTail', + 'lpush' => 'Predis\Command\ListPushHead', + 'llen' => 'Predis\Command\ListLength', + 'lrange' => 'Predis\Command\ListRange', + 'ltrim' => 'Predis\Command\ListTrim', + 'lindex' => 'Predis\Command\ListIndex', + 'lset' => 'Predis\Command\ListSet', + 'lrem' => 'Predis\Command\ListRemove', + 'lpop' => 'Predis\Command\ListPopFirst', + 'rpop' => 'Predis\Command\ListPopLast', + 'rpoplpush' => 'Predis\Command\ListPopLastPushHead', + + /* commands operating on sets */ + 'sadd' => 'Predis\Command\SetAdd', + 'srem' => 'Predis\Command\SetRemove', + 'spop' => 'Predis\Command\SetPop', + 'smove' => 'Predis\Command\SetMove', + 'scard' => 'Predis\Command\SetCardinality', + 'sismember' => 'Predis\Command\SetIsMember', + 'sinter' => 'Predis\Command\SetIntersection', + 'sinterstore' => 'Predis\Command\SetIntersectionStore', + 'sunion' => 'Predis\Command\SetUnion', + 'sunionstore' => 'Predis\Command\SetUnionStore', + 'sdiff' => 'Predis\Command\SetDifference', + 'sdiffstore' => 'Predis\Command\SetDifferenceStore', + 'smembers' => 'Predis\Command\SetMembers', + 'srandmember' => 'Predis\Command\SetRandomMember', + + /* commands operating on sorted sets */ + 'zadd' => 'Predis\Command\ZSetAdd', + 'zincrby' => 'Predis\Command\ZSetIncrementBy', + 'zrem' => 'Predis\Command\ZSetRemove', + 'zrange' => 'Predis\Command\ZSetRange', + 'zrevrange' => 'Predis\Command\ZSetReverseRange', + 'zrangebyscore' => 'Predis\Command\ZSetRangeByScore', + 'zcard' => 'Predis\Command\ZSetCardinality', + 'zscore' => 'Predis\Command\ZSetScore', + 'zremrangebyscore' => 'Predis\Command\ZSetRemoveRangeByScore', + + /* connection related commands */ + 'ping' => 'Predis\Command\ConnectionPing', + 'auth' => 'Predis\Command\ConnectionAuth', + 'select' => 'Predis\Command\ConnectionSelect', + 'echo' => 'Predis\Command\ConnectionEcho', + 'quit' => 'Predis\Command\ConnectionQuit', + + /* remote server control commands */ + 'info' => 'Predis\Command\ServerInfo', + 'slaveof' => 'Predis\Command\ServerSlaveOf', + 'monitor' => 'Predis\Command\ServerMonitor', + 'dbsize' => 'Predis\Command\ServerDatabaseSize', + 'flushdb' => 'Predis\Command\ServerFlushDatabase', + 'flushall' => 'Predis\Command\ServerFlushAll', + 'save' => 'Predis\Command\ServerSave', + 'bgsave' => 'Predis\Command\ServerBackgroundSave', + 'lastsave' => 'Predis\Command\ServerLastSave', + 'shutdown' => 'Predis\Command\ServerShutdown', + 'bgrewriteaof' => 'Predis\Command\ServerBackgroundRewriteAOF', + + + /* ---------------- Redis 2.0 ---------------- */ + + /* commands operating on string values */ + 'setex' => 'Predis\Command\StringSetExpire', + 'append' => 'Predis\Command\StringAppend', + 'substr' => 'Predis\Command\StringSubstr', + + /* commands operating on lists */ + 'blpop' => 'Predis\Command\ListPopFirstBlocking', + 'brpop' => 'Predis\Command\ListPopLastBlocking', + + /* commands operating on sorted sets */ + 'zunionstore' => 'Predis\Command\ZSetUnionStore', + 'zinterstore' => 'Predis\Command\ZSetIntersectionStore', + 'zcount' => 'Predis\Command\ZSetCount', + 'zrank' => 'Predis\Command\ZSetRank', + 'zrevrank' => 'Predis\Command\ZSetReverseRank', + 'zremrangebyrank' => 'Predis\Command\ZSetRemoveRangeByRank', + + /* commands operating on hashes */ + 'hset' => 'Predis\Command\HashSet', + 'hsetnx' => 'Predis\Command\HashSetPreserve', + 'hmset' => 'Predis\Command\HashSetMultiple', + 'hincrby' => 'Predis\Command\HashIncrementBy', + 'hget' => 'Predis\Command\HashGet', + 'hmget' => 'Predis\Command\HashGetMultiple', + 'hdel' => 'Predis\Command\HashDelete', + 'hexists' => 'Predis\Command\HashExists', + 'hlen' => 'Predis\Command\HashLength', + 'hkeys' => 'Predis\Command\HashKeys', + 'hvals' => 'Predis\Command\HashValues', + 'hgetall' => 'Predis\Command\HashGetAll', + + /* transactions */ + 'multi' => 'Predis\Command\TransactionMulti', + 'exec' => 'Predis\Command\TransactionExec', + 'discard' => 'Predis\Command\TransactionDiscard', + + /* publish - subscribe */ + 'subscribe' => 'Predis\Command\PubSubSubscribe', + 'unsubscribe' => 'Predis\Command\PubSubUnsubscribe', + 'psubscribe' => 'Predis\Command\PubSubSubscribeByPattern', + 'punsubscribe' => 'Predis\Command\PubSubUnsubscribeByPattern', + 'publish' => 'Predis\Command\PubSubPublish', + + /* remote server control commands */ + 'config' => 'Predis\Command\ServerConfig', + ); + } +} diff --git a/lib/Predis/Profile/ServerVersion22.php b/lib/Predis/Profile/ServerVersion22.php new file mode 100644 index 00000000..e97f422b --- /dev/null +++ b/lib/Predis/Profile/ServerVersion22.php @@ -0,0 +1,204 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Predis\Profile; + +/** + * Server profile for Redis v2.2.x. + * + * @author Daniele Alessandri + */ +class ServerVersion22 extends ServerProfile +{ + /** + * {@inheritdoc} + */ + public function getVersion() + { + return '2.2'; + } + + /** + * {@inheritdoc} + */ + public function getSupportedCommands() + { + return array( + /* ---------------- Redis 1.2 ---------------- */ + + /* commands operating on the key space */ + 'exists' => 'Predis\Command\KeyExists', + 'del' => 'Predis\Command\KeyDelete', + 'type' => 'Predis\Command\KeyType', + 'keys' => 'Predis\Command\KeyKeys', + 'randomkey' => 'Predis\Command\KeyRandom', + 'rename' => 'Predis\Command\KeyRename', + 'renamenx' => 'Predis\Command\KeyRenamePreserve', + 'expire' => 'Predis\Command\KeyExpire', + 'expireat' => 'Predis\Command\KeyExpireAt', + 'ttl' => 'Predis\Command\KeyTimeToLive', + 'move' => 'Predis\Command\KeyMove', + 'sort' => 'Predis\Command\KeySort', + + /* commands operating on string values */ + 'set' => 'Predis\Command\StringSet', + 'setnx' => 'Predis\Command\StringSetPreserve', + 'mset' => 'Predis\Command\StringSetMultiple', + 'msetnx' => 'Predis\Command\StringSetMultiplePreserve', + 'get' => 'Predis\Command\StringGet', + 'mget' => 'Predis\Command\StringGetMultiple', + 'getset' => 'Predis\Command\StringGetSet', + 'incr' => 'Predis\Command\StringIncrement', + 'incrby' => 'Predis\Command\StringIncrementBy', + 'decr' => 'Predis\Command\StringDecrement', + 'decrby' => 'Predis\Command\StringDecrementBy', + + /* commands operating on lists */ + 'rpush' => 'Predis\Command\ListPushTail', + 'lpush' => 'Predis\Command\ListPushHead', + 'llen' => 'Predis\Command\ListLength', + 'lrange' => 'Predis\Command\ListRange', + 'ltrim' => 'Predis\Command\ListTrim', + 'lindex' => 'Predis\Command\ListIndex', + 'lset' => 'Predis\Command\ListSet', + 'lrem' => 'Predis\Command\ListRemove', + 'lpop' => 'Predis\Command\ListPopFirst', + 'rpop' => 'Predis\Command\ListPopLast', + 'rpoplpush' => 'Predis\Command\ListPopLastPushHead', + + /* commands operating on sets */ + 'sadd' => 'Predis\Command\SetAdd', + 'srem' => 'Predis\Command\SetRemove', + 'spop' => 'Predis\Command\SetPop', + 'smove' => 'Predis\Command\SetMove', + 'scard' => 'Predis\Command\SetCardinality', + 'sismember' => 'Predis\Command\SetIsMember', + 'sinter' => 'Predis\Command\SetIntersection', + 'sinterstore' => 'Predis\Command\SetIntersectionStore', + 'sunion' => 'Predis\Command\SetUnion', + 'sunionstore' => 'Predis\Command\SetUnionStore', + 'sdiff' => 'Predis\Command\SetDifference', + 'sdiffstore' => 'Predis\Command\SetDifferenceStore', + 'smembers' => 'Predis\Command\SetMembers', + 'srandmember' => 'Predis\Command\SetRandomMember', + + /* commands operating on sorted sets */ + 'zadd' => 'Predis\Command\ZSetAdd', + 'zincrby' => 'Predis\Command\ZSetIncrementBy', + 'zrem' => 'Predis\Command\ZSetRemove', + 'zrange' => 'Predis\Command\ZSetRange', + 'zrevrange' => 'Predis\Command\ZSetReverseRange', + 'zrangebyscore' => 'Predis\Command\ZSetRangeByScore', + 'zcard' => 'Predis\Command\ZSetCardinality', + 'zscore' => 'Predis\Command\ZSetScore', + 'zremrangebyscore' => 'Predis\Command\ZSetRemoveRangeByScore', + + /* connection related commands */ + 'ping' => 'Predis\Command\ConnectionPing', + 'auth' => 'Predis\Command\ConnectionAuth', + 'select' => 'Predis\Command\ConnectionSelect', + 'echo' => 'Predis\Command\ConnectionEcho', + 'quit' => 'Predis\Command\ConnectionQuit', + + /* remote server control commands */ + 'info' => 'Predis\Command\ServerInfo', + 'slaveof' => 'Predis\Command\ServerSlaveOf', + 'monitor' => 'Predis\Command\ServerMonitor', + 'dbsize' => 'Predis\Command\ServerDatabaseSize', + 'flushdb' => 'Predis\Command\ServerFlushDatabase', + 'flushall' => 'Predis\Command\ServerFlushAll', + 'save' => 'Predis\Command\ServerSave', + 'bgsave' => 'Predis\Command\ServerBackgroundSave', + 'lastsave' => 'Predis\Command\ServerLastSave', + 'shutdown' => 'Predis\Command\ServerShutdown', + 'bgrewriteaof' => 'Predis\Command\ServerBackgroundRewriteAOF', + + + /* ---------------- Redis 2.0 ---------------- */ + + /* commands operating on string values */ + 'setex' => 'Predis\Command\StringSetExpire', + 'append' => 'Predis\Command\StringAppend', + 'substr' => 'Predis\Command\StringSubstr', + + /* commands operating on lists */ + 'blpop' => 'Predis\Command\ListPopFirstBlocking', + 'brpop' => 'Predis\Command\ListPopLastBlocking', + + /* commands operating on sorted sets */ + 'zunionstore' => 'Predis\Command\ZSetUnionStore', + 'zinterstore' => 'Predis\Command\ZSetIntersectionStore', + 'zcount' => 'Predis\Command\ZSetCount', + 'zrank' => 'Predis\Command\ZSetRank', + 'zrevrank' => 'Predis\Command\ZSetReverseRank', + 'zremrangebyrank' => 'Predis\Command\ZSetRemoveRangeByRank', + + /* commands operating on hashes */ + 'hset' => 'Predis\Command\HashSet', + 'hsetnx' => 'Predis\Command\HashSetPreserve', + 'hmset' => 'Predis\Command\HashSetMultiple', + 'hincrby' => 'Predis\Command\HashIncrementBy', + 'hget' => 'Predis\Command\HashGet', + 'hmget' => 'Predis\Command\HashGetMultiple', + 'hdel' => 'Predis\Command\HashDelete', + 'hexists' => 'Predis\Command\HashExists', + 'hlen' => 'Predis\Command\HashLength', + 'hkeys' => 'Predis\Command\HashKeys', + 'hvals' => 'Predis\Command\HashValues', + 'hgetall' => 'Predis\Command\HashGetAll', + + /* transactions */ + 'multi' => 'Predis\Command\TransactionMulti', + 'exec' => 'Predis\Command\TransactionExec', + 'discard' => 'Predis\Command\TransactionDiscard', + + /* publish - subscribe */ + 'subscribe' => 'Predis\Command\PubSubSubscribe', + 'unsubscribe' => 'Predis\Command\PubSubUnsubscribe', + 'psubscribe' => 'Predis\Command\PubSubSubscribeByPattern', + 'punsubscribe' => 'Predis\Command\PubSubUnsubscribeByPattern', + 'publish' => 'Predis\Command\PubSubPublish', + + /* remote server control commands */ + 'config' => 'Predis\Command\ServerConfig', + + + /* ---------------- Redis 2.2 ---------------- */ + + /* commands operating on the key space */ + 'persist' => 'Predis\Command\KeyPersist', + + /* commands operating on string values */ + 'strlen' => 'Predis\Command\StringStrlen', + 'setrange' => 'Predis\Command\StringSetRange', + 'getrange' => 'Predis\Command\StringGetRange', + 'setbit' => 'Predis\Command\StringSetBit', + 'getbit' => 'Predis\Command\StringGetBit', + + /* commands operating on lists */ + 'rpushx' => 'Predis\Command\ListPushTailX', + 'lpushx' => 'Predis\Command\ListPushHeadX', + 'linsert' => 'Predis\Command\ListInsert', + 'brpoplpush' => 'Predis\Command\ListPopLastPushHeadBlocking', + + /* commands operating on sorted sets */ + 'zrevrangebyscore' => 'Predis\Command\ZSetReverseRangeByScore', + + /* transactions */ + 'watch' => 'Predis\Command\TransactionWatch', + 'unwatch' => 'Predis\Command\TransactionUnwatch', + + /* remote server control commands */ + 'object' => 'Predis\Command\ServerObject', + 'slowlog' => 'Predis\Command\ServerSlowlog', + ); + } +} diff --git a/lib/Predis/Profile/ServerVersion24.php b/lib/Predis/Profile/ServerVersion24.php new file mode 100644 index 00000000..20569c6f --- /dev/null +++ b/lib/Predis/Profile/ServerVersion24.php @@ -0,0 +1,210 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Predis\Profile; + +/** + * Server profile for Redis v2.4.x. + * + * @author Daniele Alessandri + */ +class ServerVersion24 extends ServerProfile +{ + /** + * {@inheritdoc} + */ + public function getVersion() + { + return '2.4'; + } + + /** + * {@inheritdoc} + */ + public function getSupportedCommands() + { + return array( + /* ---------------- Redis 1.2 ---------------- */ + + /* commands operating on the key space */ + 'exists' => 'Predis\Command\KeyExists', + 'del' => 'Predis\Command\KeyDelete', + 'type' => 'Predis\Command\KeyType', + 'keys' => 'Predis\Command\KeyKeys', + 'randomkey' => 'Predis\Command\KeyRandom', + 'rename' => 'Predis\Command\KeyRename', + 'renamenx' => 'Predis\Command\KeyRenamePreserve', + 'expire' => 'Predis\Command\KeyExpire', + 'expireat' => 'Predis\Command\KeyExpireAt', + 'ttl' => 'Predis\Command\KeyTimeToLive', + 'move' => 'Predis\Command\KeyMove', + 'sort' => 'Predis\Command\KeySort', + + /* commands operating on string values */ + 'set' => 'Predis\Command\StringSet', + 'setnx' => 'Predis\Command\StringSetPreserve', + 'mset' => 'Predis\Command\StringSetMultiple', + 'msetnx' => 'Predis\Command\StringSetMultiplePreserve', + 'get' => 'Predis\Command\StringGet', + 'mget' => 'Predis\Command\StringGetMultiple', + 'getset' => 'Predis\Command\StringGetSet', + 'incr' => 'Predis\Command\StringIncrement', + 'incrby' => 'Predis\Command\StringIncrementBy', + 'decr' => 'Predis\Command\StringDecrement', + 'decrby' => 'Predis\Command\StringDecrementBy', + + /* commands operating on lists */ + 'rpush' => 'Predis\Command\ListPushTail', + 'lpush' => 'Predis\Command\ListPushHead', + 'llen' => 'Predis\Command\ListLength', + 'lrange' => 'Predis\Command\ListRange', + 'ltrim' => 'Predis\Command\ListTrim', + 'lindex' => 'Predis\Command\ListIndex', + 'lset' => 'Predis\Command\ListSet', + 'lrem' => 'Predis\Command\ListRemove', + 'lpop' => 'Predis\Command\ListPopFirst', + 'rpop' => 'Predis\Command\ListPopLast', + 'rpoplpush' => 'Predis\Command\ListPopLastPushHead', + + /* commands operating on sets */ + 'sadd' => 'Predis\Command\SetAdd', + 'srem' => 'Predis\Command\SetRemove', + 'spop' => 'Predis\Command\SetPop', + 'smove' => 'Predis\Command\SetMove', + 'scard' => 'Predis\Command\SetCardinality', + 'sismember' => 'Predis\Command\SetIsMember', + 'sinter' => 'Predis\Command\SetIntersection', + 'sinterstore' => 'Predis\Command\SetIntersectionStore', + 'sunion' => 'Predis\Command\SetUnion', + 'sunionstore' => 'Predis\Command\SetUnionStore', + 'sdiff' => 'Predis\Command\SetDifference', + 'sdiffstore' => 'Predis\Command\SetDifferenceStore', + 'smembers' => 'Predis\Command\SetMembers', + 'srandmember' => 'Predis\Command\SetRandomMember', + + /* commands operating on sorted sets */ + 'zadd' => 'Predis\Command\ZSetAdd', + 'zincrby' => 'Predis\Command\ZSetIncrementBy', + 'zrem' => 'Predis\Command\ZSetRemove', + 'zrange' => 'Predis\Command\ZSetRange', + 'zrevrange' => 'Predis\Command\ZSetReverseRange', + 'zrangebyscore' => 'Predis\Command\ZSetRangeByScore', + 'zcard' => 'Predis\Command\ZSetCardinality', + 'zscore' => 'Predis\Command\ZSetScore', + 'zremrangebyscore' => 'Predis\Command\ZSetRemoveRangeByScore', + + /* connection related commands */ + 'ping' => 'Predis\Command\ConnectionPing', + 'auth' => 'Predis\Command\ConnectionAuth', + 'select' => 'Predis\Command\ConnectionSelect', + 'echo' => 'Predis\Command\ConnectionEcho', + 'quit' => 'Predis\Command\ConnectionQuit', + + /* remote server control commands */ + 'info' => 'Predis\Command\ServerInfo', + 'slaveof' => 'Predis\Command\ServerSlaveOf', + 'monitor' => 'Predis\Command\ServerMonitor', + 'dbsize' => 'Predis\Command\ServerDatabaseSize', + 'flushdb' => 'Predis\Command\ServerFlushDatabase', + 'flushall' => 'Predis\Command\ServerFlushAll', + 'save' => 'Predis\Command\ServerSave', + 'bgsave' => 'Predis\Command\ServerBackgroundSave', + 'lastsave' => 'Predis\Command\ServerLastSave', + 'shutdown' => 'Predis\Command\ServerShutdown', + 'bgrewriteaof' => 'Predis\Command\ServerBackgroundRewriteAOF', + + + /* ---------------- Redis 2.0 ---------------- */ + + /* commands operating on string values */ + 'setex' => 'Predis\Command\StringSetExpire', + 'append' => 'Predis\Command\StringAppend', + 'substr' => 'Predis\Command\StringSubstr', + + /* commands operating on lists */ + 'blpop' => 'Predis\Command\ListPopFirstBlocking', + 'brpop' => 'Predis\Command\ListPopLastBlocking', + + /* commands operating on sorted sets */ + 'zunionstore' => 'Predis\Command\ZSetUnionStore', + 'zinterstore' => 'Predis\Command\ZSetIntersectionStore', + 'zcount' => 'Predis\Command\ZSetCount', + 'zrank' => 'Predis\Command\ZSetRank', + 'zrevrank' => 'Predis\Command\ZSetReverseRank', + 'zremrangebyrank' => 'Predis\Command\ZSetRemoveRangeByRank', + + /* commands operating on hashes */ + 'hset' => 'Predis\Command\HashSet', + 'hsetnx' => 'Predis\Command\HashSetPreserve', + 'hmset' => 'Predis\Command\HashSetMultiple', + 'hincrby' => 'Predis\Command\HashIncrementBy', + 'hget' => 'Predis\Command\HashGet', + 'hmget' => 'Predis\Command\HashGetMultiple', + 'hdel' => 'Predis\Command\HashDelete', + 'hexists' => 'Predis\Command\HashExists', + 'hlen' => 'Predis\Command\HashLength', + 'hkeys' => 'Predis\Command\HashKeys', + 'hvals' => 'Predis\Command\HashValues', + 'hgetall' => 'Predis\Command\HashGetAll', + + /* transactions */ + 'multi' => 'Predis\Command\TransactionMulti', + 'exec' => 'Predis\Command\TransactionExec', + 'discard' => 'Predis\Command\TransactionDiscard', + + /* publish - subscribe */ + 'subscribe' => 'Predis\Command\PubSubSubscribe', + 'unsubscribe' => 'Predis\Command\PubSubUnsubscribe', + 'psubscribe' => 'Predis\Command\PubSubSubscribeByPattern', + 'punsubscribe' => 'Predis\Command\PubSubUnsubscribeByPattern', + 'publish' => 'Predis\Command\PubSubPublish', + + /* remote server control commands */ + 'config' => 'Predis\Command\ServerConfig', + + + /* ---------------- Redis 2.2 ---------------- */ + + /* commands operating on the key space */ + 'persist' => 'Predis\Command\KeyPersist', + + /* commands operating on string values */ + 'strlen' => 'Predis\Command\StringStrlen', + 'setrange' => 'Predis\Command\StringSetRange', + 'getrange' => 'Predis\Command\StringGetRange', + 'setbit' => 'Predis\Command\StringSetBit', + 'getbit' => 'Predis\Command\StringGetBit', + + /* commands operating on lists */ + 'rpushx' => 'Predis\Command\ListPushTailX', + 'lpushx' => 'Predis\Command\ListPushHeadX', + 'linsert' => 'Predis\Command\ListInsert', + 'brpoplpush' => 'Predis\Command\ListPopLastPushHeadBlocking', + + /* commands operating on sorted sets */ + 'zrevrangebyscore' => 'Predis\Command\ZSetReverseRangeByScore', + + /* transactions */ + 'watch' => 'Predis\Command\TransactionWatch', + 'unwatch' => 'Predis\Command\TransactionUnwatch', + + /* remote server control commands */ + 'object' => 'Predis\Command\ServerObject', + 'slowlog' => 'Predis\Command\ServerSlowlog', + + + /* ---------------- Redis 2.4 ---------------- */ + + /* remote server control commands */ + 'client' => 'Predis\Command\ServerClient', + ); + } +} diff --git a/lib/Predis/Profiles/ServerVersionNext.php b/lib/Predis/Profile/ServerVersionNext.php similarity index 53% rename from lib/Predis/Profiles/ServerVersionNext.php rename to lib/Predis/Profile/ServerVersionNext.php index cec4547c..2cb1d8aa 100644 --- a/lib/Predis/Profiles/ServerVersionNext.php +++ b/lib/Predis/Profile/ServerVersionNext.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Profiles; +namespace Predis\Profile; /** * Server profile for the current development version of Redis. @@ -33,24 +33,24 @@ class ServerVersionNext extends ServerVersion24 { return array_merge(parent::getSupportedCommands(), array( /* commands operating on the key space */ - 'pttl' => 'Predis\Commands\KeyPreciseTimeToLive', - 'pexpire' => 'Predis\Commands\KeyPreciseExpire', - 'pexpireat' => 'Predis\Commands\KeyPreciseExpireAt', + 'pttl' => 'Predis\Command\KeyPreciseTimeToLive', + 'pexpire' => 'Predis\Command\KeyPreciseExpire', + 'pexpireat' => 'Predis\Command\KeyPreciseExpireAt', /* commands operating on string values */ - 'psetex' => 'Predis\Commands\StringPreciseSetExpire', - 'incrbyfloat' => 'Predis\Commands\StringIncrementByFloat', + 'psetex' => 'Predis\Command\StringPreciseSetExpire', + 'incrbyfloat' => 'Predis\Command\StringIncrementByFloat', /* commands operating on hashes */ - 'hincrbyfloat' => 'Predis\Commands\HashIncrementByFloat', + 'hincrbyfloat' => 'Predis\Command\HashIncrementByFloat', /* scripting */ - 'eval' => 'Predis\Commands\ServerEval', - 'evalsha' => 'Predis\Commands\ServerEvalSHA', - 'script' => 'Predis\Commands\ServerScript', + 'eval' => 'Predis\Command\ServerEval', + 'evalsha' => 'Predis\Command\ServerEvalSHA', + 'script' => 'Predis\Command\ServerScript', /* remote server control commands */ - 'info' => 'Predis\Commands\ServerInfoV26x', + 'info' => 'Predis\Command\ServerInfoV26x', )); } } diff --git a/lib/Predis/Profiles/ServerVersion12.php b/lib/Predis/Profiles/ServerVersion12.php deleted file mode 100644 index 3aa94f25..00000000 --- a/lib/Predis/Profiles/ServerVersion12.php +++ /dev/null @@ -1,125 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profiles; - -/** - * Server profile for Redis v1.2.x. - * - * @author Daniele Alessandri - */ -class ServerVersion12 extends ServerProfile -{ - /** - * {@inheritdoc} - */ - public function getVersion() - { - return '1.2'; - } - - /** - * {@inheritdoc} - */ - public function getSupportedCommands() - { - return array( - /* ---------------- Redis 1.2 ---------------- */ - - /* commands operating on the key space */ - 'exists' => 'Predis\Commands\KeyExists', - 'del' => 'Predis\Commands\KeyDelete', - 'type' => 'Predis\Commands\KeyType', - 'keys' => 'Predis\Commands\KeyKeysV12x', - 'randomkey' => 'Predis\Commands\KeyRandom', - 'rename' => 'Predis\Commands\KeyRename', - 'renamenx' => 'Predis\Commands\KeyRenamePreserve', - 'expire' => 'Predis\Commands\KeyExpire', - 'expireat' => 'Predis\Commands\KeyExpireAt', - 'ttl' => 'Predis\Commands\KeyTimeToLive', - 'move' => 'Predis\Commands\KeyMove', - 'sort' => 'Predis\Commands\KeySort', - - /* commands operating on string values */ - 'set' => 'Predis\Commands\StringSet', - 'setnx' => 'Predis\Commands\StringSetPreserve', - 'mset' => 'Predis\Commands\StringSetMultiple', - 'msetnx' => 'Predis\Commands\StringSetMultiplePreserve', - 'get' => 'Predis\Commands\StringGet', - 'mget' => 'Predis\Commands\StringGetMultiple', - 'getset' => 'Predis\Commands\StringGetSet', - 'incr' => 'Predis\Commands\StringIncrement', - 'incrby' => 'Predis\Commands\StringIncrementBy', - 'decr' => 'Predis\Commands\StringDecrement', - 'decrby' => 'Predis\Commands\StringDecrementBy', - - /* commands operating on lists */ - 'rpush' => 'Predis\Commands\ListPushTail', - 'lpush' => 'Predis\Commands\ListPushHead', - 'llen' => 'Predis\Commands\ListLength', - 'lrange' => 'Predis\Commands\ListRange', - 'ltrim' => 'Predis\Commands\ListTrim', - 'lindex' => 'Predis\Commands\ListIndex', - 'lset' => 'Predis\Commands\ListSet', - 'lrem' => 'Predis\Commands\ListRemove', - 'lpop' => 'Predis\Commands\ListPopFirst', - 'rpop' => 'Predis\Commands\ListPopLast', - 'rpoplpush' => 'Predis\Commands\ListPopLastPushHead', - - /* commands operating on sets */ - 'sadd' => 'Predis\Commands\SetAdd', - 'srem' => 'Predis\Commands\SetRemove', - 'spop' => 'Predis\Commands\SetPop', - 'smove' => 'Predis\Commands\SetMove', - 'scard' => 'Predis\Commands\SetCardinality', - 'sismember' => 'Predis\Commands\SetIsMember', - 'sinter' => 'Predis\Commands\SetIntersection', - 'sinterstore' => 'Predis\Commands\SetIntersectionStore', - 'sunion' => 'Predis\Commands\SetUnion', - 'sunionstore' => 'Predis\Commands\SetUnionStore', - 'sdiff' => 'Predis\Commands\SetDifference', - 'sdiffstore' => 'Predis\Commands\SetDifferenceStore', - 'smembers' => 'Predis\Commands\SetMembers', - 'srandmember' => 'Predis\Commands\SetRandomMember', - - /* commands operating on sorted sets */ - 'zadd' => 'Predis\Commands\ZSetAdd', - 'zincrby' => 'Predis\Commands\ZSetIncrementBy', - 'zrem' => 'Predis\Commands\ZSetRemove', - 'zrange' => 'Predis\Commands\ZSetRange', - 'zrevrange' => 'Predis\Commands\ZSetReverseRange', - 'zrangebyscore' => 'Predis\Commands\ZSetRangeByScore', - 'zcard' => 'Predis\Commands\ZSetCardinality', - 'zscore' => 'Predis\Commands\ZSetScore', - 'zremrangebyscore' => 'Predis\Commands\ZSetRemoveRangeByScore', - - /* connection related commands */ - 'ping' => 'Predis\Commands\ConnectionPing', - 'auth' => 'Predis\Commands\ConnectionAuth', - 'select' => 'Predis\Commands\ConnectionSelect', - 'echo' => 'Predis\Commands\ConnectionEcho', - 'quit' => 'Predis\Commands\ConnectionQuit', - - /* remote server control commands */ - 'info' => 'Predis\Commands\ServerInfo', - 'slaveof' => 'Predis\Commands\ServerSlaveOf', - 'monitor' => 'Predis\Commands\ServerMonitor', - 'dbsize' => 'Predis\Commands\ServerDatabaseSize', - 'flushdb' => 'Predis\Commands\ServerFlushDatabase', - 'flushall' => 'Predis\Commands\ServerFlushAll', - 'save' => 'Predis\Commands\ServerSave', - 'bgsave' => 'Predis\Commands\ServerBackgroundSave', - 'lastsave' => 'Predis\Commands\ServerLastSave', - 'shutdown' => 'Predis\Commands\ServerShutdown', - 'bgrewriteaof' => 'Predis\Commands\ServerBackgroundRewriteAOF', - ); - } -} diff --git a/lib/Predis/Profiles/ServerVersion20.php b/lib/Predis/Profiles/ServerVersion20.php deleted file mode 100644 index 002254a1..00000000 --- a/lib/Predis/Profiles/ServerVersion20.php +++ /dev/null @@ -1,174 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profiles; - -/** - * Server profile for Redis v2.0.x. - * - * @author Daniele Alessandri - */ -class ServerVersion20 extends ServerProfile -{ - /** - * {@inheritdoc} - */ - public function getVersion() - { - return '2.0'; - } - - /** - * {@inheritdoc} - */ - public function getSupportedCommands() - { - return array( - /* ---------------- Redis 1.2 ---------------- */ - - /* commands operating on the key space */ - 'exists' => 'Predis\Commands\KeyExists', - 'del' => 'Predis\Commands\KeyDelete', - 'type' => 'Predis\Commands\KeyType', - 'keys' => 'Predis\Commands\KeyKeys', - 'randomkey' => 'Predis\Commands\KeyRandom', - 'rename' => 'Predis\Commands\KeyRename', - 'renamenx' => 'Predis\Commands\KeyRenamePreserve', - 'expire' => 'Predis\Commands\KeyExpire', - 'expireat' => 'Predis\Commands\KeyExpireAt', - 'ttl' => 'Predis\Commands\KeyTimeToLive', - 'move' => 'Predis\Commands\KeyMove', - 'sort' => 'Predis\Commands\KeySort', - - /* commands operating on string values */ - 'set' => 'Predis\Commands\StringSet', - 'setnx' => 'Predis\Commands\StringSetPreserve', - 'mset' => 'Predis\Commands\StringSetMultiple', - 'msetnx' => 'Predis\Commands\StringSetMultiplePreserve', - 'get' => 'Predis\Commands\StringGet', - 'mget' => 'Predis\Commands\StringGetMultiple', - 'getset' => 'Predis\Commands\StringGetSet', - 'incr' => 'Predis\Commands\StringIncrement', - 'incrby' => 'Predis\Commands\StringIncrementBy', - 'decr' => 'Predis\Commands\StringDecrement', - 'decrby' => 'Predis\Commands\StringDecrementBy', - - /* commands operating on lists */ - 'rpush' => 'Predis\Commands\ListPushTail', - 'lpush' => 'Predis\Commands\ListPushHead', - 'llen' => 'Predis\Commands\ListLength', - 'lrange' => 'Predis\Commands\ListRange', - 'ltrim' => 'Predis\Commands\ListTrim', - 'lindex' => 'Predis\Commands\ListIndex', - 'lset' => 'Predis\Commands\ListSet', - 'lrem' => 'Predis\Commands\ListRemove', - 'lpop' => 'Predis\Commands\ListPopFirst', - 'rpop' => 'Predis\Commands\ListPopLast', - 'rpoplpush' => 'Predis\Commands\ListPopLastPushHead', - - /* commands operating on sets */ - 'sadd' => 'Predis\Commands\SetAdd', - 'srem' => 'Predis\Commands\SetRemove', - 'spop' => 'Predis\Commands\SetPop', - 'smove' => 'Predis\Commands\SetMove', - 'scard' => 'Predis\Commands\SetCardinality', - 'sismember' => 'Predis\Commands\SetIsMember', - 'sinter' => 'Predis\Commands\SetIntersection', - 'sinterstore' => 'Predis\Commands\SetIntersectionStore', - 'sunion' => 'Predis\Commands\SetUnion', - 'sunionstore' => 'Predis\Commands\SetUnionStore', - 'sdiff' => 'Predis\Commands\SetDifference', - 'sdiffstore' => 'Predis\Commands\SetDifferenceStore', - 'smembers' => 'Predis\Commands\SetMembers', - 'srandmember' => 'Predis\Commands\SetRandomMember', - - /* commands operating on sorted sets */ - 'zadd' => 'Predis\Commands\ZSetAdd', - 'zincrby' => 'Predis\Commands\ZSetIncrementBy', - 'zrem' => 'Predis\Commands\ZSetRemove', - 'zrange' => 'Predis\Commands\ZSetRange', - 'zrevrange' => 'Predis\Commands\ZSetReverseRange', - 'zrangebyscore' => 'Predis\Commands\ZSetRangeByScore', - 'zcard' => 'Predis\Commands\ZSetCardinality', - 'zscore' => 'Predis\Commands\ZSetScore', - 'zremrangebyscore' => 'Predis\Commands\ZSetRemoveRangeByScore', - - /* connection related commands */ - 'ping' => 'Predis\Commands\ConnectionPing', - 'auth' => 'Predis\Commands\ConnectionAuth', - 'select' => 'Predis\Commands\ConnectionSelect', - 'echo' => 'Predis\Commands\ConnectionEcho', - 'quit' => 'Predis\Commands\ConnectionQuit', - - /* remote server control commands */ - 'info' => 'Predis\Commands\ServerInfo', - 'slaveof' => 'Predis\Commands\ServerSlaveOf', - 'monitor' => 'Predis\Commands\ServerMonitor', - 'dbsize' => 'Predis\Commands\ServerDatabaseSize', - 'flushdb' => 'Predis\Commands\ServerFlushDatabase', - 'flushall' => 'Predis\Commands\ServerFlushAll', - 'save' => 'Predis\Commands\ServerSave', - 'bgsave' => 'Predis\Commands\ServerBackgroundSave', - 'lastsave' => 'Predis\Commands\ServerLastSave', - 'shutdown' => 'Predis\Commands\ServerShutdown', - 'bgrewriteaof' => 'Predis\Commands\ServerBackgroundRewriteAOF', - - - /* ---------------- Redis 2.0 ---------------- */ - - /* commands operating on string values */ - 'setex' => 'Predis\Commands\StringSetExpire', - 'append' => 'Predis\Commands\StringAppend', - 'substr' => 'Predis\Commands\StringSubstr', - - /* commands operating on lists */ - 'blpop' => 'Predis\Commands\ListPopFirstBlocking', - 'brpop' => 'Predis\Commands\ListPopLastBlocking', - - /* commands operating on sorted sets */ - 'zunionstore' => 'Predis\Commands\ZSetUnionStore', - 'zinterstore' => 'Predis\Commands\ZSetIntersectionStore', - 'zcount' => 'Predis\Commands\ZSetCount', - 'zrank' => 'Predis\Commands\ZSetRank', - 'zrevrank' => 'Predis\Commands\ZSetReverseRank', - 'zremrangebyrank' => 'Predis\Commands\ZSetRemoveRangeByRank', - - /* commands operating on hashes */ - 'hset' => 'Predis\Commands\HashSet', - 'hsetnx' => 'Predis\Commands\HashSetPreserve', - 'hmset' => 'Predis\Commands\HashSetMultiple', - 'hincrby' => 'Predis\Commands\HashIncrementBy', - 'hget' => 'Predis\Commands\HashGet', - 'hmget' => 'Predis\Commands\HashGetMultiple', - 'hdel' => 'Predis\Commands\HashDelete', - 'hexists' => 'Predis\Commands\HashExists', - 'hlen' => 'Predis\Commands\HashLength', - 'hkeys' => 'Predis\Commands\HashKeys', - 'hvals' => 'Predis\Commands\HashValues', - 'hgetall' => 'Predis\Commands\HashGetAll', - - /* transactions */ - 'multi' => 'Predis\Commands\TransactionMulti', - 'exec' => 'Predis\Commands\TransactionExec', - 'discard' => 'Predis\Commands\TransactionDiscard', - - /* publish - subscribe */ - 'subscribe' => 'Predis\Commands\PubSubSubscribe', - 'unsubscribe' => 'Predis\Commands\PubSubUnsubscribe', - 'psubscribe' => 'Predis\Commands\PubSubSubscribeByPattern', - 'punsubscribe' => 'Predis\Commands\PubSubUnsubscribeByPattern', - 'publish' => 'Predis\Commands\PubSubPublish', - - /* remote server control commands */ - 'config' => 'Predis\Commands\ServerConfig', - ); - } -} diff --git a/lib/Predis/Profiles/ServerVersion22.php b/lib/Predis/Profiles/ServerVersion22.php deleted file mode 100644 index e49af0a9..00000000 --- a/lib/Predis/Profiles/ServerVersion22.php +++ /dev/null @@ -1,204 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profiles; - -/** - * Server profile for Redis v2.2.x. - * - * @author Daniele Alessandri - */ -class ServerVersion22 extends ServerProfile -{ - /** - * {@inheritdoc} - */ - public function getVersion() - { - return '2.2'; - } - - /** - * {@inheritdoc} - */ - public function getSupportedCommands() - { - return array( - /* ---------------- Redis 1.2 ---------------- */ - - /* commands operating on the key space */ - 'exists' => 'Predis\Commands\KeyExists', - 'del' => 'Predis\Commands\KeyDelete', - 'type' => 'Predis\Commands\KeyType', - 'keys' => 'Predis\Commands\KeyKeys', - 'randomkey' => 'Predis\Commands\KeyRandom', - 'rename' => 'Predis\Commands\KeyRename', - 'renamenx' => 'Predis\Commands\KeyRenamePreserve', - 'expire' => 'Predis\Commands\KeyExpire', - 'expireat' => 'Predis\Commands\KeyExpireAt', - 'ttl' => 'Predis\Commands\KeyTimeToLive', - 'move' => 'Predis\Commands\KeyMove', - 'sort' => 'Predis\Commands\KeySort', - - /* commands operating on string values */ - 'set' => 'Predis\Commands\StringSet', - 'setnx' => 'Predis\Commands\StringSetPreserve', - 'mset' => 'Predis\Commands\StringSetMultiple', - 'msetnx' => 'Predis\Commands\StringSetMultiplePreserve', - 'get' => 'Predis\Commands\StringGet', - 'mget' => 'Predis\Commands\StringGetMultiple', - 'getset' => 'Predis\Commands\StringGetSet', - 'incr' => 'Predis\Commands\StringIncrement', - 'incrby' => 'Predis\Commands\StringIncrementBy', - 'decr' => 'Predis\Commands\StringDecrement', - 'decrby' => 'Predis\Commands\StringDecrementBy', - - /* commands operating on lists */ - 'rpush' => 'Predis\Commands\ListPushTail', - 'lpush' => 'Predis\Commands\ListPushHead', - 'llen' => 'Predis\Commands\ListLength', - 'lrange' => 'Predis\Commands\ListRange', - 'ltrim' => 'Predis\Commands\ListTrim', - 'lindex' => 'Predis\Commands\ListIndex', - 'lset' => 'Predis\Commands\ListSet', - 'lrem' => 'Predis\Commands\ListRemove', - 'lpop' => 'Predis\Commands\ListPopFirst', - 'rpop' => 'Predis\Commands\ListPopLast', - 'rpoplpush' => 'Predis\Commands\ListPopLastPushHead', - - /* commands operating on sets */ - 'sadd' => 'Predis\Commands\SetAdd', - 'srem' => 'Predis\Commands\SetRemove', - 'spop' => 'Predis\Commands\SetPop', - 'smove' => 'Predis\Commands\SetMove', - 'scard' => 'Predis\Commands\SetCardinality', - 'sismember' => 'Predis\Commands\SetIsMember', - 'sinter' => 'Predis\Commands\SetIntersection', - 'sinterstore' => 'Predis\Commands\SetIntersectionStore', - 'sunion' => 'Predis\Commands\SetUnion', - 'sunionstore' => 'Predis\Commands\SetUnionStore', - 'sdiff' => 'Predis\Commands\SetDifference', - 'sdiffstore' => 'Predis\Commands\SetDifferenceStore', - 'smembers' => 'Predis\Commands\SetMembers', - 'srandmember' => 'Predis\Commands\SetRandomMember', - - /* commands operating on sorted sets */ - 'zadd' => 'Predis\Commands\ZSetAdd', - 'zincrby' => 'Predis\Commands\ZSetIncrementBy', - 'zrem' => 'Predis\Commands\ZSetRemove', - 'zrange' => 'Predis\Commands\ZSetRange', - 'zrevrange' => 'Predis\Commands\ZSetReverseRange', - 'zrangebyscore' => 'Predis\Commands\ZSetRangeByScore', - 'zcard' => 'Predis\Commands\ZSetCardinality', - 'zscore' => 'Predis\Commands\ZSetScore', - 'zremrangebyscore' => 'Predis\Commands\ZSetRemoveRangeByScore', - - /* connection related commands */ - 'ping' => 'Predis\Commands\ConnectionPing', - 'auth' => 'Predis\Commands\ConnectionAuth', - 'select' => 'Predis\Commands\ConnectionSelect', - 'echo' => 'Predis\Commands\ConnectionEcho', - 'quit' => 'Predis\Commands\ConnectionQuit', - - /* remote server control commands */ - 'info' => 'Predis\Commands\ServerInfo', - 'slaveof' => 'Predis\Commands\ServerSlaveOf', - 'monitor' => 'Predis\Commands\ServerMonitor', - 'dbsize' => 'Predis\Commands\ServerDatabaseSize', - 'flushdb' => 'Predis\Commands\ServerFlushDatabase', - 'flushall' => 'Predis\Commands\ServerFlushAll', - 'save' => 'Predis\Commands\ServerSave', - 'bgsave' => 'Predis\Commands\ServerBackgroundSave', - 'lastsave' => 'Predis\Commands\ServerLastSave', - 'shutdown' => 'Predis\Commands\ServerShutdown', - 'bgrewriteaof' => 'Predis\Commands\ServerBackgroundRewriteAOF', - - - /* ---------------- Redis 2.0 ---------------- */ - - /* commands operating on string values */ - 'setex' => 'Predis\Commands\StringSetExpire', - 'append' => 'Predis\Commands\StringAppend', - 'substr' => 'Predis\Commands\StringSubstr', - - /* commands operating on lists */ - 'blpop' => 'Predis\Commands\ListPopFirstBlocking', - 'brpop' => 'Predis\Commands\ListPopLastBlocking', - - /* commands operating on sorted sets */ - 'zunionstore' => 'Predis\Commands\ZSetUnionStore', - 'zinterstore' => 'Predis\Commands\ZSetIntersectionStore', - 'zcount' => 'Predis\Commands\ZSetCount', - 'zrank' => 'Predis\Commands\ZSetRank', - 'zrevrank' => 'Predis\Commands\ZSetReverseRank', - 'zremrangebyrank' => 'Predis\Commands\ZSetRemoveRangeByRank', - - /* commands operating on hashes */ - 'hset' => 'Predis\Commands\HashSet', - 'hsetnx' => 'Predis\Commands\HashSetPreserve', - 'hmset' => 'Predis\Commands\HashSetMultiple', - 'hincrby' => 'Predis\Commands\HashIncrementBy', - 'hget' => 'Predis\Commands\HashGet', - 'hmget' => 'Predis\Commands\HashGetMultiple', - 'hdel' => 'Predis\Commands\HashDelete', - 'hexists' => 'Predis\Commands\HashExists', - 'hlen' => 'Predis\Commands\HashLength', - 'hkeys' => 'Predis\Commands\HashKeys', - 'hvals' => 'Predis\Commands\HashValues', - 'hgetall' => 'Predis\Commands\HashGetAll', - - /* transactions */ - 'multi' => 'Predis\Commands\TransactionMulti', - 'exec' => 'Predis\Commands\TransactionExec', - 'discard' => 'Predis\Commands\TransactionDiscard', - - /* publish - subscribe */ - 'subscribe' => 'Predis\Commands\PubSubSubscribe', - 'unsubscribe' => 'Predis\Commands\PubSubUnsubscribe', - 'psubscribe' => 'Predis\Commands\PubSubSubscribeByPattern', - 'punsubscribe' => 'Predis\Commands\PubSubUnsubscribeByPattern', - 'publish' => 'Predis\Commands\PubSubPublish', - - /* remote server control commands */ - 'config' => 'Predis\Commands\ServerConfig', - - - /* ---------------- Redis 2.2 ---------------- */ - - /* commands operating on the key space */ - 'persist' => 'Predis\Commands\KeyPersist', - - /* commands operating on string values */ - 'strlen' => 'Predis\Commands\StringStrlen', - 'setrange' => 'Predis\Commands\StringSetRange', - 'getrange' => 'Predis\Commands\StringGetRange', - 'setbit' => 'Predis\Commands\StringSetBit', - 'getbit' => 'Predis\Commands\StringGetBit', - - /* commands operating on lists */ - 'rpushx' => 'Predis\Commands\ListPushTailX', - 'lpushx' => 'Predis\Commands\ListPushHeadX', - 'linsert' => 'Predis\Commands\ListInsert', - 'brpoplpush' => 'Predis\Commands\ListPopLastPushHeadBlocking', - - /* commands operating on sorted sets */ - 'zrevrangebyscore' => 'Predis\Commands\ZSetReverseRangeByScore', - - /* transactions */ - 'watch' => 'Predis\Commands\TransactionWatch', - 'unwatch' => 'Predis\Commands\TransactionUnwatch', - - /* remote server control commands */ - 'object' => 'Predis\Commands\ServerObject', - 'slowlog' => 'Predis\Commands\ServerSlowlog', - ); - } -} diff --git a/lib/Predis/Profiles/ServerVersion24.php b/lib/Predis/Profiles/ServerVersion24.php deleted file mode 100644 index 2617945e..00000000 --- a/lib/Predis/Profiles/ServerVersion24.php +++ /dev/null @@ -1,210 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profiles; - -/** - * Server profile for Redis v2.4.x. - * - * @author Daniele Alessandri - */ -class ServerVersion24 extends ServerProfile -{ - /** - * {@inheritdoc} - */ - public function getVersion() - { - return '2.4'; - } - - /** - * {@inheritdoc} - */ - public function getSupportedCommands() - { - return array( - /* ---------------- Redis 1.2 ---------------- */ - - /* commands operating on the key space */ - 'exists' => 'Predis\Commands\KeyExists', - 'del' => 'Predis\Commands\KeyDelete', - 'type' => 'Predis\Commands\KeyType', - 'keys' => 'Predis\Commands\KeyKeys', - 'randomkey' => 'Predis\Commands\KeyRandom', - 'rename' => 'Predis\Commands\KeyRename', - 'renamenx' => 'Predis\Commands\KeyRenamePreserve', - 'expire' => 'Predis\Commands\KeyExpire', - 'expireat' => 'Predis\Commands\KeyExpireAt', - 'ttl' => 'Predis\Commands\KeyTimeToLive', - 'move' => 'Predis\Commands\KeyMove', - 'sort' => 'Predis\Commands\KeySort', - - /* commands operating on string values */ - 'set' => 'Predis\Commands\StringSet', - 'setnx' => 'Predis\Commands\StringSetPreserve', - 'mset' => 'Predis\Commands\StringSetMultiple', - 'msetnx' => 'Predis\Commands\StringSetMultiplePreserve', - 'get' => 'Predis\Commands\StringGet', - 'mget' => 'Predis\Commands\StringGetMultiple', - 'getset' => 'Predis\Commands\StringGetSet', - 'incr' => 'Predis\Commands\StringIncrement', - 'incrby' => 'Predis\Commands\StringIncrementBy', - 'decr' => 'Predis\Commands\StringDecrement', - 'decrby' => 'Predis\Commands\StringDecrementBy', - - /* commands operating on lists */ - 'rpush' => 'Predis\Commands\ListPushTail', - 'lpush' => 'Predis\Commands\ListPushHead', - 'llen' => 'Predis\Commands\ListLength', - 'lrange' => 'Predis\Commands\ListRange', - 'ltrim' => 'Predis\Commands\ListTrim', - 'lindex' => 'Predis\Commands\ListIndex', - 'lset' => 'Predis\Commands\ListSet', - 'lrem' => 'Predis\Commands\ListRemove', - 'lpop' => 'Predis\Commands\ListPopFirst', - 'rpop' => 'Predis\Commands\ListPopLast', - 'rpoplpush' => 'Predis\Commands\ListPopLastPushHead', - - /* commands operating on sets */ - 'sadd' => 'Predis\Commands\SetAdd', - 'srem' => 'Predis\Commands\SetRemove', - 'spop' => 'Predis\Commands\SetPop', - 'smove' => 'Predis\Commands\SetMove', - 'scard' => 'Predis\Commands\SetCardinality', - 'sismember' => 'Predis\Commands\SetIsMember', - 'sinter' => 'Predis\Commands\SetIntersection', - 'sinterstore' => 'Predis\Commands\SetIntersectionStore', - 'sunion' => 'Predis\Commands\SetUnion', - 'sunionstore' => 'Predis\Commands\SetUnionStore', - 'sdiff' => 'Predis\Commands\SetDifference', - 'sdiffstore' => 'Predis\Commands\SetDifferenceStore', - 'smembers' => 'Predis\Commands\SetMembers', - 'srandmember' => 'Predis\Commands\SetRandomMember', - - /* commands operating on sorted sets */ - 'zadd' => 'Predis\Commands\ZSetAdd', - 'zincrby' => 'Predis\Commands\ZSetIncrementBy', - 'zrem' => 'Predis\Commands\ZSetRemove', - 'zrange' => 'Predis\Commands\ZSetRange', - 'zrevrange' => 'Predis\Commands\ZSetReverseRange', - 'zrangebyscore' => 'Predis\Commands\ZSetRangeByScore', - 'zcard' => 'Predis\Commands\ZSetCardinality', - 'zscore' => 'Predis\Commands\ZSetScore', - 'zremrangebyscore' => 'Predis\Commands\ZSetRemoveRangeByScore', - - /* connection related commands */ - 'ping' => 'Predis\Commands\ConnectionPing', - 'auth' => 'Predis\Commands\ConnectionAuth', - 'select' => 'Predis\Commands\ConnectionSelect', - 'echo' => 'Predis\Commands\ConnectionEcho', - 'quit' => 'Predis\Commands\ConnectionQuit', - - /* remote server control commands */ - 'info' => 'Predis\Commands\ServerInfo', - 'slaveof' => 'Predis\Commands\ServerSlaveOf', - 'monitor' => 'Predis\Commands\ServerMonitor', - 'dbsize' => 'Predis\Commands\ServerDatabaseSize', - 'flushdb' => 'Predis\Commands\ServerFlushDatabase', - 'flushall' => 'Predis\Commands\ServerFlushAll', - 'save' => 'Predis\Commands\ServerSave', - 'bgsave' => 'Predis\Commands\ServerBackgroundSave', - 'lastsave' => 'Predis\Commands\ServerLastSave', - 'shutdown' => 'Predis\Commands\ServerShutdown', - 'bgrewriteaof' => 'Predis\Commands\ServerBackgroundRewriteAOF', - - - /* ---------------- Redis 2.0 ---------------- */ - - /* commands operating on string values */ - 'setex' => 'Predis\Commands\StringSetExpire', - 'append' => 'Predis\Commands\StringAppend', - 'substr' => 'Predis\Commands\StringSubstr', - - /* commands operating on lists */ - 'blpop' => 'Predis\Commands\ListPopFirstBlocking', - 'brpop' => 'Predis\Commands\ListPopLastBlocking', - - /* commands operating on sorted sets */ - 'zunionstore' => 'Predis\Commands\ZSetUnionStore', - 'zinterstore' => 'Predis\Commands\ZSetIntersectionStore', - 'zcount' => 'Predis\Commands\ZSetCount', - 'zrank' => 'Predis\Commands\ZSetRank', - 'zrevrank' => 'Predis\Commands\ZSetReverseRank', - 'zremrangebyrank' => 'Predis\Commands\ZSetRemoveRangeByRank', - - /* commands operating on hashes */ - 'hset' => 'Predis\Commands\HashSet', - 'hsetnx' => 'Predis\Commands\HashSetPreserve', - 'hmset' => 'Predis\Commands\HashSetMultiple', - 'hincrby' => 'Predis\Commands\HashIncrementBy', - 'hget' => 'Predis\Commands\HashGet', - 'hmget' => 'Predis\Commands\HashGetMultiple', - 'hdel' => 'Predis\Commands\HashDelete', - 'hexists' => 'Predis\Commands\HashExists', - 'hlen' => 'Predis\Commands\HashLength', - 'hkeys' => 'Predis\Commands\HashKeys', - 'hvals' => 'Predis\Commands\HashValues', - 'hgetall' => 'Predis\Commands\HashGetAll', - - /* transactions */ - 'multi' => 'Predis\Commands\TransactionMulti', - 'exec' => 'Predis\Commands\TransactionExec', - 'discard' => 'Predis\Commands\TransactionDiscard', - - /* publish - subscribe */ - 'subscribe' => 'Predis\Commands\PubSubSubscribe', - 'unsubscribe' => 'Predis\Commands\PubSubUnsubscribe', - 'psubscribe' => 'Predis\Commands\PubSubSubscribeByPattern', - 'punsubscribe' => 'Predis\Commands\PubSubUnsubscribeByPattern', - 'publish' => 'Predis\Commands\PubSubPublish', - - /* remote server control commands */ - 'config' => 'Predis\Commands\ServerConfig', - - - /* ---------------- Redis 2.2 ---------------- */ - - /* commands operating on the key space */ - 'persist' => 'Predis\Commands\KeyPersist', - - /* commands operating on string values */ - 'strlen' => 'Predis\Commands\StringStrlen', - 'setrange' => 'Predis\Commands\StringSetRange', - 'getrange' => 'Predis\Commands\StringGetRange', - 'setbit' => 'Predis\Commands\StringSetBit', - 'getbit' => 'Predis\Commands\StringGetBit', - - /* commands operating on lists */ - 'rpushx' => 'Predis\Commands\ListPushTailX', - 'lpushx' => 'Predis\Commands\ListPushHeadX', - 'linsert' => 'Predis\Commands\ListInsert', - 'brpoplpush' => 'Predis\Commands\ListPopLastPushHeadBlocking', - - /* commands operating on sorted sets */ - 'zrevrangebyscore' => 'Predis\Commands\ZSetReverseRangeByScore', - - /* transactions */ - 'watch' => 'Predis\Commands\TransactionWatch', - 'unwatch' => 'Predis\Commands\TransactionUnwatch', - - /* remote server control commands */ - 'object' => 'Predis\Commands\ServerObject', - 'slowlog' => 'Predis\Commands\ServerSlowlog', - - - /* ---------------- Redis 2.4 ---------------- */ - - /* remote server control commands */ - 'client' => 'Predis\Commands\ServerClient', - ); - } -} diff --git a/lib/Predis/Protocol/ICommandSerializer.php b/lib/Predis/Protocol/CommandSerializerInterface.php similarity index 72% rename from lib/Predis/Protocol/ICommandSerializer.php rename to lib/Predis/Protocol/CommandSerializerInterface.php index e0a71501..2671aece 100644 --- a/lib/Predis/Protocol/ICommandSerializer.php +++ b/lib/Predis/Protocol/CommandSerializerInterface.php @@ -11,20 +11,20 @@ namespace Predis\Protocol; -use Predis\Commands\ICommand; +use Predis\Command\CommandInterface; /** * Interface that defines a custom serializer for Redis commands. * * @author Daniele Alessandri */ -interface ICommandSerializer +interface CommandSerializerInterface { /** * Serializes a Redis command. * - * @param ICommand $command Redis command. + * @param CommandInterface $command Redis command. * @return string */ - public function serialize(ICommand $command); + public function serialize(CommandInterface $command); } diff --git a/lib/Predis/Protocol/IComposableProtocolProcessor.php b/lib/Predis/Protocol/ComposableProtocolInterface.php similarity index 70% rename from lib/Predis/Protocol/IComposableProtocolProcessor.php rename to lib/Predis/Protocol/ComposableProtocolInterface.php index c9eefca1..56990a0e 100644 --- a/lib/Predis/Protocol/IComposableProtocolProcessor.php +++ b/lib/Predis/Protocol/ComposableProtocolInterface.php @@ -18,33 +18,33 @@ namespace Predis\Protocol; * * @author Daniele Alessandri */ -interface IComposableProtocolProcessor extends IProtocolProcessor +interface ComposableProtocolInterface extends ProtocolInterface { /** * Sets the command serializer to be used by the protocol processor. * - * @param ICommandSerializer $serializer Command serializer. + * @param CommandSerializerInterface $serializer Command serializer. */ - public function setSerializer(ICommandSerializer $serializer); + public function setSerializer(CommandSerializerInterface $serializer); /** * Returns the command serializer used by the protocol processor. * - * @return ICommandSerializer + * @return CommandSerializerInterface */ public function getSerializer(); /** * Sets the response reader to be used by the protocol processor. * - * @param IResponseReader $reader Response reader. + * @param ResponseReaderInterface $reader Response reader. */ - public function setReader(IResponseReader $reader); + public function setReader(ResponseReaderInterface $reader); /** * Returns the response reader used by the protocol processor. * - * @return IResponseReader + * @return ResponseReaderInterface */ public function getReader(); } diff --git a/lib/Predis/Protocol/IProtocolProcessor.php b/lib/Predis/Protocol/ProtocolInterface.php similarity index 67% rename from lib/Predis/Protocol/IProtocolProcessor.php rename to lib/Predis/Protocol/ProtocolInterface.php index 1a149da1..5595d350 100644 --- a/lib/Predis/Protocol/IProtocolProcessor.php +++ b/lib/Predis/Protocol/ProtocolInterface.php @@ -11,8 +11,8 @@ namespace Predis\Protocol; -use Predis\Commands\ICommand; -use Predis\Network\IConnectionComposable; +use Predis\Command\CommandInterface; +use Predis\Connection\ComposableConnectionInterface; /** * Interface that defines a protocol processor that serializes Redis commands @@ -20,15 +20,15 @@ use Predis\Network\IConnectionComposable; * * @author Daniele Alessandri */ -interface IProtocolProcessor extends IResponseReader +interface ProtocolInterface extends ResponseReaderInterface { /** * Writes a Redis command on the specified connection. * - * @param IConnectionComposable $connection Connection to Redis. - * @param ICommand $command Redis command. + * @param ComposableConnectionInterface $connection Connection to Redis. + * @param CommandInterface $command Redis command. */ - public function write(IConnectionComposable $connection, ICommand $command); + public function write(ComposableConnectionInterface $connection, CommandInterface $command); /** * Sets the options for the protocol processor. diff --git a/lib/Predis/Protocol/IResponseHandler.php b/lib/Predis/Protocol/ResponseHandlerInterface.php similarity index 71% rename from lib/Predis/Protocol/IResponseHandler.php rename to lib/Predis/Protocol/ResponseHandlerInterface.php index fa14ccbb..0ea2ca46 100644 --- a/lib/Predis/Protocol/IResponseHandler.php +++ b/lib/Predis/Protocol/ResponseHandlerInterface.php @@ -11,22 +11,22 @@ namespace Predis\Protocol; -use Predis\Network\IConnectionComposable; +use Predis\Connection\ComposableConnectionInterface; /** * Interface that defines an handler able to parse a reply. * * @author Daniele Alessandri */ -interface IResponseHandler +interface ResponseHandlerInterface { /** * Parses a type of reply returned by Redis and reads more data from the * connection if needed. * - * @param IConnectionComposable $connection Connection to Redis. + * @param ComposableConnectionInterface $connection Connection to Redis. * @param string $payload Initial payload of the reply. * @return mixed */ - function handle(IConnectionComposable $connection, $payload); + function handle(ComposableConnectionInterface $connection, $payload); } diff --git a/lib/Predis/Protocol/IResponseReader.php b/lib/Predis/Protocol/ResponseReaderInterface.php similarity index 71% rename from lib/Predis/Protocol/IResponseReader.php rename to lib/Predis/Protocol/ResponseReaderInterface.php index f185b247..04281121 100644 --- a/lib/Predis/Protocol/IResponseReader.php +++ b/lib/Predis/Protocol/ResponseReaderInterface.php @@ -11,7 +11,7 @@ namespace Predis\Protocol; -use Predis\Network\IConnectionComposable; +use Predis\Connection\ComposableConnectionInterface; /** * Interface that defines a response reader able to parse replies returned by @@ -19,13 +19,13 @@ use Predis\Network\IConnectionComposable; * * @author Daniele Alessandri */ -interface IResponseReader +interface ResponseReaderInterface { /** * Reads replies from a connection to Redis and deserializes them. * - * @param IConnectionComposable $connection Connection to Redis. + * @param ComposableConnectionInterface $connection Connection to Redis. * @return mixed */ - public function read(IConnectionComposable $connection); + public function read(ComposableConnectionInterface $connection); } diff --git a/lib/Predis/Protocol/Text/ComposableTextProtocol.php b/lib/Predis/Protocol/Text/ComposableTextProtocol.php index 68f5ee5d..f185aeee 100644 --- a/lib/Predis/Protocol/Text/ComposableTextProtocol.php +++ b/lib/Predis/Protocol/Text/ComposableTextProtocol.php @@ -11,11 +11,11 @@ namespace Predis\Protocol\Text; -use Predis\Commands\ICommand; -use Predis\Protocol\IResponseReader; -use Predis\Protocol\ICommandSerializer; -use Predis\Protocol\IComposableProtocolProcessor; -use Predis\Network\IConnectionComposable; +use Predis\Command\CommandInterface; +use Predis\Protocol\ResponseReaderInterface; +use Predis\Protocol\CommandSerializerInterface; +use Predis\Protocol\ComposableProtocolInterface; +use Predis\Connection\ComposableConnectionInterface; /** * Implements a customizable protocol processor that uses the standard Redis @@ -25,7 +25,7 @@ use Predis\Network\IConnectionComposable; * @link http://redis.io/topics/protocol * @author Daniele Alessandri */ -class ComposableTextProtocol implements IComposableProtocolProcessor +class ComposableTextProtocol implements ComposableProtocolInterface { private $serializer; private $reader; @@ -79,7 +79,7 @@ class ComposableTextProtocol implements IComposableProtocolProcessor /** * {@inheritdoc} */ - public function serialize(ICommand $command) + public function serialize(CommandInterface $command) { return $this->serializer->serialize($command); } @@ -87,7 +87,7 @@ class ComposableTextProtocol implements IComposableProtocolProcessor /** * {@inheritdoc} */ - public function write(IConnectionComposable $connection, ICommand $command) + public function write(ComposableConnectionInterface $connection, CommandInterface $command) { $connection->writeBytes($this->serializer->serialize($command)); } @@ -95,7 +95,7 @@ class ComposableTextProtocol implements IComposableProtocolProcessor /** * {@inheritdoc} */ - public function read(IConnectionComposable $connection) + public function read(ComposableConnectionInterface $connection) { return $this->reader->read($connection); } @@ -103,7 +103,7 @@ class ComposableTextProtocol implements IComposableProtocolProcessor /** * {@inheritdoc} */ - public function setSerializer(ICommandSerializer $serializer) + public function setSerializer(CommandSerializerInterface $serializer) { $this->serializer = $serializer; } @@ -119,7 +119,7 @@ class ComposableTextProtocol implements IComposableProtocolProcessor /** * {@inheritdoc} */ - public function setReader(IResponseReader $reader) + public function setReader(ResponseReaderInterface $reader) { $this->reader = $reader; } diff --git a/lib/Predis/Protocol/Text/ResponseBulkHandler.php b/lib/Predis/Protocol/Text/ResponseBulkHandler.php index f709480b..1c15ef46 100644 --- a/lib/Predis/Protocol/Text/ResponseBulkHandler.php +++ b/lib/Predis/Protocol/Text/ResponseBulkHandler.php @@ -12,9 +12,9 @@ namespace Predis\Protocol\Text; use Predis\Helpers; -use Predis\Protocol\IResponseHandler; +use Predis\Protocol\ResponseHandlerInterface; use Predis\Protocol\ProtocolException; -use Predis\Network\IConnectionComposable; +use Predis\Connection\ComposableConnectionInterface; /** * Implements a response handler for bulk replies using the standard wire @@ -23,16 +23,16 @@ use Predis\Network\IConnectionComposable; * @link http://redis.io/topics/protocol * @author Daniele Alessandri */ -class ResponseBulkHandler implements IResponseHandler +class ResponseBulkHandler implements ResponseHandlerInterface { /** * Handles a bulk reply returned by Redis. * - * @param IConnectionComposable $connection Connection to Redis. + * @param ComposableConnectionInterface $connection Connection to Redis. * @param string $lengthString Bytes size of the bulk reply. * @return string */ - public function handle(IConnectionComposable $connection, $lengthString) + public function handle(ComposableConnectionInterface $connection, $lengthString) { $length = (int) $lengthString; diff --git a/lib/Predis/Protocol/Text/ResponseErrorHandler.php b/lib/Predis/Protocol/Text/ResponseErrorHandler.php index 724b7076..3f71c4a8 100644 --- a/lib/Predis/Protocol/Text/ResponseErrorHandler.php +++ b/lib/Predis/Protocol/Text/ResponseErrorHandler.php @@ -12,8 +12,8 @@ namespace Predis\Protocol\Text; use Predis\ServerException; -use Predis\Protocol\IResponseHandler; -use Predis\Network\IConnectionComposable; +use Predis\Protocol\ResponseHandlerInterface; +use Predis\Connection\ComposableConnectionInterface; /** * Implements a response handler for error replies using the standard wire @@ -25,12 +25,12 @@ use Predis\Network\IConnectionComposable; * @link http://redis.io/topics/protocol * @author Daniele Alessandri */ -class ResponseErrorHandler implements IResponseHandler +class ResponseErrorHandler implements ResponseHandlerInterface { /** * {@inheritdoc} */ - public function handle(IConnectionComposable $connection, $errorMessage) + public function handle(ComposableConnectionInterface $connection, $errorMessage) { throw new ServerException($errorMessage); } diff --git a/lib/Predis/Protocol/Text/ResponseErrorSilentHandler.php b/lib/Predis/Protocol/Text/ResponseErrorSilentHandler.php index 48390918..292dcc6f 100644 --- a/lib/Predis/Protocol/Text/ResponseErrorSilentHandler.php +++ b/lib/Predis/Protocol/Text/ResponseErrorSilentHandler.php @@ -12,8 +12,8 @@ namespace Predis\Protocol\Text; use Predis\ResponseError; -use Predis\Protocol\IResponseHandler; -use Predis\Network\IConnectionComposable; +use Predis\Protocol\ResponseHandlerInterface; +use Predis\Connection\ComposableConnectionInterface; /** * Implements a response handler for error replies using the standard wire @@ -25,12 +25,12 @@ use Predis\Network\IConnectionComposable; * @link http://redis.io/topics/protocol * @author Daniele Alessandri */ -class ResponseErrorSilentHandler implements IResponseHandler +class ResponseErrorSilentHandler implements ResponseHandlerInterface { /** * {@inheritdoc} */ - public function handle(IConnectionComposable $connection, $errorMessage) + public function handle(ComposableConnectionInterface $connection, $errorMessage) { return new ResponseError($errorMessage); } diff --git a/lib/Predis/Protocol/Text/ResponseIntegerHandler.php b/lib/Predis/Protocol/Text/ResponseIntegerHandler.php index 03aa8c86..0517d46f 100644 --- a/lib/Predis/Protocol/Text/ResponseIntegerHandler.php +++ b/lib/Predis/Protocol/Text/ResponseIntegerHandler.php @@ -12,9 +12,9 @@ namespace Predis\Protocol\Text; use Predis\Helpers; -use Predis\Protocol\IResponseHandler; +use Predis\Protocol\ResponseHandlerInterface; use Predis\Protocol\ProtocolException; -use Predis\Network\IConnectionComposable; +use Predis\Connection\ComposableConnectionInterface; /** * Implements a response handler for integer replies using the standard wire @@ -23,16 +23,16 @@ use Predis\Network\IConnectionComposable; * @link http://redis.io/topics/protocol * @author Daniele Alessandri */ -class ResponseIntegerHandler implements IResponseHandler +class ResponseIntegerHandler implements ResponseHandlerInterface { /** * Handles an integer reply returned by Redis. * - * @param IConnectionComposable $connection Connection to Redis. + * @param ComposableConnectionInterface $connection Connection to Redis. * @param string $number String representation of an integer. * @return int */ - public function handle(IConnectionComposable $connection, $number) + public function handle(ComposableConnectionInterface $connection, $number) { if (is_numeric($number)) { return (int) $number; diff --git a/lib/Predis/Protocol/Text/ResponseMultiBulkHandler.php b/lib/Predis/Protocol/Text/ResponseMultiBulkHandler.php index 6a137482..8547d8fd 100644 --- a/lib/Predis/Protocol/Text/ResponseMultiBulkHandler.php +++ b/lib/Predis/Protocol/Text/ResponseMultiBulkHandler.php @@ -12,9 +12,9 @@ namespace Predis\Protocol\Text; use Predis\Helpers; -use Predis\Protocol\IResponseHandler; +use Predis\Protocol\ResponseHandlerInterface; use Predis\Protocol\ProtocolException; -use Predis\Network\IConnectionComposable; +use Predis\Connection\ComposableConnectionInterface; /** * Implements a response handler for multi-bulk replies using the standard @@ -23,16 +23,16 @@ use Predis\Network\IConnectionComposable; * @link http://redis.io/topics/protocol * @author Daniele Alessandri */ -class ResponseMultiBulkHandler implements IResponseHandler +class ResponseMultiBulkHandler implements ResponseHandlerInterface { /** * Handles a multi-bulk reply returned by Redis. * - * @param IConnectionComposable $connection Connection to Redis. + * @param ComposableConnectionInterface $connection Connection to Redis. * @param string $lengthString Number of items in the multi-bulk reply. * @return array */ - public function handle(IConnectionComposable $connection, $lengthString) + public function handle(ComposableConnectionInterface $connection, $lengthString) { $length = (int) $lengthString; diff --git a/lib/Predis/Protocol/Text/ResponseMultiBulkStreamHandler.php b/lib/Predis/Protocol/Text/ResponseMultiBulkStreamHandler.php index 37dba45b..44f44725 100644 --- a/lib/Predis/Protocol/Text/ResponseMultiBulkStreamHandler.php +++ b/lib/Predis/Protocol/Text/ResponseMultiBulkStreamHandler.php @@ -12,10 +12,10 @@ namespace Predis\Protocol\Text; use Predis\Helpers; -use Predis\Protocol\IResponseHandler; +use Predis\Protocol\ResponseHandlerInterface; use Predis\Protocol\ProtocolException; -use Predis\Network\IConnectionComposable; -use Predis\Iterators\MultiBulkResponseSimple; +use Predis\Connection\ComposableConnectionInterface; +use Predis\Iterator\MultiBulkResponseSimple; /** * Implements a response handler for iterable multi-bulk replies using the @@ -24,16 +24,16 @@ use Predis\Iterators\MultiBulkResponseSimple; * @link http://redis.io/topics/protocol * @author Daniele Alessandri */ -class ResponseMultiBulkStreamHandler implements IResponseHandler +class ResponseMultiBulkStreamHandler implements ResponseHandlerInterface { /** * Handles a multi-bulk reply returned by Redis in a streamable fashion. * - * @param IConnectionComposable $connection Connection to Redis. + * @param ComposableConnectionInterface $connection Connection to Redis. * @param string $lengthString Number of items in the multi-bulk reply. * @return MultiBulkResponseSimple */ - public function handle(IConnectionComposable $connection, $lengthString) + public function handle(ComposableConnectionInterface $connection, $lengthString) { $length = (int) $lengthString; diff --git a/lib/Predis/Protocol/Text/ResponseStatusHandler.php b/lib/Predis/Protocol/Text/ResponseStatusHandler.php index 79bd54af..07dd52d0 100644 --- a/lib/Predis/Protocol/Text/ResponseStatusHandler.php +++ b/lib/Predis/Protocol/Text/ResponseStatusHandler.php @@ -12,8 +12,8 @@ namespace Predis\Protocol\Text; use Predis\ResponseQueued; -use Predis\Protocol\IResponseHandler; -use Predis\Network\IConnectionComposable; +use Predis\Protocol\ResponseHandlerInterface; +use Predis\Connection\ComposableConnectionInterface; /** * Implements a response handler for status replies using the standard wire @@ -22,12 +22,12 @@ use Predis\Network\IConnectionComposable; * @link http://redis.io/topics/protocol * @author Daniele Alessandri */ -class ResponseStatusHandler implements IResponseHandler +class ResponseStatusHandler implements ResponseHandlerInterface { /** * {@inheritdoc} */ - public function handle(IConnectionComposable $connection, $status) + public function handle(ComposableConnectionInterface $connection, $status) { switch ($status) { case 'OK': diff --git a/lib/Predis/Protocol/Text/TextCommandSerializer.php b/lib/Predis/Protocol/Text/TextCommandSerializer.php index 3e0357d1..c16b277c 100644 --- a/lib/Predis/Protocol/Text/TextCommandSerializer.php +++ b/lib/Predis/Protocol/Text/TextCommandSerializer.php @@ -11,8 +11,8 @@ namespace Predis\Protocol\Text; -use Predis\Commands\ICommand; -use Predis\Protocol\ICommandSerializer; +use Predis\Command\CommandInterface; +use Predis\Protocol\CommandSerializerInterface; /** * Implements a pluggable command serializer using the standard wire protocol @@ -21,12 +21,12 @@ use Predis\Protocol\ICommandSerializer; * @link http://redis.io/topics/protocol * @author Daniele Alessandri */ -class TextCommandSerializer implements ICommandSerializer +class TextCommandSerializer implements CommandSerializerInterface { /** * {@inheritdoc} */ - public function serialize(ICommand $command) + public function serialize(CommandInterface $command) { $commandId = $command->getId(); $arguments = $command->getArguments(); diff --git a/lib/Predis/Protocol/Text/TextProtocol.php b/lib/Predis/Protocol/Text/TextProtocol.php index 068f9912..b52aa45e 100644 --- a/lib/Predis/Protocol/Text/TextProtocol.php +++ b/lib/Predis/Protocol/Text/TextProtocol.php @@ -15,11 +15,11 @@ use Predis\Helpers; use Predis\ResponseError; use Predis\ResponseQueued; use Predis\ServerException; -use Predis\Commands\ICommand; -use Predis\Protocol\IProtocolProcessor; +use Predis\Command\CommandInterface; +use Predis\Protocol\ProtocolInterface; use Predis\Protocol\ProtocolException; -use Predis\Network\IConnectionComposable; -use Predis\Iterators\MultiBulkResponseSimple; +use Predis\Connection\ComposableConnectionInterface; +use Predis\Iterator\MultiBulkResponseSimple; /** * Implements a protocol processor for the standard wire protocol defined by Redis. @@ -27,7 +27,7 @@ use Predis\Iterators\MultiBulkResponseSimple; * @link http://redis.io/topics/protocol * @author Daniele Alessandri */ -class TextProtocol implements IProtocolProcessor +class TextProtocol implements ProtocolInterface { const NEWLINE = "\r\n"; const OK = 'OK'; @@ -60,7 +60,7 @@ class TextProtocol implements IProtocolProcessor /** * {@inheritdoc} */ - public function write(IConnectionComposable $connection, ICommand $command) + public function write(ComposableConnectionInterface $connection, CommandInterface $command) { $connection->writeBytes($this->serializer->serialize($command)); } @@ -68,7 +68,7 @@ class TextProtocol implements IProtocolProcessor /** * {@inheritdoc} */ - public function read(IConnectionComposable $connection) + public function read(ComposableConnectionInterface $connection) { $chunk = $connection->readLine(); $prefix = $chunk[0]; diff --git a/lib/Predis/Protocol/Text/TextResponseReader.php b/lib/Predis/Protocol/Text/TextResponseReader.php index 764b2055..e6acce40 100644 --- a/lib/Predis/Protocol/Text/TextResponseReader.php +++ b/lib/Predis/Protocol/Text/TextResponseReader.php @@ -12,10 +12,10 @@ namespace Predis\Protocol\Text; use Predis\Helpers; -use Predis\Protocol\IResponseReader; -use Predis\Protocol\IResponseHandler; +use Predis\Protocol\ResponseReaderInterface; +use Predis\Protocol\ResponseHandlerInterface; use Predis\Protocol\ProtocolException; -use Predis\Network\IConnectionComposable; +use Predis\Connection\ComposableConnectionInterface; /** * Implements a pluggable response reader using the standard wire protocol @@ -24,7 +24,7 @@ use Predis\Network\IConnectionComposable; * @link http://redis.io/topics/protocol * @author Daniele Alessandri */ -class TextResponseReader implements IResponseReader +class TextResponseReader implements ResponseReaderInterface { private $handlers; @@ -56,9 +56,9 @@ class TextResponseReader implements IResponseReader * reply that can be returned by Redis. * * @param string $prefix Identifier for a type of reply. - * @param IResponseHandler $handler Response handler for the reply. + * @param ResponseHandlerInterface $handler Response handler for the reply. */ - public function setHandler($prefix, IResponseHandler $handler) + public function setHandler($prefix, ResponseHandlerInterface $handler) { $this->handlers[$prefix] = $handler; } @@ -68,7 +68,7 @@ class TextResponseReader implements IResponseReader * can be returned by Redis. * * @param string $prefix Identifier for a type of reply. - * @return IResponseHandler + * @return ResponseHandlerInterface */ public function getHandler($prefix) { @@ -80,7 +80,7 @@ class TextResponseReader implements IResponseReader /** * {@inheritdoc} */ - public function read(IConnectionComposable $connection) + public function read(ComposableConnectionInterface $connection) { $header = $connection->readLine(); if ($header === '') { @@ -101,10 +101,10 @@ class TextResponseReader implements IResponseReader * Helper method used to handle a protocol error generated while reading a * reply from a connection to Redis. * - * @param IConnectionComposable $connection Connection to Redis that generated the error. + * @param ComposableConnectionInterface $connection Connection to Redis that generated the error. * @param string $message Error message. */ - private function protocolError(IConnectionComposable $connection, $message) + private function protocolError(ComposableConnectionInterface $connection, $message) { Helpers::onCommunicationException(new ProtocolException($connection, $message)); } diff --git a/lib/Predis/ResponseError.php b/lib/Predis/ResponseError.php index d67400b5..f6f310ea 100644 --- a/lib/Predis/ResponseError.php +++ b/lib/Predis/ResponseError.php @@ -17,7 +17,7 @@ namespace Predis; * * @author Daniele Alessandri */ -class ResponseError implements IRedisServerError +class ResponseError implements ResponseErrorInterface { private $message; diff --git a/lib/Predis/IRedisServerError.php b/lib/Predis/ResponseErrorInterface.php similarity index 91% rename from lib/Predis/IRedisServerError.php rename to lib/Predis/ResponseErrorInterface.php index 34cb5f0f..8c1a0054 100644 --- a/lib/Predis/IRedisServerError.php +++ b/lib/Predis/ResponseErrorInterface.php @@ -17,7 +17,7 @@ namespace Predis; * * @author Daniele Alessandri */ -interface IRedisServerError extends IReplyObject +interface ResponseErrorInterface extends ResponseObjectInterface { /** * Returns the error message diff --git a/lib/Predis/IReplyObject.php b/lib/Predis/ResponseObjectInterface.php similarity index 91% rename from lib/Predis/IReplyObject.php rename to lib/Predis/ResponseObjectInterface.php index 29f63529..ba81783e 100644 --- a/lib/Predis/IReplyObject.php +++ b/lib/Predis/ResponseObjectInterface.php @@ -16,6 +16,6 @@ namespace Predis; * * @author Daniele Alessandri */ -interface IReplyObject +interface ResponseObjectInterface { } diff --git a/lib/Predis/ResponseQueued.php b/lib/Predis/ResponseQueued.php index 31f4f4b5..c9786fbb 100644 --- a/lib/Predis/ResponseQueued.php +++ b/lib/Predis/ResponseQueued.php @@ -17,7 +17,7 @@ namespace Predis; * * @author Daniele Alessandri */ -class ResponseQueued implements IReplyObject +class ResponseQueued implements ResponseObjectInterface { /** * Converts the object to its string representation. diff --git a/lib/Predis/ServerException.php b/lib/Predis/ServerException.php index 15d898b1..4c1bfad8 100644 --- a/lib/Predis/ServerException.php +++ b/lib/Predis/ServerException.php @@ -16,7 +16,7 @@ namespace Predis; * * @author Daniele Alessandri */ -class ServerException extends PredisException implements IRedisServerError +class ServerException extends PredisException implements ResponseErrorInterface { /** * Gets the type of the error returned by Redis. diff --git a/lib/Predis/Transaction/MultiExecContext.php b/lib/Predis/Transaction/MultiExecContext.php index e1a525e8..b57cd723 100644 --- a/lib/Predis/Transaction/MultiExecContext.php +++ b/lib/Predis/Transaction/MultiExecContext.php @@ -16,7 +16,7 @@ use Predis\Helpers; use Predis\ResponseQueued; use Predis\ClientException; use Predis\ServerException; -use Predis\Commands\ICommand; +use Predis\Command\CommandInterface; use Predis\NotSupportedException; use Predis\CommunicationException; use Predis\Protocol\ProtocolException; @@ -194,10 +194,10 @@ class MultiExecContext /** * Executes the specified Redis command. * - * @param ICommand $command A Redis command. + * @param CommandInterface $command A Redis command. * @return mixed */ - public function executeCommand(ICommand $command) + public function executeCommand(CommandInterface $command) { $this->initialize(); @@ -431,7 +431,7 @@ class MultiExecContext { // Since a MULTI/EXEC block cannot be initialized over a clustered // connection, we can safely assume that Predis\Client::getConnection() - // will always return an instance of Predis\Network\IConnectionSingle. + // will always return an instance of Predis\Connection\SingleConnectionInterface. Helpers::onCommunicationException(new ProtocolException( $this->client->getConnection(), $message )); diff --git a/tests/PHPUnit/CommandTestCase.php b/tests/PHPUnit/CommandTestCase.php index 0a144910..6f4ed9ef 100644 --- a/tests/PHPUnit/CommandTestCase.php +++ b/tests/PHPUnit/CommandTestCase.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; use Predis\Client; -use Predis\Profiles\ServerProfile; -use Predis\Profiles\IServerProfile; +use Predis\Profile\ServerProfile; +use Predis\Profile\ServerProfileInterface; /** * @@ -25,7 +25,7 @@ abstract class CommandTestCase extends StandardTestCase /** * Returns the expected command. * - * @return ICommand|string Instance or FQN of the expected command. + * @return CommandInterface|string Instance or FQN of the expected command. */ protected abstract function getExpectedCommand(); @@ -39,19 +39,19 @@ abstract class CommandTestCase extends StandardTestCase /** * Returns a new command instance. * - * @return ICommand + * @return CommandInterface */ protected function getCommand() { $command = $this->getExpectedCommand(); - return $command instanceof ICommand ? $command : new $command(); + return $command instanceof CommandInterface ? $command : new $command(); } /** * Return the server profile used during the tests. * - * @return IServerProfile + * @return ServerProfileInterface */ protected function getProfile() { @@ -99,14 +99,14 @@ abstract class CommandTestCase extends StandardTestCase */ protected function isPrefixable() { - return $this->getCommand() instanceof IPrefixable; + return $this->getCommand() instanceof PrefixableCommandInterface; } /** * Returns a new command instance with the specified arguments. * * @param ... List of arguments for the command. - * @return ICommand + * @return CommandInterface */ protected function getCommandWithArguments(/* arguments */) { @@ -117,7 +117,7 @@ abstract class CommandTestCase extends StandardTestCase * Returns a new command instance with the specified arguments. * * @param array $arguments Arguments for the command. - * @return ICommand + * @return CommandInterface */ protected function getCommandWithArgumentsArray(Array $arguments) { @@ -155,7 +155,7 @@ abstract class CommandTestCase extends StandardTestCase { $command = $this->getCommand(); - $this->assertInstanceOf('Predis\Commands\ICommand', $command); + $this->assertInstanceOf('Predis\Command\CommandInterface', $command); $this->assertEquals($this->getExpectedId(), $command->getId()); } diff --git a/tests/PHPUnit/ConnectionTestCase.php b/tests/PHPUnit/ConnectionTestCase.php index b42430b0..135b368c 100644 --- a/tests/PHPUnit/ConnectionTestCase.php +++ b/tests/PHPUnit/ConnectionTestCase.php @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; use \PHPUnit_Framework_TestCase as StandardTestCase; use Predis\ConnectionParameters; -use Predis\Profiles\ServerProfile; +use Predis\Profile\ServerProfile; /** * @group realm-connection @@ -24,7 +24,7 @@ abstract class ConnectionTestCase extends StandardTestCase /** * @group disconnected * @group slow - * @expectedException Predis\Network\ConnectionException + * @expectedException Predis\Connection\ConnectionException */ public function testThrowExceptionWhenUnableToConnect() { @@ -308,7 +308,7 @@ abstract class ConnectionTestCase extends StandardTestCase /** * @group connected * @group slow - * @expectedException Predis\Network\ConnectionException + * @expectedException Predis\Connection\ConnectionException * @expectedExceptionMessage Connection timed out */ public function testThrowsExceptionOnConnectionTimeout() @@ -321,7 +321,7 @@ abstract class ConnectionTestCase extends StandardTestCase /** * @group connected * @group slow - * @expectedException Predis\Network\ConnectionException + * @expectedException Predis\Connection\ConnectionException */ public function testThrowsExceptionOnReadWriteTimeout() { diff --git a/tests/PHPUnit/DistributionStrategyTestCase.php b/tests/PHPUnit/DistributionStrategyTestCase.php index 3cd1623c..1cc8ce79 100644 --- a/tests/PHPUnit/DistributionStrategyTestCase.php +++ b/tests/PHPUnit/DistributionStrategyTestCase.php @@ -21,23 +21,23 @@ abstract class DistributionStrategyTestCase extends StandardTestCase /** * Returns a new instance of the tested distributor. * - * @return Predis\Distribution\IDistributionStrategy + * @return Predis\Distribution\DistributionStrategyInterface */ protected abstract function getDistributorInstance(); /** * Returns a list of nodes from the hashring. * - * @param IDistributionStrategy $ring Hashring instance. + * @param DistributionStrategyInterface $ring Hashring instance. * @param int $iterations Number of nodes to fetch. * @return array Nodes from the hashring. */ - protected function getNodes(IDistributionStrategy $ring, $iterations = 10) + protected function getNodes(DistributionStrategyInterface $ring, $iterations = 10) { $nodes = array(); for ($i = 0; $i < $iterations; $i++) { - $key = $ring->generateKey($i * $i); + $key = $ring->hash($i * $i); $nodes[] = $ring->get($key); } diff --git a/tests/PHPUnit/ServerVersionTestCase.php b/tests/PHPUnit/ServerVersionTestCase.php index 5e19bad7..aef28a34 100644 --- a/tests/PHPUnit/ServerVersionTestCase.php +++ b/tests/PHPUnit/ServerVersionTestCase.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Profiles; +namespace Predis\Profile; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -21,7 +21,7 @@ abstract class ServerVersionTestCase extends StandardTestCase /** * Returns a new instance of the tested profile. * - * @return Predis\Profiles\IServerProfile + * @return ServerProfileInterface */ protected abstract function getProfileInstance(); @@ -43,10 +43,10 @@ abstract class ServerVersionTestCase extends StandardTestCase * Returns the list of commands supported by the current * server profile. * - * @param IServerProfile $profile Server profile instance. + * @param ServerProfileInterface $profile Server profile instance. * @return array */ - protected function getCommands(IServerProfile $profile) + protected function getCommands(ServerProfileInterface $profile) { $commands = $profile->getSupportedCommands(); diff --git a/tests/Predis/ClientTest.php b/tests/Predis/ClientTest.php index b7b3bfae..5b650a1e 100644 --- a/tests/Predis/ClientTest.php +++ b/tests/Predis/ClientTest.php @@ -13,9 +13,9 @@ namespace Predis; use \PHPUnit_Framework_TestCase as StandardTestCase; -use Predis\Profiles\ServerProfile; -use Predis\Network\PredisCluster; -use Predis\Network\MasterSlaveReplication; +use Predis\Profile\ServerProfile; +use Predis\Connection\PredisCluster; +use Predis\Connection\MasterSlaveReplication; /** * @@ -30,7 +30,7 @@ class ClientTest extends StandardTestCase $client = new Client(); $connection = $client->getConnection(); - $this->assertInstanceOf('Predis\Network\IConnectionSingle', $connection); + $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection); $parameters = $connection->getParameters(); $this->assertSame($parameters->host, '127.0.0.1'); @@ -50,7 +50,7 @@ class ClientTest extends StandardTestCase $client = new Client(null); $connection = $client->getConnection(); - $this->assertInstanceOf('Predis\Network\IConnectionSingle', $connection); + $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection); $parameters = $connection->getParameters(); $this->assertSame($parameters->host, '127.0.0.1'); @@ -70,7 +70,7 @@ class ClientTest extends StandardTestCase $client = new Client(null, null); $connection = $client->getConnection(); - $this->assertInstanceOf('Predis\Network\IConnectionSingle', $connection); + $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection); $parameters = $connection->getParameters(); $this->assertSame($parameters->host, '127.0.0.1'); @@ -106,7 +106,7 @@ class ClientTest extends StandardTestCase $client = new Client($arg1); - $this->assertInstanceOf('Predis\Network\IConnectionCluster', $client->getConnection()); + $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $client->getConnection()); } /** @@ -128,7 +128,7 @@ class ClientTest extends StandardTestCase { $client = new Client($arg1 = array('tcp://localhost:7000', 'tcp://localhost:7001')); - $this->assertInstanceOf('Predis\Network\IConnectionCluster', $client->getConnection()); + $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $client->getConnection()); } /** @@ -136,12 +136,12 @@ class ClientTest extends StandardTestCase */ public function testConstructorWithArrayOfConnectionsArgument() { - $connection1 = $this->getMock('Predis\Network\IConnectionSingle'); - $connection2 = $this->getMock('Predis\Network\IConnectionSingle'); + $connection1 = $this->getMock('Predis\Connection\SingleConnectionInterface'); + $connection2 = $this->getMock('Predis\Connection\SingleConnectionInterface'); $client = new Client(array($connection1, $connection2)); - $this->assertInstanceOf('Predis\Network\IConnectionCluster', $cluster = $client->getConnection()); + $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $cluster = $client->getConnection()); $this->assertSame($connection1, $cluster->getConnectionById(0)); $this->assertSame($connection2, $cluster->getConnectionById(1)); } @@ -156,7 +156,7 @@ class ClientTest extends StandardTestCase $client = new Client($connection); - $this->assertInstanceOf('Predis\Network\IConnectionSingle', $client->getConnection()); + $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $client->getConnection()); $this->assertSame($connection, $client->getConnection()); $parameters = $client->getConnection()->getParameters(); @@ -176,7 +176,7 @@ class ClientTest extends StandardTestCase $client = new Client($cluster); - $this->assertInstanceOf('Predis\Network\IConnectionCluster', $client->getConnection()); + $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $client->getConnection()); $this->assertSame($cluster, $client->getConnection()); } @@ -192,7 +192,7 @@ class ClientTest extends StandardTestCase $client = new Client($replication); - $this->assertInstanceOf('Predis\Network\IConnectionReplication', $client->getConnection()); + $this->assertInstanceOf('Predis\Connection\ReplicationConnectionInterface', $client->getConnection()); $this->assertSame($replication, $client->getConnection()); } @@ -221,14 +221,14 @@ class ClientTest extends StandardTestCase */ public function testConstructorWithNullAndArrayArgument() { - $factory = $this->getMock('Predis\IConnectionFactory'); + $factory = $this->getMock('Predis\ConnectionFactoryInterface'); $arg2 = array('profile' => '2.0', 'prefix' => 'prefix:', 'connections' => $factory); $client = new Client(null, $arg2); $profile = $client->getProfile(); $this->assertSame($profile->getVersion(), ServerProfile::get('2.0')->getVersion()); - $this->assertInstanceOf('Predis\Commands\Processors\KeyPrefixProcessor', $profile->getProcessor()); + $this->assertInstanceOf('Predis\Command\Processor\KeyPrefixProcessor', $profile->getProcessor()); $this->assertSame('prefix:', $profile->getProcessor()->getPrefix()); $this->assertSame($factory, $client->getConnectionFactory()); @@ -243,7 +243,7 @@ class ClientTest extends StandardTestCase $arg2 = array('replication' => true); $client = new Client($arg1, $arg2); - $this->assertInstanceOf('Predis\Network\IConnectionReplication', $connection = $client->getConnection()); + $this->assertInstanceOf('Predis\Connection\ReplicationConnectionInterface', $connection = $client->getConnection()); $this->assertSame('host1', $connection->getConnectionById('master')->getParameters()->host); $this->assertSame('host2', $connection->getConnectionById('slave')->getParameters()->host); } @@ -253,7 +253,7 @@ class ClientTest extends StandardTestCase */ public function testConnectAndDisconnect() { - $connection = $this->getMock('Predis\Network\IConnection'); + $connection = $this->getMock('Predis\Connection\ConnectionInterface'); $connection->expects($this->once())->method('connect'); $connection->expects($this->once())->method('disconnect'); @@ -267,7 +267,7 @@ class ClientTest extends StandardTestCase */ public function testIsConnectedChecksConnectionState() { - $connection = $this->getMock('Predis\Network\IConnection'); + $connection = $this->getMock('Predis\Connection\ConnectionInterface'); $connection->expects($this->once())->method('isConnected'); $client = new Client($connection); @@ -279,7 +279,7 @@ class ClientTest extends StandardTestCase */ public function testQuitIsAliasForDisconnect() { - $connection = $this->getMock('Predis\Network\IConnection'); + $connection = $this->getMock('Predis\Connection\ConnectionInterface'); $connection->expects($this->once())->method('disconnect'); $client = new Client($connection); @@ -293,7 +293,7 @@ class ClientTest extends StandardTestCase { $ping = ServerProfile::getDefault()->createCommand('ping', array()); - $profile = $this->getMock('Predis\Profiles\IServerProfile'); + $profile = $this->getMock('Predis\Profile\ServerProfileInterface'); $profile->expects($this->once()) ->method('createCommand') ->with('ping', array()) @@ -310,7 +310,7 @@ class ClientTest extends StandardTestCase { $ping = ServerProfile::getDefault()->createCommand('ping', array()); - $connection= $this->getMock('Predis\Network\IConnection'); + $connection= $this->getMock('Predis\Connection\ConnectionInterface'); $connection->expects($this->once()) ->method('executeCommand') ->with($ping) @@ -328,13 +328,13 @@ class ClientTest extends StandardTestCase { $ping = ServerProfile::getDefault()->createCommand('ping', array()); - $connection1 = $this->getMock('Predis\Network\IConnectionSingle'); + $connection1 = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection1->expects($this->once()) ->method('executeCommand') ->with($ping) ->will($this->returnValue(true)); - $connection2 = $this->getMock('Predis\Network\IConnectionSingle'); + $connection2 = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection2->expects($this->once()) ->method('executeCommand') ->with($ping) @@ -352,7 +352,7 @@ class ClientTest extends StandardTestCase { $ping = ServerProfile::getDefault()->createCommand('ping', array()); - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->once()) ->method('executeCommand') ->with($ping) @@ -370,13 +370,13 @@ class ClientTest extends StandardTestCase { $ping = ServerProfile::getDefault()->createCommand('ping', array()); - $connection = $this->getMock('Predis\Network\IConnection'); + $connection = $this->getMock('Predis\Connection\ConnectionInterface'); $connection->expects($this->once()) ->method('executeCommand') - ->with($this->isInstanceOf('Predis\Commands\ConnectionPing')) + ->with($this->isInstanceOf('Predis\Command\ConnectionPing')) ->will($this->returnValue(true)); - $profile = $this->getMock('Predis\Profiles\IServerProfile'); + $profile = $this->getMock('Predis\Profile\ServerProfileInterface'); $profile->expects($this->once()) ->method('createCommand') ->with('ping', array()) @@ -405,9 +405,9 @@ class ClientTest extends StandardTestCase { $client = new Client(array('tcp://host1?alias=node01', 'tcp://host2?alias=node02')); - $this->assertInstanceOf('Predis\Network\IConnectionCluster', $cluster = $client->getConnection()); - $this->assertInstanceOf('Predis\Network\IConnectionSingle', $node01 = $client->getConnection('node01')); - $this->assertInstanceOf('Predis\Network\IConnectionSingle', $node02 = $client->getConnection('node02')); + $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $cluster = $client->getConnection()); + $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $node01 = $client->getConnection('node01')); + $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $node02 = $client->getConnection('node02')); $this->assertSame('host1', $node01->getParameters()->host); $this->assertSame('host2', $node02->getParameters()->host); @@ -442,7 +442,7 @@ class ClientTest extends StandardTestCase { $client = new Client(); - $executor = $this->getMock('Predis\Pipeline\IPipelineExecutor'); + $executor = $this->getMock('Predis\Pipeline\PipelineExecutorInterface'); $options = array('executor' => $executor); $this->assertInstanceOf('Predis\Pipeline\PipelineContext', $pipeline = $client->pipeline($options)); @@ -472,7 +472,7 @@ class ClientTest extends StandardTestCase */ public function testPipelineWithArrayAndCallableExecutesPipelineWithOptions() { - $executor = $this->getMock('Predis\Pipeline\IPipelineExecutor'); + $executor = $this->getMock('Predis\Pipeline\PipelineExecutorInterface'); $options = array('executor' => $executor); $test = $this; @@ -508,7 +508,7 @@ class ClientTest extends StandardTestCase */ public function testPubSubWithArrayReturnsPubSubContextWithOptions() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $options = array('subscribe' => 'channel'); $client = new Client($connection); @@ -533,7 +533,7 @@ class ClientTest extends StandardTestCase $message = array('subscribe', 'channel', 0); $options = array('subscribe' => 'channel'); - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->once()) ->method('read') ->will($this->returnValue($message)); @@ -582,7 +582,7 @@ class ClientTest extends StandardTestCase // here is not the point. $options = array('cas' => true, 'retry' => 3); - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->once()) ->method('executeCommand') ->will($this->returnValue(new ResponseQueued())); @@ -603,10 +603,10 @@ class ClientTest extends StandardTestCase */ public function testMonitorReturnsMonitorContext() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $client = new Client($connection); - $this->assertInstanceOf('Predis\MonitorContext', $monitor = $client->monitor()); + $this->assertInstanceOf('Predis\Monitor\MonitorContext', $monitor = $client->monitor()); } // ******************************************************************** // diff --git a/tests/Predis/Commands/CommandTest.php b/tests/Predis/Command/CommandTest.php similarity index 84% rename from tests/Predis/Commands/CommandTest.php rename to tests/Predis/Command/CommandTest.php index bc141ac6..4441bdf1 100644 --- a/tests/Predis/Commands/CommandTest.php +++ b/tests/Predis/Command/CommandTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -23,9 +23,9 @@ class CommandTest extends StandardTestCase */ public function testImplementsCorrectInterface() { - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); - $this->assertInstanceOf('Predis\Commands\ICommand', $command); + $this->assertInstanceOf('Predis\Command\CommandInterface', $command); } /** @@ -33,7 +33,7 @@ class CommandTest extends StandardTestCase */ public function testGetEmptyArguments() { - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $this->assertEmpty($command->getArguments()); } @@ -45,7 +45,7 @@ class CommandTest extends StandardTestCase { $arguments = array('1st', '2nd', '3rd'); - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $command->setRawArguments($arguments); $this->assertEquals($arguments, $command->getArguments()); @@ -54,14 +54,14 @@ class CommandTest extends StandardTestCase /** * @group disconnected * - * @todo Since Command::filterArguments is protected we cannot set an expectation - * for it when Command::setArguments() is invoked. I wonder how we can do that. + * @todo Since AbstractCommand::filterArguments is protected we cannot set an expectation + * for it when AbstractCommand::setArguments() is invoked. I wonder how we can do that. */ public function testSetArguments() { $arguments = array('1st', '2nd', '3rd'); - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $command->setArguments($arguments); $this->assertEquals($arguments, $command->getArguments()); @@ -74,7 +74,7 @@ class CommandTest extends StandardTestCase { $arguments = array('1st', '2nd', '3rd'); - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $command->setArguments($arguments); $this->assertEquals($arguments[0], $command->getArgument(0)); @@ -88,7 +88,7 @@ class CommandTest extends StandardTestCase public function testParseResponse() { $response = 'response-buffer'; - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $this->assertEquals($response, $command->parseResponse($response)); } @@ -99,7 +99,7 @@ class CommandTest extends StandardTestCase */ public function testCheckSameHashForKeys() { - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $checkSameHashForKeys = new \ReflectionMethod($command, 'checkSameHashForKeys'); $checkSameHashForKeys->setAccessible(true); @@ -114,7 +114,7 @@ class CommandTest extends StandardTestCase */ public function testCanBeHashed() { - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $canBeHashed = new \ReflectionMethod($command, 'canBeHashed'); $canBeHashed->setAccessible(true); @@ -130,10 +130,10 @@ class CommandTest extends StandardTestCase */ public function testDoesNotReturnAnHashByDefault() { - $distributor = $this->getMock('Predis\Distribution\INodeKeyGenerator'); - $distributor->expects($this->never())->method('generateKey'); + $distributor = $this->getMock('Predis\Distribution\HashGeneratorInterface'); + $distributor->expects($this->never())->method('hash'); - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $command->getHash($distributor); } @@ -146,13 +146,13 @@ class CommandTest extends StandardTestCase $key = 'key'; $hash = "$key-hash"; - $distributor = $this->getMock('Predis\Distribution\INodeKeyGenerator'); + $distributor = $this->getMock('Predis\Distribution\HashGeneratorInterface'); $distributor->expects($this->once()) - ->method('generateKey') + ->method('hash') ->with($key) ->will($this->returnValue($hash)); - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $command->setRawArguments(array($key)); $this->assertEquals($hash, $command->getHash($distributor)); @@ -170,13 +170,13 @@ class CommandTest extends StandardTestCase $key = "{{$tag}}:ignore"; $hash = "$tag-hash"; - $distributor = $this->getMock('Predis\Distribution\INodeKeyGenerator'); + $distributor = $this->getMock('Predis\Distribution\HashGeneratorInterface'); $distributor->expects($this->once()) - ->method('generateKey') + ->method('hash') ->with($tag) ->will($this->returnValue($hash)); - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $command->setRawArguments(array($key)); $this->assertEquals($hash, $command->getHash($distributor)); @@ -190,7 +190,7 @@ class CommandTest extends StandardTestCase $expected = 'SET key value'; $arguments = array('key', 'value'); - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $command->expects($this->once())->method('getId')->will($this->returnValue('SET')); $command->setRawArguments($arguments); @@ -206,7 +206,7 @@ class CommandTest extends StandardTestCase $expected = 'SET key abcdefghijklmnopqrstuvwxyz012345[...]'; $arguments = array('key', 'abcdefghijklmnopqrstuvwxyz0123456789'); - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $command->expects($this->once())->method('getId')->will($this->returnValue('SET')); $command->setRawArguments($arguments); diff --git a/tests/Predis/Commands/ConnectionAuthTest.php b/tests/Predis/Command/ConnectionAuthTest.php similarity index 93% rename from tests/Predis/Commands/ConnectionAuthTest.php rename to tests/Predis/Command/ConnectionAuthTest.php index fdc10f7e..03cd7a32 100644 --- a/tests/Predis/Commands/ConnectionAuthTest.php +++ b/tests/Predis/Command/ConnectionAuthTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ConnectionAuthTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ConnectionAuth'; + return 'Predis\Command\ConnectionAuth'; } /** diff --git a/tests/Predis/Commands/ConnectionEchoTest.php b/tests/Predis/Command/ConnectionEchoTest.php similarity index 95% rename from tests/Predis/Commands/ConnectionEchoTest.php rename to tests/Predis/Command/ConnectionEchoTest.php index 8a61949f..ef7fa775 100644 --- a/tests/Predis/Commands/ConnectionEchoTest.php +++ b/tests/Predis/Command/ConnectionEchoTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ConnectionEchoTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ConnectionEcho'; + return 'Predis\Command\ConnectionEcho'; } /** diff --git a/tests/Predis/Commands/ConnectionPingTest.php b/tests/Predis/Command/ConnectionPingTest.php similarity index 94% rename from tests/Predis/Commands/ConnectionPingTest.php rename to tests/Predis/Command/ConnectionPingTest.php index 6f2f0462..0b60e7ef 100644 --- a/tests/Predis/Commands/ConnectionPingTest.php +++ b/tests/Predis/Command/ConnectionPingTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ConnectionPingTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ConnectionPing'; + return 'Predis\Command\ConnectionPing'; } /** diff --git a/tests/Predis/Commands/ConnectionQuitTest.php b/tests/Predis/Command/ConnectionQuitTest.php similarity index 94% rename from tests/Predis/Commands/ConnectionQuitTest.php rename to tests/Predis/Command/ConnectionQuitTest.php index 90a0032e..70ac484d 100644 --- a/tests/Predis/Commands/ConnectionQuitTest.php +++ b/tests/Predis/Command/ConnectionQuitTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ConnectionQuitTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ConnectionQuit'; + return 'Predis\Command\ConnectionQuit'; } /** diff --git a/tests/Predis/Commands/ConnectionSelectTest.php b/tests/Predis/Command/ConnectionSelectTest.php similarity index 95% rename from tests/Predis/Commands/ConnectionSelectTest.php rename to tests/Predis/Command/ConnectionSelectTest.php index da3a5254..2e9854e0 100644 --- a/tests/Predis/Commands/ConnectionSelectTest.php +++ b/tests/Predis/Command/ConnectionSelectTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ConnectionSelectTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ConnectionSelect'; + return 'Predis\Command\ConnectionSelect'; } /** diff --git a/tests/Predis/Commands/HashDeleteTest.php b/tests/Predis/Command/HashDeleteTest.php similarity index 97% rename from tests/Predis/Commands/HashDeleteTest.php rename to tests/Predis/Command/HashDeleteTest.php index ba713e5a..2aa50267 100644 --- a/tests/Predis/Commands/HashDeleteTest.php +++ b/tests/Predis/Command/HashDeleteTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashDeleteTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashDelete'; + return 'Predis\Command\HashDelete'; } /** diff --git a/tests/Predis/Commands/HashExistsTest.php b/tests/Predis/Command/HashExistsTest.php similarity index 96% rename from tests/Predis/Commands/HashExistsTest.php rename to tests/Predis/Command/HashExistsTest.php index 011811ae..8a105ee5 100644 --- a/tests/Predis/Commands/HashExistsTest.php +++ b/tests/Predis/Command/HashExistsTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashExistsTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashExists'; + return 'Predis\Command\HashExists'; } /** diff --git a/tests/Predis/Commands/HashGetAllTest.php b/tests/Predis/Command/HashGetAllTest.php similarity index 97% rename from tests/Predis/Commands/HashGetAllTest.php rename to tests/Predis/Command/HashGetAllTest.php index 5c4ad294..acace878 100644 --- a/tests/Predis/Commands/HashGetAllTest.php +++ b/tests/Predis/Command/HashGetAllTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashGetAllTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashGetAll'; + return 'Predis\Command\HashGetAll'; } /** diff --git a/tests/Predis/Commands/HashGetMultipleTest.php b/tests/Predis/Command/HashGetMultipleTest.php similarity index 97% rename from tests/Predis/Commands/HashGetMultipleTest.php rename to tests/Predis/Command/HashGetMultipleTest.php index 6a8b848b..c4b65d96 100644 --- a/tests/Predis/Commands/HashGetMultipleTest.php +++ b/tests/Predis/Command/HashGetMultipleTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashGetMultipleTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashGetMultiple'; + return 'Predis\Command\HashGetMultiple'; } /** diff --git a/tests/Predis/Commands/HashGetTest.php b/tests/Predis/Command/HashGetTest.php similarity index 96% rename from tests/Predis/Commands/HashGetTest.php rename to tests/Predis/Command/HashGetTest.php index 9abc8587..86db161a 100644 --- a/tests/Predis/Commands/HashGetTest.php +++ b/tests/Predis/Command/HashGetTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashGetTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashGet'; + return 'Predis\Command\HashGet'; } /** diff --git a/tests/Predis/Commands/HashIncrementByFloatTest.php b/tests/Predis/Command/HashIncrementByFloatTest.php similarity index 97% rename from tests/Predis/Commands/HashIncrementByFloatTest.php rename to tests/Predis/Command/HashIncrementByFloatTest.php index 36659953..e7ad26ee 100644 --- a/tests/Predis/Commands/HashIncrementByFloatTest.php +++ b/tests/Predis/Command/HashIncrementByFloatTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashIncrementByFloatTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashIncrementByFloat'; + return 'Predis\Command\HashIncrementByFloat'; } /** diff --git a/tests/Predis/Commands/HashIncrementByTest.php b/tests/Predis/Command/HashIncrementByTest.php similarity index 97% rename from tests/Predis/Commands/HashIncrementByTest.php rename to tests/Predis/Command/HashIncrementByTest.php index 327fa3eb..feec9023 100644 --- a/tests/Predis/Commands/HashIncrementByTest.php +++ b/tests/Predis/Command/HashIncrementByTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashIncrementByTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashIncrementBy'; + return 'Predis\Command\HashIncrementBy'; } /** diff --git a/tests/Predis/Commands/HashKeysTest.php b/tests/Predis/Command/HashKeysTest.php similarity index 97% rename from tests/Predis/Commands/HashKeysTest.php rename to tests/Predis/Command/HashKeysTest.php index 46d58b1f..b99dd6d8 100644 --- a/tests/Predis/Commands/HashKeysTest.php +++ b/tests/Predis/Command/HashKeysTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashKeysTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashKeys'; + return 'Predis\Command\HashKeys'; } /** diff --git a/tests/Predis/Commands/HashLengthTest.php b/tests/Predis/Command/HashLengthTest.php similarity index 96% rename from tests/Predis/Commands/HashLengthTest.php rename to tests/Predis/Command/HashLengthTest.php index 444ecf94..622f9270 100644 --- a/tests/Predis/Commands/HashLengthTest.php +++ b/tests/Predis/Command/HashLengthTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashLengthTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashLength'; + return 'Predis\Command\HashLength'; } /** diff --git a/tests/Predis/Commands/HashSetMultipleTest.php b/tests/Predis/Command/HashSetMultipleTest.php similarity index 97% rename from tests/Predis/Commands/HashSetMultipleTest.php rename to tests/Predis/Command/HashSetMultipleTest.php index 14fcb19c..f638cc40 100644 --- a/tests/Predis/Commands/HashSetMultipleTest.php +++ b/tests/Predis/Command/HashSetMultipleTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashSetMultipleTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashSetMultiple'; + return 'Predis\Command\HashSetMultiple'; } /** diff --git a/tests/Predis/Commands/HashSetPreserveTest.php b/tests/Predis/Command/HashSetPreserveTest.php similarity index 96% rename from tests/Predis/Commands/HashSetPreserveTest.php rename to tests/Predis/Command/HashSetPreserveTest.php index a6a51a05..8e38e973 100644 --- a/tests/Predis/Commands/HashSetPreserveTest.php +++ b/tests/Predis/Command/HashSetPreserveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashSetPreserveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashSetPreserve'; + return 'Predis\Command\HashSetPreserve'; } /** diff --git a/tests/Predis/Commands/HashSetTest.php b/tests/Predis/Command/HashSetTest.php similarity index 97% rename from tests/Predis/Commands/HashSetTest.php rename to tests/Predis/Command/HashSetTest.php index a2448a10..a817493a 100644 --- a/tests/Predis/Commands/HashSetTest.php +++ b/tests/Predis/Command/HashSetTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashSetTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashSet'; + return 'Predis\Command\HashSet'; } /** diff --git a/tests/Predis/Commands/HashValuesTest.php b/tests/Predis/Command/HashValuesTest.php similarity index 96% rename from tests/Predis/Commands/HashValuesTest.php rename to tests/Predis/Command/HashValuesTest.php index 853993e1..627a0ddb 100644 --- a/tests/Predis/Commands/HashValuesTest.php +++ b/tests/Predis/Command/HashValuesTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class HashValuesTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\HashValues'; + return 'Predis\Command\HashValues'; } /** diff --git a/tests/Predis/Commands/KeyDeleteTest.php b/tests/Predis/Command/KeyDeleteTest.php similarity index 97% rename from tests/Predis/Commands/KeyDeleteTest.php rename to tests/Predis/Command/KeyDeleteTest.php index d33663a6..5a045c53 100644 --- a/tests/Predis/Commands/KeyDeleteTest.php +++ b/tests/Predis/Command/KeyDeleteTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyDeleteTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyDelete'; + return 'Predis\Command\KeyDelete'; } /** diff --git a/tests/Predis/Commands/KeyExistsTest.php b/tests/Predis/Command/KeyExistsTest.php similarity index 96% rename from tests/Predis/Commands/KeyExistsTest.php rename to tests/Predis/Command/KeyExistsTest.php index 21cb68bc..a87214f4 100644 --- a/tests/Predis/Commands/KeyExistsTest.php +++ b/tests/Predis/Command/KeyExistsTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyExistsTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyExists'; + return 'Predis\Command\KeyExists'; } /** diff --git a/tests/Predis/Commands/KeyExpireAtTest.php b/tests/Predis/Command/KeyExpireAtTest.php similarity index 97% rename from tests/Predis/Commands/KeyExpireAtTest.php rename to tests/Predis/Command/KeyExpireAtTest.php index 9a93a884..e0a81b4e 100644 --- a/tests/Predis/Commands/KeyExpireAtTest.php +++ b/tests/Predis/Command/KeyExpireAtTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyExpireAtTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyExpireAt'; + return 'Predis\Command\KeyExpireAt'; } /** diff --git a/tests/Predis/Commands/KeyExpireTest.php b/tests/Predis/Command/KeyExpireTest.php similarity index 97% rename from tests/Predis/Commands/KeyExpireTest.php rename to tests/Predis/Command/KeyExpireTest.php index 6b472282..5b704bd9 100644 --- a/tests/Predis/Commands/KeyExpireTest.php +++ b/tests/Predis/Command/KeyExpireTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyExpireTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyExpire'; + return 'Predis\Command\KeyExpire'; } /** diff --git a/tests/Predis/Commands/KeyKeysTest.php b/tests/Predis/Command/KeyKeysTest.php similarity index 96% rename from tests/Predis/Commands/KeyKeysTest.php rename to tests/Predis/Command/KeyKeysTest.php index 0ce1c49d..7f1113b5 100644 --- a/tests/Predis/Commands/KeyKeysTest.php +++ b/tests/Predis/Command/KeyKeysTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyKeysTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyKeys'; + return 'Predis\Command\KeyKeys'; } /** diff --git a/tests/Predis/Commands/KeyKeysV12xTest.php b/tests/Predis/Command/KeyKeysV12xTest.php similarity index 95% rename from tests/Predis/Commands/KeyKeysV12xTest.php rename to tests/Predis/Command/KeyKeysV12xTest.php index b29deded..84b44a8a 100644 --- a/tests/Predis/Commands/KeyKeysV12xTest.php +++ b/tests/Predis/Command/KeyKeysV12xTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -28,7 +28,7 @@ class KeyKeysV12xTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyKeysV12x'; + return 'Predis\Command\KeyKeysV12x'; } /** diff --git a/tests/Predis/Commands/KeyMoveTest.php b/tests/Predis/Command/KeyMoveTest.php similarity index 97% rename from tests/Predis/Commands/KeyMoveTest.php rename to tests/Predis/Command/KeyMoveTest.php index 8e6700b0..ec9502e6 100644 --- a/tests/Predis/Commands/KeyMoveTest.php +++ b/tests/Predis/Command/KeyMoveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyMoveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyMove'; + return 'Predis\Command\KeyMove'; } /** diff --git a/tests/Predis/Commands/KeyPersistTest.php b/tests/Predis/Command/KeyPersistTest.php similarity index 96% rename from tests/Predis/Commands/KeyPersistTest.php rename to tests/Predis/Command/KeyPersistTest.php index 2da3c82d..bf9a3252 100644 --- a/tests/Predis/Commands/KeyPersistTest.php +++ b/tests/Predis/Command/KeyPersistTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyPersistTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyPersist'; + return 'Predis\Command\KeyPersist'; } /** diff --git a/tests/Predis/Commands/KeyPreciseExpireAtTest.php b/tests/Predis/Command/KeyPreciseExpireAtTest.php similarity index 96% rename from tests/Predis/Commands/KeyPreciseExpireAtTest.php rename to tests/Predis/Command/KeyPreciseExpireAtTest.php index 81b093d3..72bc7b71 100644 --- a/tests/Predis/Commands/KeyPreciseExpireAtTest.php +++ b/tests/Predis/Command/KeyPreciseExpireAtTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyPreciseExpireAtTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyPreciseExpireAt'; + return 'Predis\Command\KeyPreciseExpireAt'; } /** diff --git a/tests/Predis/Commands/KeyPreciseExpireTest.php b/tests/Predis/Command/KeyPreciseExpireTest.php similarity index 97% rename from tests/Predis/Commands/KeyPreciseExpireTest.php rename to tests/Predis/Command/KeyPreciseExpireTest.php index 0e3ab3cc..d118998f 100644 --- a/tests/Predis/Commands/KeyPreciseExpireTest.php +++ b/tests/Predis/Command/KeyPreciseExpireTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyPreciseExpireTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyPreciseExpire'; + return 'Predis\Command\KeyPreciseExpire'; } /** diff --git a/tests/Predis/Commands/KeyPreciseTimeToLiveTest.php b/tests/Predis/Command/KeyPreciseTimeToLiveTest.php similarity index 96% rename from tests/Predis/Commands/KeyPreciseTimeToLiveTest.php rename to tests/Predis/Command/KeyPreciseTimeToLiveTest.php index 4610fb8c..351a3011 100644 --- a/tests/Predis/Commands/KeyPreciseTimeToLiveTest.php +++ b/tests/Predis/Command/KeyPreciseTimeToLiveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyPreciseTimeToLiveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyPreciseTimeToLive'; + return 'Predis\Command\KeyPreciseTimeToLive'; } /** diff --git a/tests/Predis/Commands/KeyRandomTest.php b/tests/Predis/Command/KeyRandomTest.php similarity index 95% rename from tests/Predis/Commands/KeyRandomTest.php rename to tests/Predis/Command/KeyRandomTest.php index 43ebe387..ac29b2a1 100644 --- a/tests/Predis/Commands/KeyRandomTest.php +++ b/tests/Predis/Command/KeyRandomTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyRandomTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyRandom'; + return 'Predis\Command\KeyRandom'; } /** diff --git a/tests/Predis/Commands/KeyRenamePreserveTest.php b/tests/Predis/Command/KeyRenamePreserveTest.php similarity index 96% rename from tests/Predis/Commands/KeyRenamePreserveTest.php rename to tests/Predis/Command/KeyRenamePreserveTest.php index 4f526de6..f469bcf5 100644 --- a/tests/Predis/Commands/KeyRenamePreserveTest.php +++ b/tests/Predis/Command/KeyRenamePreserveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyRenamePreserveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyRenamePreserve'; + return 'Predis\Command\KeyRenamePreserve'; } /** diff --git a/tests/Predis/Commands/KeyRenameTest.php b/tests/Predis/Command/KeyRenameTest.php similarity index 96% rename from tests/Predis/Commands/KeyRenameTest.php rename to tests/Predis/Command/KeyRenameTest.php index 6875f1af..dd79e348 100644 --- a/tests/Predis/Commands/KeyRenameTest.php +++ b/tests/Predis/Command/KeyRenameTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyRenameTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyRename'; + return 'Predis\Command\KeyRename'; } /** diff --git a/tests/Predis/Commands/KeySortTest.php b/tests/Predis/Command/KeySortTest.php similarity index 99% rename from tests/Predis/Commands/KeySortTest.php rename to tests/Predis/Command/KeySortTest.php index 69f9c9e1..1dba4769 100644 --- a/tests/Predis/Commands/KeySortTest.php +++ b/tests/Predis/Command/KeySortTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeySortTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeySort'; + return 'Predis\Command\KeySort'; } /** diff --git a/tests/Predis/Commands/KeyTimeToLiveTest.php b/tests/Predis/Command/KeyTimeToLiveTest.php similarity index 96% rename from tests/Predis/Commands/KeyTimeToLiveTest.php rename to tests/Predis/Command/KeyTimeToLiveTest.php index 2aec9a91..a7ed5c4f 100644 --- a/tests/Predis/Commands/KeyTimeToLiveTest.php +++ b/tests/Predis/Command/KeyTimeToLiveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyTimeToLiveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyTimeToLive'; + return 'Predis\Command\KeyTimeToLive'; } /** diff --git a/tests/Predis/Commands/KeyTypeTest.php b/tests/Predis/Command/KeyTypeTest.php similarity index 96% rename from tests/Predis/Commands/KeyTypeTest.php rename to tests/Predis/Command/KeyTypeTest.php index 983a1f51..d5e7fccf 100644 --- a/tests/Predis/Commands/KeyTypeTest.php +++ b/tests/Predis/Command/KeyTypeTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class KeyTypeTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\KeyType'; + return 'Predis\Command\KeyType'; } /** diff --git a/tests/Predis/Commands/ListIndexTest.php b/tests/Predis/Command/ListIndexTest.php similarity index 97% rename from tests/Predis/Commands/ListIndexTest.php rename to tests/Predis/Command/ListIndexTest.php index 47fe7993..ab369521 100644 --- a/tests/Predis/Commands/ListIndexTest.php +++ b/tests/Predis/Command/ListIndexTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListIndexTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListIndex'; + return 'Predis\Command\ListIndex'; } /** diff --git a/tests/Predis/Commands/ListInsertTest.php b/tests/Predis/Command/ListInsertTest.php similarity index 97% rename from tests/Predis/Commands/ListInsertTest.php rename to tests/Predis/Command/ListInsertTest.php index 2b561b9d..f7eb4395 100644 --- a/tests/Predis/Commands/ListInsertTest.php +++ b/tests/Predis/Command/ListInsertTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListInsertTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListInsert'; + return 'Predis\Command\ListInsert'; } /** diff --git a/tests/Predis/Commands/ListLengthTest.php b/tests/Predis/Command/ListLengthTest.php similarity index 96% rename from tests/Predis/Commands/ListLengthTest.php rename to tests/Predis/Command/ListLengthTest.php index ab29d1c2..bc34cf58 100644 --- a/tests/Predis/Commands/ListLengthTest.php +++ b/tests/Predis/Command/ListLengthTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListLengthTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListLength'; + return 'Predis\Command\ListLength'; } /** diff --git a/tests/Predis/Commands/ListPopFirstBlockingTest.php b/tests/Predis/Command/ListPopFirstBlockingTest.php similarity index 96% rename from tests/Predis/Commands/ListPopFirstBlockingTest.php rename to tests/Predis/Command/ListPopFirstBlockingTest.php index 2bdb0f19..c9ffcfaa 100644 --- a/tests/Predis/Commands/ListPopFirstBlockingTest.php +++ b/tests/Predis/Command/ListPopFirstBlockingTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -26,7 +26,7 @@ class ListPopFirstBlockingTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListPopFirstBlocking'; + return 'Predis\Command\ListPopFirstBlocking'; } /** diff --git a/tests/Predis/Commands/ListPopFirstTest.php b/tests/Predis/Command/ListPopFirstTest.php similarity index 96% rename from tests/Predis/Commands/ListPopFirstTest.php rename to tests/Predis/Command/ListPopFirstTest.php index 64d3c38a..08a40533 100644 --- a/tests/Predis/Commands/ListPopFirstTest.php +++ b/tests/Predis/Command/ListPopFirstTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListPopFirstTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListPopFirst'; + return 'Predis\Command\ListPopFirst'; } /** diff --git a/tests/Predis/Commands/ListPopLastBlockingTest.php b/tests/Predis/Command/ListPopLastBlockingTest.php similarity index 96% rename from tests/Predis/Commands/ListPopLastBlockingTest.php rename to tests/Predis/Command/ListPopLastBlockingTest.php index d7bd6093..7b1710a0 100644 --- a/tests/Predis/Commands/ListPopLastBlockingTest.php +++ b/tests/Predis/Command/ListPopLastBlockingTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -26,7 +26,7 @@ class ListPopLastBlockingTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListPopLastBlocking'; + return 'Predis\Command\ListPopLastBlocking'; } /** diff --git a/tests/Predis/Commands/ListPopLastPushHeadBlockingTest.php b/tests/Predis/Command/ListPopLastPushHeadBlockingTest.php similarity index 95% rename from tests/Predis/Commands/ListPopLastPushHeadBlockingTest.php rename to tests/Predis/Command/ListPopLastPushHeadBlockingTest.php index d009ae9b..56aebd31 100644 --- a/tests/Predis/Commands/ListPopLastPushHeadBlockingTest.php +++ b/tests/Predis/Command/ListPopLastPushHeadBlockingTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -26,7 +26,7 @@ class ListPopLastPushHeadBlockingTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListPopLastPushHeadBlocking'; + return 'Predis\Command\ListPopLastPushHeadBlocking'; } /** diff --git a/tests/Predis/Commands/ListPopLastPushHeadTest.php b/tests/Predis/Command/ListPopLastPushHeadTest.php similarity index 97% rename from tests/Predis/Commands/ListPopLastPushHeadTest.php rename to tests/Predis/Command/ListPopLastPushHeadTest.php index 3b0df6b0..ee2b7371 100644 --- a/tests/Predis/Commands/ListPopLastPushHeadTest.php +++ b/tests/Predis/Command/ListPopLastPushHeadTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListPopLastPushHeadTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListPopLastPushHead'; + return 'Predis\Command\ListPopLastPushHead'; } /** diff --git a/tests/Predis/Commands/ListPopLastTest.php b/tests/Predis/Command/ListPopLastTest.php similarity index 97% rename from tests/Predis/Commands/ListPopLastTest.php rename to tests/Predis/Command/ListPopLastTest.php index 79e9252c..2a41605a 100644 --- a/tests/Predis/Commands/ListPopLastTest.php +++ b/tests/Predis/Command/ListPopLastTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListPopLastTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListPopLast'; + return 'Predis\Command\ListPopLast'; } /** diff --git a/tests/Predis/Commands/ListPushHeadTest.php b/tests/Predis/Command/ListPushHeadTest.php similarity index 97% rename from tests/Predis/Commands/ListPushHeadTest.php rename to tests/Predis/Command/ListPushHeadTest.php index 95dc5c2c..2b2762aa 100644 --- a/tests/Predis/Commands/ListPushHeadTest.php +++ b/tests/Predis/Command/ListPushHeadTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListPushHeadTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListPushHead'; + return 'Predis\Command\ListPushHead'; } /** diff --git a/tests/Predis/Commands/ListPushHeadXTest.php b/tests/Predis/Command/ListPushHeadXTest.php similarity index 97% rename from tests/Predis/Commands/ListPushHeadXTest.php rename to tests/Predis/Command/ListPushHeadXTest.php index af1db985..c35e5056 100644 --- a/tests/Predis/Commands/ListPushHeadXTest.php +++ b/tests/Predis/Command/ListPushHeadXTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListPushHeadXTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListPushHeadX'; + return 'Predis\Command\ListPushHeadX'; } /** diff --git a/tests/Predis/Commands/ListPushTailTest.php b/tests/Predis/Command/ListPushTailTest.php similarity index 97% rename from tests/Predis/Commands/ListPushTailTest.php rename to tests/Predis/Command/ListPushTailTest.php index 7011f8cc..c4bcd133 100644 --- a/tests/Predis/Commands/ListPushTailTest.php +++ b/tests/Predis/Command/ListPushTailTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListPushTailTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListPushTail'; + return 'Predis\Command\ListPushTail'; } /** diff --git a/tests/Predis/Commands/ListPushTailXTest.php b/tests/Predis/Command/ListPushTailXTest.php similarity index 97% rename from tests/Predis/Commands/ListPushTailXTest.php rename to tests/Predis/Command/ListPushTailXTest.php index fa8b5f8d..ffa826d6 100644 --- a/tests/Predis/Commands/ListPushTailXTest.php +++ b/tests/Predis/Command/ListPushTailXTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListPushTailXTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListPushTailX'; + return 'Predis\Command\ListPushTailX'; } /** diff --git a/tests/Predis/Commands/ListRangeTest.php b/tests/Predis/Command/ListRangeTest.php similarity index 98% rename from tests/Predis/Commands/ListRangeTest.php rename to tests/Predis/Command/ListRangeTest.php index 2309af83..c28d2000 100644 --- a/tests/Predis/Commands/ListRangeTest.php +++ b/tests/Predis/Command/ListRangeTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListRangeTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListRange'; + return 'Predis\Command\ListRange'; } /** diff --git a/tests/Predis/Commands/ListRemoveTest.php b/tests/Predis/Command/ListRemoveTest.php similarity index 97% rename from tests/Predis/Commands/ListRemoveTest.php rename to tests/Predis/Command/ListRemoveTest.php index e0304983..98634ba7 100644 --- a/tests/Predis/Commands/ListRemoveTest.php +++ b/tests/Predis/Command/ListRemoveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListRemoveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListRemove'; + return 'Predis\Command\ListRemove'; } /** diff --git a/tests/Predis/Commands/ListSetTest.php b/tests/Predis/Command/ListSetTest.php similarity index 97% rename from tests/Predis/Commands/ListSetTest.php rename to tests/Predis/Command/ListSetTest.php index 0f0fa2cc..09e5e224 100644 --- a/tests/Predis/Commands/ListSetTest.php +++ b/tests/Predis/Command/ListSetTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListSetTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListSet'; + return 'Predis\Command\ListSet'; } /** diff --git a/tests/Predis/Commands/ListTrimTest.php b/tests/Predis/Command/ListTrimTest.php similarity index 98% rename from tests/Predis/Commands/ListTrimTest.php rename to tests/Predis/Command/ListTrimTest.php index d523d214..742e48fb 100644 --- a/tests/Predis/Commands/ListTrimTest.php +++ b/tests/Predis/Command/ListTrimTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ListTrimTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ListTrim'; + return 'Predis\Command\ListTrim'; } /** diff --git a/tests/Predis/Commands/PrefixHelpersTest.php b/tests/Predis/Command/PrefixHelpersTest.php similarity index 95% rename from tests/Predis/Commands/PrefixHelpersTest.php rename to tests/Predis/Command/PrefixHelpersTest.php index f5d672a4..bb81c494 100644 --- a/tests/Predis/Commands/PrefixHelpersTest.php +++ b/tests/Predis/Command/PrefixHelpersTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -26,7 +26,7 @@ class PrefixHelpersTest extends StandardTestCase $arguments = array('1st', '2nd', '3rd', '4th'); $expected = array('prefix:1st', '2nd', '3rd', '4th'); - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $command->setRawArguments($arguments); PrefixHelpers::first($command, 'prefix:'); @@ -42,7 +42,7 @@ class PrefixHelpersTest extends StandardTestCase $arguments = array('1st', '2nd', '3rd', '4th'); $expected = array('prefix:1st', 'prefix:2nd', 'prefix:3rd', 'prefix:4th'); - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $command->setRawArguments($arguments); PrefixHelpers::all($command, 'prefix:'); @@ -58,7 +58,7 @@ class PrefixHelpersTest extends StandardTestCase $arguments = array('1st', '2nd', '3rd', '4th'); $expected = array('prefix:1st', '2nd', 'prefix:3rd', '4th'); - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $command->setRawArguments($arguments); PrefixHelpers::interleaved($command, 'prefix:'); @@ -74,7 +74,7 @@ class PrefixHelpersTest extends StandardTestCase $arguments = array('1st', '2nd', '3rd', '4th'); $expected = array('prefix:1st', 'prefix:2nd', 'prefix:3rd', '4th'); - $command = $this->getMockForAbstractClass('Predis\Commands\Command'); + $command = $this->getMockForAbstractClass('Predis\Command\AbstractCommand'); $command->setRawArguments($arguments); PrefixHelpers::skipLast($command, 'prefix:'); diff --git a/tests/Predis/Commands/PrefixableCommandTest.php b/tests/Predis/Command/PrefixableCommandTest.php similarity index 81% rename from tests/Predis/Commands/PrefixableCommandTest.php rename to tests/Predis/Command/PrefixableCommandTest.php index 8c391a9a..8523e285 100644 --- a/tests/Predis/Commands/PrefixableCommandTest.php +++ b/tests/Predis/Command/PrefixableCommandTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -23,10 +23,10 @@ class PrefixableCommandTest extends StandardTestCase */ public function testImplementsCorrectInterface() { - $command = $this->getMockForAbstractClass('Predis\Commands\PrefixableCommand'); + $command = $this->getMockForAbstractClass('Predis\Command\PrefixableCommand'); - $this->assertInstanceOf('Predis\Commands\IPrefixable', $command); - $this->assertInstanceOf('Predis\Commands\ICommand', $command); + $this->assertInstanceOf('Predis\Command\PrefixableCommandInterface', $command); + $this->assertInstanceOf('Predis\Command\CommandInterface', $command); } /** @@ -34,7 +34,7 @@ class PrefixableCommandTest extends StandardTestCase */ public function testAddPrefixToFirstArgument() { - $command = $this->getMockForAbstractClass('Predis\Commands\PrefixableCommand'); + $command = $this->getMockForAbstractClass('Predis\Command\PrefixableCommand'); $command->setRawArguments(array('key', 'value')); $command->prefixKeys('prefix:'); @@ -46,7 +46,7 @@ class PrefixableCommandTest extends StandardTestCase */ public function testDoesNotBreakOnEmptyArguments() { - $command = $this->getMockForAbstractClass('Predis\Commands\PrefixableCommand'); + $command = $this->getMockForAbstractClass('Predis\Command\PrefixableCommand'); $command->prefixKeys('prefix:'); $this->assertEmpty($command->getArguments()); diff --git a/tests/Predis/Commands/Processors/KeyPrefixProcessorTest.php b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php similarity index 86% rename from tests/Predis/Commands/Processors/KeyPrefixProcessorTest.php rename to tests/Predis/Command/Processor/KeyPrefixProcessorTest.php index b197500e..36e16c04 100644 --- a/tests/Predis/Commands/Processors/KeyPrefixProcessorTest.php +++ b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands\Processors; +namespace Predis\Command\Processor; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -26,7 +26,7 @@ class KeyPrefixProcessorTest extends StandardTestCase $prefix = 'prefix:'; $processor = new KeyPrefixProcessor($prefix); - $this->assertInstanceOf('Predis\Commands\Processors\ICommandProcessor', $processor); + $this->assertInstanceOf('Predis\Command\Processor\CommandProcessorInterface', $processor); $this->assertEquals($prefix, $processor->getPrefix()); } @@ -54,7 +54,7 @@ class KeyPrefixProcessorTest extends StandardTestCase $unprefixed = 'key'; $expected = "$prefix$unprefixed"; - $command = $this->getMock('Predis\Commands\PrefixableCommand'); + $command = $this->getMock('Predis\Command\PrefixableCommand'); $command->expects($this->once()) ->method('prefixKeys') ->with($prefix); @@ -73,7 +73,7 @@ class KeyPrefixProcessorTest extends StandardTestCase $unprefixed = 'key'; $expected = "$prefix$unprefixed"; - $command = $this->getMock('Predis\Commands\ICommand'); + $command = $this->getMock('Predis\Command\CommandInterface'); $command->expects($this->never())->method('prefixKeys'); $processor = new KeyPrefixProcessor($prefix); diff --git a/tests/Predis/Commands/Processors/ProcessorChainTest.php b/tests/Predis/Command/Processor/ProcessorChainTest.php similarity index 63% rename from tests/Predis/Commands/Processors/ProcessorChainTest.php rename to tests/Predis/Command/Processor/ProcessorChainTest.php index 39be7dad..8c793e2c 100644 --- a/tests/Predis/Commands/Processors/ProcessorChainTest.php +++ b/tests/Predis/Command/Processor/ProcessorChainTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands\Processors; +namespace Predis\Command\Processor; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -25,8 +25,8 @@ class ProcessorChainTest extends StandardTestCase { $chain = new ProcessorChain(); - $this->assertInstanceOf('Predis\Commands\Processors\ICommandProcessor', $chain); - $this->assertInstanceOf('Predis\Commands\Processors\ICommandProcessorChain', $chain); + $this->assertInstanceOf('Predis\Command\Processor\CommandProcessorInterface', $chain); + $this->assertInstanceOf('Predis\Command\Processor\CommandProcessorChainInterface', $chain); $this->assertEmpty($chain->getProcessors()); } @@ -36,8 +36,8 @@ class ProcessorChainTest extends StandardTestCase public function testConstructorWithProcessorsArray() { $processors = array( - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), ); $chain = new ProcessorChain($processors); @@ -51,8 +51,8 @@ class ProcessorChainTest extends StandardTestCase public function testCountProcessors() { $processors = array( - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), ); $chain = new ProcessorChain($processors); @@ -66,8 +66,8 @@ class ProcessorChainTest extends StandardTestCase public function testAddProcessors() { $processors = array( - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), ); $chain = new ProcessorChain(); @@ -83,13 +83,13 @@ class ProcessorChainTest extends StandardTestCase public function testAddMoreProcessors() { $processors1 = array( - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), ); $processors2 = array( - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), ); $chain = new ProcessorChain($processors1); @@ -105,8 +105,8 @@ class ProcessorChainTest extends StandardTestCase public function testRemoveProcessors() { $processors = array( - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), ); $chain = new ProcessorChain($processors); @@ -123,10 +123,10 @@ class ProcessorChainTest extends StandardTestCase */ public function testRemoveProcessorNotInChain() { - $processor = $this->getMock('Predis\Commands\Processors\ICommandProcessor'); + $processor = $this->getMock('Predis\Command\Processor\CommandProcessorInterface'); $processors = array( - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), - $this->getMock('Predis\Commands\Processors\ICommandProcessor'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), + $this->getMock('Predis\Command\Processor\CommandProcessorInterface'), ); $chain = new ProcessorChain($processors); @@ -140,7 +140,7 @@ class ProcessorChainTest extends StandardTestCase */ public function testRemoveProcessorFromEmptyChain() { - $processor = $this->getMock('Predis\Commands\Processors\ICommandProcessor'); + $processor = $this->getMock('Predis\Command\Processor\CommandProcessorInterface'); $chain = new ProcessorChain(); $this->assertEmpty($chain->getProcessors()); @@ -154,12 +154,12 @@ class ProcessorChainTest extends StandardTestCase */ public function testProcessChain() { - $command = $this->getMock('Predis\Commands\ICommand'); + $command = $this->getMock('Predis\Command\CommandInterface'); - $processor1 = $this->getMock('Predis\Commands\Processors\ICommandProcessor'); + $processor1 = $this->getMock('Predis\Command\Processor\CommandProcessorInterface'); $processor1->expects($this->once())->method('process')->with($command); - $processor2 = $this->getMock('Predis\Commands\Processors\ICommandProcessor'); + $processor2 = $this->getMock('Predis\Command\Processor\CommandProcessorInterface'); $processor2->expects($this->once())->method('process')->with($command); $processors = array($processor1, $processor2); diff --git a/tests/Predis/Commands/PubSubPublishTest.php b/tests/Predis/Command/PubSubPublishTest.php similarity index 96% rename from tests/Predis/Commands/PubSubPublishTest.php rename to tests/Predis/Command/PubSubPublishTest.php index 5d1b02ba..55bd3dcb 100644 --- a/tests/Predis/Commands/PubSubPublishTest.php +++ b/tests/Predis/Command/PubSubPublishTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class PubSubPublishTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\PubSubPublish'; + return 'Predis\Command\PubSubPublish'; } /** diff --git a/tests/Predis/Commands/PubSubSubscribeByPatternTest.php b/tests/Predis/Command/PubSubSubscribeByPatternTest.php similarity index 98% rename from tests/Predis/Commands/PubSubSubscribeByPatternTest.php rename to tests/Predis/Command/PubSubSubscribeByPatternTest.php index ad3b6a8f..2f68b868 100644 --- a/tests/Predis/Commands/PubSubSubscribeByPatternTest.php +++ b/tests/Predis/Command/PubSubSubscribeByPatternTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class PubSubSubscribeByPatternTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\PubSubSubscribeByPattern'; + return 'Predis\Command\PubSubSubscribeByPattern'; } /** diff --git a/tests/Predis/Commands/PubSubSubscribeTest.php b/tests/Predis/Command/PubSubSubscribeTest.php similarity index 98% rename from tests/Predis/Commands/PubSubSubscribeTest.php rename to tests/Predis/Command/PubSubSubscribeTest.php index c725165f..01e5a0f6 100644 --- a/tests/Predis/Commands/PubSubSubscribeTest.php +++ b/tests/Predis/Command/PubSubSubscribeTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class PubSubSubscribeTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\PubSubSubscribe'; + return 'Predis\Command\PubSubSubscribe'; } /** diff --git a/tests/Predis/Commands/PubSubUnsubscribeByPatternTest.php b/tests/Predis/Command/PubSubUnsubscribeByPatternTest.php similarity index 97% rename from tests/Predis/Commands/PubSubUnsubscribeByPatternTest.php rename to tests/Predis/Command/PubSubUnsubscribeByPatternTest.php index 5531fcc9..3142d9f8 100644 --- a/tests/Predis/Commands/PubSubUnsubscribeByPatternTest.php +++ b/tests/Predis/Command/PubSubUnsubscribeByPatternTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class PubSubUnsubscribeByPatternTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\PubSubUnsubscribeByPattern'; + return 'Predis\Command\PubSubUnsubscribeByPattern'; } /** diff --git a/tests/Predis/Commands/PubSubUnsubscribeTest.php b/tests/Predis/Command/PubSubUnsubscribeTest.php similarity index 97% rename from tests/Predis/Commands/PubSubUnsubscribeTest.php rename to tests/Predis/Command/PubSubUnsubscribeTest.php index 34f07b5a..2d5893d0 100644 --- a/tests/Predis/Commands/PubSubUnsubscribeTest.php +++ b/tests/Predis/Command/PubSubUnsubscribeTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class PubSubUnsubscribeTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\PubSubUnsubscribe'; + return 'Predis\Command\PubSubUnsubscribe'; } /** diff --git a/tests/Predis/Commands/ScriptedCommandTest.php b/tests/Predis/Command/ScriptedCommandTest.php similarity index 85% rename from tests/Predis/Commands/ScriptedCommandTest.php rename to tests/Predis/Command/ScriptedCommandTest.php index 48331eaa..f941b2fe 100644 --- a/tests/Predis/Commands/ScriptedCommandTest.php +++ b/tests/Predis/Command/ScriptedCommandTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -27,7 +27,7 @@ class ScriptedCommandTest extends StandardTestCase { $arguments = array('key1', 'key2', 'value1', 'value2'); - $command = $this->getMock('Predis\Commands\ScriptedCommand', array('getScript', 'getKeysCount')); + $command = $this->getMock('Predis\Command\ScriptedCommand', array('getScript', 'getKeysCount')); $command->expects($this->once()) ->method('getScript') ->will($this->returnValue(self::LUA_SCRIPT)); @@ -46,7 +46,7 @@ class ScriptedCommandTest extends StandardTestCase { $arguments = array('key1', 'key2', 'value1', 'value2'); - $command = $this->getMock('Predis\Commands\ScriptedCommand', array('getScript', 'getKeysCount')); + $command = $this->getMock('Predis\Command\ScriptedCommand', array('getScript', 'getKeysCount')); $command->expects($this->once()) ->method('getScript') ->will($this->returnValue(self::LUA_SCRIPT)); @@ -66,7 +66,7 @@ class ScriptedCommandTest extends StandardTestCase $arguments = array('foo', 'hoge', 'bar', 'piyo'); $expected = array('prefix:foo', 'prefix:hoge'); - $command = $this->getMock('Predis\Commands\ScriptedCommand', array('getScript', 'getKeysCount')); + $command = $this->getMock('Predis\Command\ScriptedCommand', array('getScript', 'getKeysCount')); $command->expects($this->once()) ->method('getScript') ->will($this->returnValue(self::LUA_SCRIPT)); @@ -87,7 +87,7 @@ class ScriptedCommandTest extends StandardTestCase { $arguments = array('key1', 'key2', 'value1', 'value2'); - $command = $this->getMock('Predis\Commands\ScriptedCommand', array('getScript', 'getKeysCount')); + $command = $this->getMock('Predis\Command\ScriptedCommand', array('getScript', 'getKeysCount')); $command->expects($this->once()) ->method('getScript') ->will($this->returnValue(self::LUA_SCRIPT)); diff --git a/tests/Predis/Commands/ServerBackgroundRewriteAOFTest.php b/tests/Predis/Command/ServerBackgroundRewriteAOFTest.php similarity index 92% rename from tests/Predis/Commands/ServerBackgroundRewriteAOFTest.php rename to tests/Predis/Command/ServerBackgroundRewriteAOFTest.php index d0c32f2d..4fee52f8 100644 --- a/tests/Predis/Commands/ServerBackgroundRewriteAOFTest.php +++ b/tests/Predis/Command/ServerBackgroundRewriteAOFTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerBackgroundRewriteAOFTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerBackgroundRewriteAOF'; + return 'Predis\Command\ServerBackgroundRewriteAOF'; } /** diff --git a/tests/Predis/Commands/ServerBackgroundSaveTest.php b/tests/Predis/Command/ServerBackgroundSaveTest.php similarity index 92% rename from tests/Predis/Commands/ServerBackgroundSaveTest.php rename to tests/Predis/Command/ServerBackgroundSaveTest.php index 5f46da6f..0bf7be01 100644 --- a/tests/Predis/Commands/ServerBackgroundSaveTest.php +++ b/tests/Predis/Command/ServerBackgroundSaveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerBackgroundSaveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerBackgroundSave'; + return 'Predis\Command\ServerBackgroundSave'; } /** diff --git a/tests/Predis/Commands/ServerClientTest.php b/tests/Predis/Command/ServerClientTest.php similarity index 98% rename from tests/Predis/Commands/ServerClientTest.php rename to tests/Predis/Command/ServerClientTest.php index 0e360dad..255528dc 100644 --- a/tests/Predis/Commands/ServerClientTest.php +++ b/tests/Predis/Command/ServerClientTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerClientTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerClient'; + return 'Predis\Command\ServerClient'; } /** diff --git a/tests/Predis/Commands/ServerConfigTest.php b/tests/Predis/Command/ServerConfigTest.php similarity index 98% rename from tests/Predis/Commands/ServerConfigTest.php rename to tests/Predis/Command/ServerConfigTest.php index 259d9067..bbd3f14f 100644 --- a/tests/Predis/Commands/ServerConfigTest.php +++ b/tests/Predis/Command/ServerConfigTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerConfigTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerConfig'; + return 'Predis\Command\ServerConfig'; } /** diff --git a/tests/Predis/Commands/ServerDatabaseSizeTest.php b/tests/Predis/Command/ServerDatabaseSizeTest.php similarity index 94% rename from tests/Predis/Commands/ServerDatabaseSizeTest.php rename to tests/Predis/Command/ServerDatabaseSizeTest.php index 61b874c3..fb889f74 100644 --- a/tests/Predis/Commands/ServerDatabaseSizeTest.php +++ b/tests/Predis/Command/ServerDatabaseSizeTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerDatabaseSizeTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerDatabaseSize'; + return 'Predis\Command\ServerDatabaseSize'; } /** diff --git a/tests/Predis/Commands/ServerEvalSHATest.php b/tests/Predis/Command/ServerEvalSHATest.php similarity index 97% rename from tests/Predis/Commands/ServerEvalSHATest.php rename to tests/Predis/Command/ServerEvalSHATest.php index fdc2080d..22888f91 100644 --- a/tests/Predis/Commands/ServerEvalSHATest.php +++ b/tests/Predis/Command/ServerEvalSHATest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerEvalSHATest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerEvalSHA'; + return 'Predis\Command\ServerEvalSHA'; } /** diff --git a/tests/Predis/Commands/ServerEvalTest.php b/tests/Predis/Command/ServerEvalTest.php similarity index 97% rename from tests/Predis/Commands/ServerEvalTest.php rename to tests/Predis/Command/ServerEvalTest.php index 0c3ea54a..11df8fb9 100644 --- a/tests/Predis/Commands/ServerEvalTest.php +++ b/tests/Predis/Command/ServerEvalTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerEvalTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerEval'; + return 'Predis\Command\ServerEval'; } /** diff --git a/tests/Predis/Commands/ServerFlushAllTest.php b/tests/Predis/Command/ServerFlushAllTest.php similarity index 93% rename from tests/Predis/Commands/ServerFlushAllTest.php rename to tests/Predis/Command/ServerFlushAllTest.php index 6d1303bc..090d33f9 100644 --- a/tests/Predis/Commands/ServerFlushAllTest.php +++ b/tests/Predis/Command/ServerFlushAllTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerFlushAllTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerFlushAll'; + return 'Predis\Command\ServerFlushAll'; } /** diff --git a/tests/Predis/Commands/ServerFlushDatabaseTest.php b/tests/Predis/Command/ServerFlushDatabaseTest.php similarity index 94% rename from tests/Predis/Commands/ServerFlushDatabaseTest.php rename to tests/Predis/Command/ServerFlushDatabaseTest.php index c1af9433..39ae5738 100644 --- a/tests/Predis/Commands/ServerFlushDatabaseTest.php +++ b/tests/Predis/Command/ServerFlushDatabaseTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerFlushDatabaseTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerFlushDatabase'; + return 'Predis\Command\ServerFlushDatabase'; } /** diff --git a/tests/Predis/Commands/ServerInfoTest.php b/tests/Predis/Command/ServerInfoTest.php similarity index 99% rename from tests/Predis/Commands/ServerInfoTest.php rename to tests/Predis/Command/ServerInfoTest.php index 7fc12809..2b9b2038 100644 --- a/tests/Predis/Commands/ServerInfoTest.php +++ b/tests/Predis/Command/ServerInfoTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerInfoTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerInfo'; + return 'Predis\Command\ServerInfo'; } /** diff --git a/tests/Predis/Commands/ServerInfoV26xTest.php b/tests/Predis/Command/ServerInfoV26xTest.php similarity index 99% rename from tests/Predis/Commands/ServerInfoV26xTest.php rename to tests/Predis/Command/ServerInfoV26xTest.php index 6fd79f4a..76f75c76 100644 --- a/tests/Predis/Commands/ServerInfoV26xTest.php +++ b/tests/Predis/Command/ServerInfoV26xTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerInfoV26xTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerInfoV26x'; + return 'Predis\Command\ServerInfoV26x'; } /** diff --git a/tests/Predis/Commands/ServerLastSaveTest.php b/tests/Predis/Command/ServerLastSaveTest.php similarity index 94% rename from tests/Predis/Commands/ServerLastSaveTest.php rename to tests/Predis/Command/ServerLastSaveTest.php index e74581b2..15bedf05 100644 --- a/tests/Predis/Commands/ServerLastSaveTest.php +++ b/tests/Predis/Command/ServerLastSaveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerLastSaveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerLastSave'; + return 'Predis\Command\ServerLastSave'; } /** diff --git a/tests/Predis/Commands/ServerMonitorTest.php b/tests/Predis/Command/ServerMonitorTest.php similarity index 94% rename from tests/Predis/Commands/ServerMonitorTest.php rename to tests/Predis/Command/ServerMonitorTest.php index b1df9714..5ee7bd98 100644 --- a/tests/Predis/Commands/ServerMonitorTest.php +++ b/tests/Predis/Command/ServerMonitorTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -25,7 +25,7 @@ class ServerMonitorTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerMonitor'; + return 'Predis\Command\ServerMonitor'; } /** diff --git a/tests/Predis/Commands/ServerObjectTest.php b/tests/Predis/Command/ServerObjectTest.php similarity index 97% rename from tests/Predis/Commands/ServerObjectTest.php rename to tests/Predis/Command/ServerObjectTest.php index 03b8c6ac..aea730fa 100644 --- a/tests/Predis/Commands/ServerObjectTest.php +++ b/tests/Predis/Command/ServerObjectTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerObjectTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerObject'; + return 'Predis\Command\ServerObject'; } /** diff --git a/tests/Predis/Commands/ServerSaveTest.php b/tests/Predis/Command/ServerSaveTest.php similarity index 93% rename from tests/Predis/Commands/ServerSaveTest.php rename to tests/Predis/Command/ServerSaveTest.php index 7101699d..0be9647c 100644 --- a/tests/Predis/Commands/ServerSaveTest.php +++ b/tests/Predis/Command/ServerSaveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerSaveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerSave'; + return 'Predis\Command\ServerSave'; } /** diff --git a/tests/Predis/Commands/ServerScriptTest.php b/tests/Predis/Command/ServerScriptTest.php similarity index 97% rename from tests/Predis/Commands/ServerScriptTest.php rename to tests/Predis/Command/ServerScriptTest.php index cb9e3847..9d69f5c7 100644 --- a/tests/Predis/Commands/ServerScriptTest.php +++ b/tests/Predis/Command/ServerScriptTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerScriptTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerScript'; + return 'Predis\Command\ServerScript'; } /** diff --git a/tests/Predis/Commands/ServerShutdownTest.php b/tests/Predis/Command/ServerShutdownTest.php similarity index 91% rename from tests/Predis/Commands/ServerShutdownTest.php rename to tests/Predis/Command/ServerShutdownTest.php index 5402c761..13f4fcf0 100644 --- a/tests/Predis/Commands/ServerShutdownTest.php +++ b/tests/Predis/Command/ServerShutdownTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerShutdownTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerShutdown'; + return 'Predis\Command\ServerShutdown'; } /** diff --git a/tests/Predis/Commands/ServerSlaveOfTest.php b/tests/Predis/Command/ServerSlaveOfTest.php similarity index 96% rename from tests/Predis/Commands/ServerSlaveOfTest.php rename to tests/Predis/Command/ServerSlaveOfTest.php index ad77dbe0..e65d1b76 100644 --- a/tests/Predis/Commands/ServerSlaveOfTest.php +++ b/tests/Predis/Command/ServerSlaveOfTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ServerSlaveOfTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerSlaveOf'; + return 'Predis\Command\ServerSlaveOf'; } /** diff --git a/tests/Predis/Commands/ServerSlowlogTest.php b/tests/Predis/Command/ServerSlowlogTest.php similarity index 97% rename from tests/Predis/Commands/ServerSlowlogTest.php rename to tests/Predis/Command/ServerSlowlogTest.php index 3ee58ece..64ab9497 100644 --- a/tests/Predis/Commands/ServerSlowlogTest.php +++ b/tests/Predis/Command/ServerSlowlogTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -27,7 +27,7 @@ class ServerSlowlogTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ServerSlowlog'; + return 'Predis\Command\ServerSlowlog'; } /** diff --git a/tests/Predis/Commands/SetAddTest.php b/tests/Predis/Command/SetAddTest.php similarity index 97% rename from tests/Predis/Commands/SetAddTest.php rename to tests/Predis/Command/SetAddTest.php index a15c4bc9..1adeb3ce 100644 --- a/tests/Predis/Commands/SetAddTest.php +++ b/tests/Predis/Command/SetAddTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetAddTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetAdd'; + return 'Predis\Command\SetAdd'; } /** diff --git a/tests/Predis/Commands/SetCardinalityTest.php b/tests/Predis/Command/SetCardinalityTest.php similarity index 96% rename from tests/Predis/Commands/SetCardinalityTest.php rename to tests/Predis/Command/SetCardinalityTest.php index 49ce7502..e5801e6a 100644 --- a/tests/Predis/Commands/SetCardinalityTest.php +++ b/tests/Predis/Command/SetCardinalityTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetCardinalityTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetCardinality'; + return 'Predis\Command\SetCardinality'; } /** diff --git a/tests/Predis/Commands/SetDifferenceStoreTest.php b/tests/Predis/Command/SetDifferenceStoreTest.php similarity index 97% rename from tests/Predis/Commands/SetDifferenceStoreTest.php rename to tests/Predis/Command/SetDifferenceStoreTest.php index 010f1593..e93329f2 100644 --- a/tests/Predis/Commands/SetDifferenceStoreTest.php +++ b/tests/Predis/Command/SetDifferenceStoreTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetDifferenceStoreTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetDifferenceStore'; + return 'Predis\Command\SetDifferenceStore'; } /** diff --git a/tests/Predis/Commands/SetDifferenceTest.php b/tests/Predis/Command/SetDifferenceTest.php similarity index 97% rename from tests/Predis/Commands/SetDifferenceTest.php rename to tests/Predis/Command/SetDifferenceTest.php index 6da34cfe..85fa096d 100644 --- a/tests/Predis/Commands/SetDifferenceTest.php +++ b/tests/Predis/Command/SetDifferenceTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetDifferenceTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetDifference'; + return 'Predis\Command\SetDifference'; } /** diff --git a/tests/Predis/Commands/SetIntersectionStoreTest.php b/tests/Predis/Command/SetIntersectionStoreTest.php similarity index 98% rename from tests/Predis/Commands/SetIntersectionStoreTest.php rename to tests/Predis/Command/SetIntersectionStoreTest.php index 06c3a875..97c8dbfe 100644 --- a/tests/Predis/Commands/SetIntersectionStoreTest.php +++ b/tests/Predis/Command/SetIntersectionStoreTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetIntersectionStoreTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetIntersectionStore'; + return 'Predis\Command\SetIntersectionStore'; } /** diff --git a/tests/Predis/Commands/SetIntersectionTest.php b/tests/Predis/Command/SetIntersectionTest.php similarity index 97% rename from tests/Predis/Commands/SetIntersectionTest.php rename to tests/Predis/Command/SetIntersectionTest.php index bd9edcc1..0c022458 100644 --- a/tests/Predis/Commands/SetIntersectionTest.php +++ b/tests/Predis/Command/SetIntersectionTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetIntersectionTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetIntersection'; + return 'Predis\Command\SetIntersection'; } /** diff --git a/tests/Predis/Commands/SetIsMemberTest.php b/tests/Predis/Command/SetIsMemberTest.php similarity index 97% rename from tests/Predis/Commands/SetIsMemberTest.php rename to tests/Predis/Command/SetIsMemberTest.php index b07a5d9e..b7c1c95a 100644 --- a/tests/Predis/Commands/SetIsMemberTest.php +++ b/tests/Predis/Command/SetIsMemberTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetIsMemberTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetIsMember'; + return 'Predis\Command\SetIsMember'; } /** diff --git a/tests/Predis/Commands/SetMembersTest.php b/tests/Predis/Command/SetMembersTest.php similarity index 96% rename from tests/Predis/Commands/SetMembersTest.php rename to tests/Predis/Command/SetMembersTest.php index 618155e2..300d3f7d 100644 --- a/tests/Predis/Commands/SetMembersTest.php +++ b/tests/Predis/Command/SetMembersTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetMembersTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetMembers'; + return 'Predis\Command\SetMembers'; } /** diff --git a/tests/Predis/Commands/SetMoveTest.php b/tests/Predis/Command/SetMoveTest.php similarity index 97% rename from tests/Predis/Commands/SetMoveTest.php rename to tests/Predis/Command/SetMoveTest.php index 5114905b..5dea2347 100644 --- a/tests/Predis/Commands/SetMoveTest.php +++ b/tests/Predis/Command/SetMoveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetMoveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetMove'; + return 'Predis\Command\SetMove'; } /** diff --git a/tests/Predis/Commands/SetPopTest.php b/tests/Predis/Command/SetPopTest.php similarity index 96% rename from tests/Predis/Commands/SetPopTest.php rename to tests/Predis/Command/SetPopTest.php index b39426f1..1fdca365 100644 --- a/tests/Predis/Commands/SetPopTest.php +++ b/tests/Predis/Command/SetPopTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetPopTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetPop'; + return 'Predis\Command\SetPop'; } /** diff --git a/tests/Predis/Commands/SetRandomMemberTest.php b/tests/Predis/Command/SetRandomMemberTest.php similarity index 96% rename from tests/Predis/Commands/SetRandomMemberTest.php rename to tests/Predis/Command/SetRandomMemberTest.php index a9e3320c..74e8189c 100644 --- a/tests/Predis/Commands/SetRandomMemberTest.php +++ b/tests/Predis/Command/SetRandomMemberTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetRandomMemberTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetRandomMember'; + return 'Predis\Command\SetRandomMember'; } /** diff --git a/tests/Predis/Commands/SetRemoveTest.php b/tests/Predis/Command/SetRemoveTest.php similarity index 97% rename from tests/Predis/Commands/SetRemoveTest.php rename to tests/Predis/Command/SetRemoveTest.php index b8d5e55b..1e41f751 100644 --- a/tests/Predis/Commands/SetRemoveTest.php +++ b/tests/Predis/Command/SetRemoveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetRemoveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetRemove'; + return 'Predis\Command\SetRemove'; } /** diff --git a/tests/Predis/Commands/SetUnionStoreTest.php b/tests/Predis/Command/SetUnionStoreTest.php similarity index 97% rename from tests/Predis/Commands/SetUnionStoreTest.php rename to tests/Predis/Command/SetUnionStoreTest.php index e83cb982..c348385f 100644 --- a/tests/Predis/Commands/SetUnionStoreTest.php +++ b/tests/Predis/Command/SetUnionStoreTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetUnionStoreTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetUnionStore'; + return 'Predis\Command\SetUnionStore'; } /** diff --git a/tests/Predis/Commands/SetUnionTest.php b/tests/Predis/Command/SetUnionTest.php similarity index 97% rename from tests/Predis/Commands/SetUnionTest.php rename to tests/Predis/Command/SetUnionTest.php index cf638597..85c845c9 100644 --- a/tests/Predis/Commands/SetUnionTest.php +++ b/tests/Predis/Command/SetUnionTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class SetUnionTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\SetUnion'; + return 'Predis\Command\SetUnion'; } /** diff --git a/tests/Predis/Commands/StringAppendTest.php b/tests/Predis/Command/StringAppendTest.php similarity index 97% rename from tests/Predis/Commands/StringAppendTest.php rename to tests/Predis/Command/StringAppendTest.php index ae4e2069..f3d2a04b 100644 --- a/tests/Predis/Commands/StringAppendTest.php +++ b/tests/Predis/Command/StringAppendTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringAppendTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringAppend'; + return 'Predis\Command\StringAppend'; } /** diff --git a/tests/Predis/Commands/StringDecrementByTest.php b/tests/Predis/Command/StringDecrementByTest.php similarity index 97% rename from tests/Predis/Commands/StringDecrementByTest.php rename to tests/Predis/Command/StringDecrementByTest.php index 8cdbbd49..2f1848d4 100644 --- a/tests/Predis/Commands/StringDecrementByTest.php +++ b/tests/Predis/Command/StringDecrementByTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringDecrementByTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringDecrementBy'; + return 'Predis\Command\StringDecrementBy'; } /** diff --git a/tests/Predis/Commands/StringDecrementTest.php b/tests/Predis/Command/StringDecrementTest.php similarity index 97% rename from tests/Predis/Commands/StringDecrementTest.php rename to tests/Predis/Command/StringDecrementTest.php index 9dfbc213..576ef974 100644 --- a/tests/Predis/Commands/StringDecrementTest.php +++ b/tests/Predis/Command/StringDecrementTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringDecrementTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringDecrement'; + return 'Predis\Command\StringDecrement'; } /** diff --git a/tests/Predis/Commands/StringGetBitTest.php b/tests/Predis/Command/StringGetBitTest.php similarity index 97% rename from tests/Predis/Commands/StringGetBitTest.php rename to tests/Predis/Command/StringGetBitTest.php index 8acfac2f..09b18707 100644 --- a/tests/Predis/Commands/StringGetBitTest.php +++ b/tests/Predis/Command/StringGetBitTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringGetBitTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringGetBit'; + return 'Predis\Command\StringGetBit'; } /** diff --git a/tests/Predis/Commands/StringGetMultipleTest.php b/tests/Predis/Command/StringGetMultipleTest.php similarity index 97% rename from tests/Predis/Commands/StringGetMultipleTest.php rename to tests/Predis/Command/StringGetMultipleTest.php index 2a6f47df..7d65810a 100644 --- a/tests/Predis/Commands/StringGetMultipleTest.php +++ b/tests/Predis/Command/StringGetMultipleTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringGetMultipleTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringGetMultiple'; + return 'Predis\Command\StringGetMultiple'; } /** diff --git a/tests/Predis/Commands/StringGetRangeTest.php b/tests/Predis/Command/StringGetRangeTest.php similarity index 97% rename from tests/Predis/Commands/StringGetRangeTest.php rename to tests/Predis/Command/StringGetRangeTest.php index 425a7e6e..0f404861 100644 --- a/tests/Predis/Commands/StringGetRangeTest.php +++ b/tests/Predis/Command/StringGetRangeTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringGetRangeTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringGetRange'; + return 'Predis\Command\StringGetRange'; } /** diff --git a/tests/Predis/Commands/StringGetSetTest.php b/tests/Predis/Command/StringGetSetTest.php similarity index 96% rename from tests/Predis/Commands/StringGetSetTest.php rename to tests/Predis/Command/StringGetSetTest.php index e03ce1b4..45a0d026 100644 --- a/tests/Predis/Commands/StringGetSetTest.php +++ b/tests/Predis/Command/StringGetSetTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringGetSetTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringGetSet'; + return 'Predis\Command\StringGetSet'; } /** diff --git a/tests/Predis/Commands/StringGetTest.php b/tests/Predis/Command/StringGetTest.php similarity index 97% rename from tests/Predis/Commands/StringGetTest.php rename to tests/Predis/Command/StringGetTest.php index d9762907..0c3c92d1 100644 --- a/tests/Predis/Commands/StringGetTest.php +++ b/tests/Predis/Command/StringGetTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringGetTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringGet'; + return 'Predis\Command\StringGet'; } /** diff --git a/tests/Predis/Commands/StringIncrementByFloatTest.php b/tests/Predis/Command/StringIncrementByFloatTest.php similarity index 97% rename from tests/Predis/Commands/StringIncrementByFloatTest.php rename to tests/Predis/Command/StringIncrementByFloatTest.php index e1d7d876..84461de8 100644 --- a/tests/Predis/Commands/StringIncrementByFloatTest.php +++ b/tests/Predis/Command/StringIncrementByFloatTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringIncrementByFloatTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringIncrementByFloat'; + return 'Predis\Command\StringIncrementByFloat'; } /** diff --git a/tests/Predis/Commands/StringIncrementByTest.php b/tests/Predis/Command/StringIncrementByTest.php similarity index 97% rename from tests/Predis/Commands/StringIncrementByTest.php rename to tests/Predis/Command/StringIncrementByTest.php index 1e03f4d7..8e89480e 100644 --- a/tests/Predis/Commands/StringIncrementByTest.php +++ b/tests/Predis/Command/StringIncrementByTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringIncrementByTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringIncrementBy'; + return 'Predis\Command\StringIncrementBy'; } /** diff --git a/tests/Predis/Commands/StringIncrementTest.php b/tests/Predis/Command/StringIncrementTest.php similarity index 96% rename from tests/Predis/Commands/StringIncrementTest.php rename to tests/Predis/Command/StringIncrementTest.php index d8644f81..d2f24220 100644 --- a/tests/Predis/Commands/StringIncrementTest.php +++ b/tests/Predis/Command/StringIncrementTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringIncrementTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringIncrement'; + return 'Predis\Command\StringIncrement'; } /** diff --git a/tests/Predis/Commands/StringPreciseSetExpireTest.php b/tests/Predis/Command/StringPreciseSetExpireTest.php similarity index 97% rename from tests/Predis/Commands/StringPreciseSetExpireTest.php rename to tests/Predis/Command/StringPreciseSetExpireTest.php index c464038a..79113b6e 100644 --- a/tests/Predis/Commands/StringPreciseSetExpireTest.php +++ b/tests/Predis/Command/StringPreciseSetExpireTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringPreciseSetExpireTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringPreciseSetExpire'; + return 'Predis\Command\StringPreciseSetExpire'; } /** diff --git a/tests/Predis/Commands/StringSetBitTest.php b/tests/Predis/Command/StringSetBitTest.php similarity index 98% rename from tests/Predis/Commands/StringSetBitTest.php rename to tests/Predis/Command/StringSetBitTest.php index 6dfdaa57..49388c0a 100644 --- a/tests/Predis/Commands/StringSetBitTest.php +++ b/tests/Predis/Command/StringSetBitTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringSetBitTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringSetBit'; + return 'Predis\Command\StringSetBit'; } /** diff --git a/tests/Predis/Commands/StringSetExpireTest.php b/tests/Predis/Command/StringSetExpireTest.php similarity index 97% rename from tests/Predis/Commands/StringSetExpireTest.php rename to tests/Predis/Command/StringSetExpireTest.php index 3fae15aa..42cffa6d 100644 --- a/tests/Predis/Commands/StringSetExpireTest.php +++ b/tests/Predis/Command/StringSetExpireTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringSetExpireTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringSetExpire'; + return 'Predis\Command\StringSetExpire'; } /** diff --git a/tests/Predis/Commands/StringSetMultiplePreserveTest.php b/tests/Predis/Command/StringSetMultiplePreserveTest.php similarity index 96% rename from tests/Predis/Commands/StringSetMultiplePreserveTest.php rename to tests/Predis/Command/StringSetMultiplePreserveTest.php index b2fee1c4..7c0a8d8d 100644 --- a/tests/Predis/Commands/StringSetMultiplePreserveTest.php +++ b/tests/Predis/Command/StringSetMultiplePreserveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringSetMultiplePreserveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringSetMultiplePreserve'; + return 'Predis\Command\StringSetMultiplePreserve'; } /** diff --git a/tests/Predis/Commands/StringSetMultipleTest.php b/tests/Predis/Command/StringSetMultipleTest.php similarity index 96% rename from tests/Predis/Commands/StringSetMultipleTest.php rename to tests/Predis/Command/StringSetMultipleTest.php index 4893aa0e..fbd5b2fe 100644 --- a/tests/Predis/Commands/StringSetMultipleTest.php +++ b/tests/Predis/Command/StringSetMultipleTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringSetMultipleTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringSetMultiple'; + return 'Predis\Command\StringSetMultiple'; } /** diff --git a/tests/Predis/Commands/StringSetRangeTest.php b/tests/Predis/Command/StringSetRangeTest.php similarity index 97% rename from tests/Predis/Commands/StringSetRangeTest.php rename to tests/Predis/Command/StringSetRangeTest.php index e07c4766..4113a679 100644 --- a/tests/Predis/Commands/StringSetRangeTest.php +++ b/tests/Predis/Command/StringSetRangeTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringSetRangeTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringSetRange'; + return 'Predis\Command\StringSetRange'; } /** diff --git a/tests/Predis/Commands/StringSetTest.php b/tests/Predis/Command/StringSetTest.php similarity index 96% rename from tests/Predis/Commands/StringSetTest.php rename to tests/Predis/Command/StringSetTest.php index 70c70293..695ac56e 100644 --- a/tests/Predis/Commands/StringSetTest.php +++ b/tests/Predis/Command/StringSetTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringSetTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringSet'; + return 'Predis\Command\StringSet'; } /** diff --git a/tests/Predis/Commands/StringStrlenTest.php b/tests/Predis/Command/StringStrlenTest.php similarity index 96% rename from tests/Predis/Commands/StringStrlenTest.php rename to tests/Predis/Command/StringStrlenTest.php index 032563f7..539e5660 100644 --- a/tests/Predis/Commands/StringStrlenTest.php +++ b/tests/Predis/Command/StringStrlenTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class StringStrlenTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringStrlen'; + return 'Predis\Command\StringStrlen'; } /** diff --git a/tests/Predis/Commands/StringSubstrTest.php b/tests/Predis/Command/StringSubstrTest.php similarity index 95% rename from tests/Predis/Commands/StringSubstrTest.php rename to tests/Predis/Command/StringSubstrTest.php index 4831dcbb..a4ad56c9 100644 --- a/tests/Predis/Commands/StringSubstrTest.php +++ b/tests/Predis/Command/StringSubstrTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -28,7 +28,7 @@ class StringSubstrTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\StringSubstr'; + return 'Predis\Command\StringSubstr'; } /** diff --git a/tests/Predis/Commands/TransactionDiscardTest.php b/tests/Predis/Command/TransactionDiscardTest.php similarity index 95% rename from tests/Predis/Commands/TransactionDiscardTest.php rename to tests/Predis/Command/TransactionDiscardTest.php index 84bd8590..20fa9662 100644 --- a/tests/Predis/Commands/TransactionDiscardTest.php +++ b/tests/Predis/Command/TransactionDiscardTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class TransactionDiscardTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\TransactionDiscard'; + return 'Predis\Command\TransactionDiscard'; } /** diff --git a/tests/Predis/Commands/TransactionExecTest.php b/tests/Predis/Command/TransactionExecTest.php similarity index 96% rename from tests/Predis/Commands/TransactionExecTest.php rename to tests/Predis/Command/TransactionExecTest.php index 75e8c46e..fd09ddda 100644 --- a/tests/Predis/Commands/TransactionExecTest.php +++ b/tests/Predis/Command/TransactionExecTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class TransactionExecTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\TransactionExec'; + return 'Predis\Command\TransactionExec'; } /** diff --git a/tests/Predis/Commands/TransactionMultiTest.php b/tests/Predis/Command/TransactionMultiTest.php similarity index 92% rename from tests/Predis/Commands/TransactionMultiTest.php rename to tests/Predis/Command/TransactionMultiTest.php index ad818f48..78bfe633 100644 --- a/tests/Predis/Commands/TransactionMultiTest.php +++ b/tests/Predis/Command/TransactionMultiTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class TransactionMultiTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\TransactionMulti'; + return 'Predis\Command\TransactionMulti'; } /** @@ -74,7 +74,7 @@ class TransactionMultiTest extends CommandTestCase $redis = $this->getClient(); $this->assertTrue($redis->multi()); - $this->assertInstanceOf('Predis\IReplyObject', $redis->echo('tx1')); + $this->assertInstanceOf('Predis\ResponseObjectInterface', $redis->echo('tx1')); $this->assertInstanceOf('Predis\ResponseQueued', $redis->echo('tx2')); } diff --git a/tests/Predis/Commands/TransactionUnwatchTest.php b/tests/Predis/Command/TransactionUnwatchTest.php similarity index 95% rename from tests/Predis/Commands/TransactionUnwatchTest.php rename to tests/Predis/Command/TransactionUnwatchTest.php index 85393caa..c1f8f1f7 100644 --- a/tests/Predis/Commands/TransactionUnwatchTest.php +++ b/tests/Predis/Command/TransactionUnwatchTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class TransactionUnwatchTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\TransactionUnwatch'; + return 'Predis\Command\TransactionUnwatch'; } /** diff --git a/tests/Predis/Commands/TransactionWatchTest.php b/tests/Predis/Command/TransactionWatchTest.php similarity index 97% rename from tests/Predis/Commands/TransactionWatchTest.php rename to tests/Predis/Command/TransactionWatchTest.php index 33f6f1f1..01b1d5e2 100644 --- a/tests/Predis/Commands/TransactionWatchTest.php +++ b/tests/Predis/Command/TransactionWatchTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class TransactionWatchTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\TransactionWatch'; + return 'Predis\Command\TransactionWatch'; } /** diff --git a/tests/Predis/Commands/ZSetAddTest.php b/tests/Predis/Command/ZSetAddTest.php similarity index 97% rename from tests/Predis/Commands/ZSetAddTest.php rename to tests/Predis/Command/ZSetAddTest.php index c94ceb29..4f531c73 100644 --- a/tests/Predis/Commands/ZSetAddTest.php +++ b/tests/Predis/Command/ZSetAddTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetAddTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetAdd'; + return 'Predis\Command\ZSetAdd'; } /** diff --git a/tests/Predis/Commands/ZSetCardinalityTest.php b/tests/Predis/Command/ZSetCardinalityTest.php similarity index 96% rename from tests/Predis/Commands/ZSetCardinalityTest.php rename to tests/Predis/Command/ZSetCardinalityTest.php index 40bb8f2e..cc5548a8 100644 --- a/tests/Predis/Commands/ZSetCardinalityTest.php +++ b/tests/Predis/Command/ZSetCardinalityTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetCardinalityTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetCardinality'; + return 'Predis\Command\ZSetCardinality'; } /** diff --git a/tests/Predis/Commands/ZSetCountTest.php b/tests/Predis/Command/ZSetCountTest.php similarity index 97% rename from tests/Predis/Commands/ZSetCountTest.php rename to tests/Predis/Command/ZSetCountTest.php index db548696..d2e21be1 100644 --- a/tests/Predis/Commands/ZSetCountTest.php +++ b/tests/Predis/Command/ZSetCountTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetCountTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetCount'; + return 'Predis\Command\ZSetCount'; } /** diff --git a/tests/Predis/Commands/ZSetIncrementByTest.php b/tests/Predis/Command/ZSetIncrementByTest.php similarity index 96% rename from tests/Predis/Commands/ZSetIncrementByTest.php rename to tests/Predis/Command/ZSetIncrementByTest.php index 1994a23d..6939ccc6 100644 --- a/tests/Predis/Commands/ZSetIncrementByTest.php +++ b/tests/Predis/Command/ZSetIncrementByTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetIncrementByTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetIncrementBy'; + return 'Predis\Command\ZSetIncrementBy'; } /** diff --git a/tests/Predis/Commands/ZSetIntersectionStoreTest.php b/tests/Predis/Command/ZSetIntersectionStoreTest.php similarity index 98% rename from tests/Predis/Commands/ZSetIntersectionStoreTest.php rename to tests/Predis/Command/ZSetIntersectionStoreTest.php index 3d6c4c07..833a7ca5 100644 --- a/tests/Predis/Commands/ZSetIntersectionStoreTest.php +++ b/tests/Predis/Command/ZSetIntersectionStoreTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetIntersectionStoreTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetIntersectionStore'; + return 'Predis\Command\ZSetIntersectionStore'; } /** diff --git a/tests/Predis/Commands/ZSetRangeByScoreTest.php b/tests/Predis/Command/ZSetRangeByScoreTest.php similarity index 98% rename from tests/Predis/Commands/ZSetRangeByScoreTest.php rename to tests/Predis/Command/ZSetRangeByScoreTest.php index 1ed193f7..09872268 100644 --- a/tests/Predis/Commands/ZSetRangeByScoreTest.php +++ b/tests/Predis/Command/ZSetRangeByScoreTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetRangeByScoreTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetRangeByScore'; + return 'Predis\Command\ZSetRangeByScore'; } /** diff --git a/tests/Predis/Commands/ZSetRangeTest.php b/tests/Predis/Command/ZSetRangeTest.php similarity index 98% rename from tests/Predis/Commands/ZSetRangeTest.php rename to tests/Predis/Command/ZSetRangeTest.php index e92e064e..129f5739 100644 --- a/tests/Predis/Commands/ZSetRangeTest.php +++ b/tests/Predis/Command/ZSetRangeTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetRangeTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetRange'; + return 'Predis\Command\ZSetRange'; } /** diff --git a/tests/Predis/Commands/ZSetRankTest.php b/tests/Predis/Command/ZSetRankTest.php similarity index 97% rename from tests/Predis/Commands/ZSetRankTest.php rename to tests/Predis/Command/ZSetRankTest.php index add3652d..6da64801 100644 --- a/tests/Predis/Commands/ZSetRankTest.php +++ b/tests/Predis/Command/ZSetRankTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetRankTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetRank'; + return 'Predis\Command\ZSetRank'; } /** diff --git a/tests/Predis/Commands/ZSetRemoveRangeByRankTest.php b/tests/Predis/Command/ZSetRemoveRangeByRankTest.php similarity index 97% rename from tests/Predis/Commands/ZSetRemoveRangeByRankTest.php rename to tests/Predis/Command/ZSetRemoveRangeByRankTest.php index 18109e3e..882f0561 100644 --- a/tests/Predis/Commands/ZSetRemoveRangeByRankTest.php +++ b/tests/Predis/Command/ZSetRemoveRangeByRankTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetRemoveRangeByRankTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetRemoveRangeByRank'; + return 'Predis\Command\ZSetRemoveRangeByRank'; } /** diff --git a/tests/Predis/Commands/ZSetRemoveRangeByScoreTest.php b/tests/Predis/Command/ZSetRemoveRangeByScoreTest.php similarity index 96% rename from tests/Predis/Commands/ZSetRemoveRangeByScoreTest.php rename to tests/Predis/Command/ZSetRemoveRangeByScoreTest.php index 35edef39..77cdc60e 100644 --- a/tests/Predis/Commands/ZSetRemoveRangeByScoreTest.php +++ b/tests/Predis/Command/ZSetRemoveRangeByScoreTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetRemoveRangeByScoreTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetRemoveRangeByScore'; + return 'Predis\Command\ZSetRemoveRangeByScore'; } /** diff --git a/tests/Predis/Commands/ZSetRemoveTest.php b/tests/Predis/Command/ZSetRemoveTest.php similarity index 97% rename from tests/Predis/Commands/ZSetRemoveTest.php rename to tests/Predis/Command/ZSetRemoveTest.php index 3660bda0..8ba3d02c 100644 --- a/tests/Predis/Commands/ZSetRemoveTest.php +++ b/tests/Predis/Command/ZSetRemoveTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetRemoveTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetRemove'; + return 'Predis\Command\ZSetRemove'; } /** diff --git a/tests/Predis/Commands/ZSetReverseRangeByScoreTest.php b/tests/Predis/Command/ZSetReverseRangeByScoreTest.php similarity index 98% rename from tests/Predis/Commands/ZSetReverseRangeByScoreTest.php rename to tests/Predis/Command/ZSetReverseRangeByScoreTest.php index e9415191..4abd3668 100644 --- a/tests/Predis/Commands/ZSetReverseRangeByScoreTest.php +++ b/tests/Predis/Command/ZSetReverseRangeByScoreTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetReverseRangeByScoreTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetReverseRangeByScore'; + return 'Predis\Command\ZSetReverseRangeByScore'; } /** diff --git a/tests/Predis/Commands/ZSetReverseRangeTest.php b/tests/Predis/Command/ZSetReverseRangeTest.php similarity index 98% rename from tests/Predis/Commands/ZSetReverseRangeTest.php rename to tests/Predis/Command/ZSetReverseRangeTest.php index 6304b117..c354f679 100644 --- a/tests/Predis/Commands/ZSetReverseRangeTest.php +++ b/tests/Predis/Command/ZSetReverseRangeTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetReverseRangeTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetReverseRange'; + return 'Predis\Command\ZSetReverseRange'; } /** diff --git a/tests/Predis/Commands/ZSetReverseRankTest.php b/tests/Predis/Command/ZSetReverseRankTest.php similarity index 96% rename from tests/Predis/Commands/ZSetReverseRankTest.php rename to tests/Predis/Command/ZSetReverseRankTest.php index a2bbc88e..ffbc4a75 100644 --- a/tests/Predis/Commands/ZSetReverseRankTest.php +++ b/tests/Predis/Command/ZSetReverseRankTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetReverseRankTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetReverseRank'; + return 'Predis\Command\ZSetReverseRank'; } /** diff --git a/tests/Predis/Commands/ZSetScoreTest.php b/tests/Predis/Command/ZSetScoreTest.php similarity index 97% rename from tests/Predis/Commands/ZSetScoreTest.php rename to tests/Predis/Command/ZSetScoreTest.php index aebaefd0..778f8d38 100644 --- a/tests/Predis/Commands/ZSetScoreTest.php +++ b/tests/Predis/Command/ZSetScoreTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetScoreTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetScore'; + return 'Predis\Command\ZSetScore'; } /** diff --git a/tests/Predis/Commands/ZSetUnionStoreTest.php b/tests/Predis/Command/ZSetUnionStoreTest.php similarity index 98% rename from tests/Predis/Commands/ZSetUnionStoreTest.php rename to tests/Predis/Command/ZSetUnionStoreTest.php index d1bb599c..2a6d8811 100644 --- a/tests/Predis/Commands/ZSetUnionStoreTest.php +++ b/tests/Predis/Command/ZSetUnionStoreTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Commands; +namespace Predis\Command; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,7 +24,7 @@ class ZSetUnionStoreTest extends CommandTestCase */ protected function getExpectedCommand() { - return 'Predis\Commands\ZSetUnionStore'; + return 'Predis\Command\ZSetUnionStore'; } /** diff --git a/tests/Predis/CommunicationExceptionTest.php b/tests/Predis/CommunicationExceptionTest.php index 9480e166..09874c2a 100644 --- a/tests/Predis/CommunicationExceptionTest.php +++ b/tests/Predis/CommunicationExceptionTest.php @@ -12,7 +12,7 @@ namespace Predis; use \PHPUnit_Framework_TestCase as StandardTestCase; -use Predis\Network\IConnectionSingle; +use Predis\Connection\SingleConnectionInterface; /** * @@ -63,16 +63,16 @@ class CommunicationExceptionTest extends StandardTestCase * Returns a mocked connection instance. * * @param mixed $parameters Connection parameters. - * @return IConnectionSingle + * @return SingleConnectionInterface */ protected function getMockedConnectionBase($parameters = null) { - $builder = $this->getMockBuilder('Predis\Network\ConnectionBase'); + $builder = $this->getMockBuilder('Predis\Connection\AbstractConnection'); if ($parameters === null) { $builder->disableOriginalConstructor(); } - else if (!$parameters instanceof IConnectionParameters) { + else if (!$parameters instanceof ConnectionParametersInterface) { $parameters = new ConnectionParameters($parameters); } @@ -82,13 +82,13 @@ class CommunicationExceptionTest extends StandardTestCase /** * Returns a connection exception instance. * - * @param IConnectionSingle $message Connection instance. + * @param SingleConnectionInterface $message Connection instance. * @param string $message Exception message. * @param int $code Exception code. * @param \Exception $inner Inner exception. * @return \Exception */ - protected function getException(IConnectionSingle $connection, $message, $code = 0, \Exception $inner = null) + protected function getException(SingleConnectionInterface $connection, $message, $code = 0, \Exception $inner = null) { $arguments = array($connection, $message, $code, $inner); $mock = $this->getMockForAbstractClass('Predis\CommunicationException', $arguments); diff --git a/tests/Predis/Network/ConnectionExceptionTest.php b/tests/Predis/Connection/ConnectionExceptionTest.php similarity index 73% rename from tests/Predis/Network/ConnectionExceptionTest.php rename to tests/Predis/Connection/ConnectionExceptionTest.php index 18ae3e06..71cb4b6f 100644 --- a/tests/Predis/Network/ConnectionExceptionTest.php +++ b/tests/Predis/Connection/ConnectionExceptionTest.php @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; require_once __DIR__.'/../CommunicationExceptionTest.php'; use Predis\CommunicationExceptionTest; -use Predis\Network\IConnectionSingle; +use Predis\Connection\SingleConnectionInterface; /** * @@ -24,7 +24,7 @@ class ConnectionExceptionTest extends CommunicationExceptionTest /** * {@inheritdoc} */ - protected function getException(IConnectionSingle $connection, $message, $code = 0, \Exception $inner = null) + protected function getException(SingleConnectionInterface $connection, $message, $code = 0, \Exception $inner = null) { return new ConnectionException($connection, $message, $code, $inner); } diff --git a/tests/Predis/Network/MasterSlaveReplicationTest.php b/tests/Predis/Connection/MasterSlaveReplicationTest.php similarity index 98% rename from tests/Predis/Network/MasterSlaveReplicationTest.php rename to tests/Predis/Connection/MasterSlaveReplicationTest.php index d2b2121e..f0ab530a 100644 --- a/tests/Predis/Network/MasterSlaveReplicationTest.php +++ b/tests/Predis/Connection/MasterSlaveReplicationTest.php @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; use \PHPUnit_Framework_TestCase as StandardTestCase; use Predis\ConnectionParameters; -use Predis\Profiles\ServerProfile; +use Predis\Profile\ServerProfile; /** * @@ -554,14 +554,14 @@ class MasterSlaveReplicationTest extends StandardTestCase // ******************************************************************** // /** - * Returns a base mocked connection from Predis\Network\IConnectionSingle. + * Returns a base mocked connection from Predis\Connection\SingleConnectionInterface. * * @param mixed $parameters Optional parameters. * @return mixed */ protected function getMockConnection($parameters = null) { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); if ($parameters) { $parameters = new ConnectionParameters($parameters); diff --git a/tests/Predis/Network/PhpiredisConnectionTest.php b/tests/Predis/Connection/PhpiredisConnectionTest.php similarity index 96% rename from tests/Predis/Network/PhpiredisConnectionTest.php rename to tests/Predis/Connection/PhpiredisConnectionTest.php index 17799ae6..996c18fc 100644 --- a/tests/Predis/Network/PhpiredisConnectionTest.php +++ b/tests/Predis/Connection/PhpiredisConnectionTest.php @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; use \PHPUnit_Framework_TestCase as StandardTestCase; use Predis\ConnectionParameters; -use Predis\Profiles\ServerProfile; +use Predis\Profile\ServerProfile; /** * @group ext-phpiredis @@ -63,7 +63,7 @@ class PhpiredisConnectionTest extends ConnectionTestCase $unserialized = unserialize(serialize($connection)); - $this->assertInstanceOf('Predis\Network\PhpiredisConnection', $unserialized); + $this->assertInstanceOf('Predis\Connection\PhpiredisConnection', $unserialized); $this->assertEquals($parameters, $unserialized->getParameters()); } diff --git a/tests/Predis/Network/PredisClusterTest.php b/tests/Predis/Connection/PredisClusterTest.php similarity index 98% rename from tests/Predis/Network/PredisClusterTest.php rename to tests/Predis/Connection/PredisClusterTest.php index d6a2ccee..c5c8f790 100644 --- a/tests/Predis/Network/PredisClusterTest.php +++ b/tests/Predis/Connection/PredisClusterTest.php @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; use \PHPUnit_Framework_TestCase as StandardTestCase; use Predis\ConnectionParameters; -use Predis\Profiles\ServerProfile; +use Predis\Profile\ServerProfile; /** * @@ -345,14 +345,14 @@ class PredisClusterTest extends StandardTestCase // ******************************************************************** // /** - * Returns a base mocked connection from Predis\Network\IConnectionSingle. + * Returns a base mocked connection from Predis\Connection\SingleConnectionInterface. * * @param mixed $parameters Optional parameters. * @return mixed */ protected function getMockConnection($parameters = null) { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); if ($parameters) { $parameters = new ConnectionParameters($parameters); diff --git a/tests/Predis/Network/StreamConnectionTest.php b/tests/Predis/Connection/StreamConnectionTest.php similarity index 95% rename from tests/Predis/Network/StreamConnectionTest.php rename to tests/Predis/Connection/StreamConnectionTest.php index 48520e57..ab0ad07d 100644 --- a/tests/Predis/Network/StreamConnectionTest.php +++ b/tests/Predis/Connection/StreamConnectionTest.php @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; use \PHPUnit_Framework_TestCase as StandardTestCase; use Predis\ConnectionParameters; -use Predis\Profiles\ServerProfile; +use Predis\Profile\ServerProfile; /** * @@ -80,7 +80,7 @@ class StreamConnectionTest extends ConnectionTestCase $connection->executeCommand($profile->createCommand('rpush', array('metavars', 'foo', 'hoge', 'lol'))); $connection->writeCommand($profile->createCommand('lrange', array('metavars', 0, -1))); - $this->assertInstanceOf('Predis\Iterators\MultiBulkResponse', $iterator = $connection->read()); + $this->assertInstanceOf('Predis\Iterator\MultiBulkResponse', $iterator = $connection->read()); $this->assertSame(array('foo', 'hoge', 'lol'), iterator_to_array($iterator)); } diff --git a/tests/Predis/Network/WebdisConnectionTest.php b/tests/Predis/Connection/WebdisConnectionTest.php similarity index 90% rename from tests/Predis/Network/WebdisConnectionTest.php rename to tests/Predis/Connection/WebdisConnectionTest.php index 5742a99a..9b9e9a06 100644 --- a/tests/Predis/Network/WebdisConnectionTest.php +++ b/tests/Predis/Connection/WebdisConnectionTest.php @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -namespace Predis\Network; +namespace Predis\Connection; use \PHPUnit_Framework_TestCase as StandardTestCase; use Predis\ConnectionParameters; -use Predis\Profiles\ServerProfile; +use Predis\Profile\ServerProfile; /** * @group ext-curl @@ -37,7 +37,7 @@ class WebdisConnectionTest extends StandardTestCase /** * @group disconnected * @expectedException Predis\NotSupportedException - * @expectedExceptionMessage The method Predis\Network\WebdisConnection::writeCommand() is not supported + * @expectedExceptionMessage The method Predis\Connection\WebdisConnection::writeCommand() is not supported */ public function testWritingCommandsIsNotSupported() { @@ -48,7 +48,7 @@ class WebdisConnectionTest extends StandardTestCase /** * @group disconnected * @expectedException Predis\NotSupportedException - * @expectedExceptionMessage The method Predis\Network\WebdisConnection::readResponse() is not supported + * @expectedExceptionMessage The method Predis\Connection\WebdisConnection::readResponse() is not supported */ public function testReadingResponsesIsNotSupported() { @@ -59,7 +59,7 @@ class WebdisConnectionTest extends StandardTestCase /** * @group disconnected * @expectedException Predis\NotSupportedException - * @expectedExceptionMessage The method Predis\Network\WebdisConnection::read() is not supported + * @expectedExceptionMessage The method Predis\Connection\WebdisConnection::read() is not supported */ public function testReadingFromConnectionIsNotSupported() { @@ -70,7 +70,7 @@ class WebdisConnectionTest extends StandardTestCase /** * @group disconnected * @expectedException Predis\NotSupportedException - * @expectedExceptionMessage The method Predis\Network\WebdisConnection::pushInitCommand() is not supported + * @expectedExceptionMessage The method Predis\Connection\WebdisConnection::pushInitCommand() is not supported */ public function testPushingInitCommandsIsNotSupported() { @@ -110,7 +110,7 @@ class WebdisConnectionTest extends StandardTestCase $unserialized = unserialize(serialize($connection)); - $this->assertInstanceOf('Predis\Network\WebdisConnection', $unserialized); + $this->assertInstanceOf('Predis\Connection\WebdisConnection', $unserialized); $this->assertEquals($parameters, $unserialized->getParameters()); } @@ -141,7 +141,7 @@ class WebdisConnectionTest extends StandardTestCase /** * @group disconnected * @group slow - * @expectedException Predis\Network\ConnectionException + * @expectedException Predis\Connection\ConnectionException */ public function testThrowExceptionWhenUnableToConnect() { diff --git a/tests/Predis/ConnectionFactoryTest.php b/tests/Predis/ConnectionFactoryTest.php index 18b57639..09f69e9f 100644 --- a/tests/Predis/ConnectionFactoryTest.php +++ b/tests/Predis/ConnectionFactoryTest.php @@ -25,7 +25,7 @@ class ConnectionFactoryTest extends StandardTestCase { $factory = new ConnectionFactory(); - $this->assertInstanceOf('Predis\IConnectionFactory', $factory); + $this->assertInstanceOf('Predis\ConnectionFactoryInterface', $factory); } /** @@ -42,7 +42,7 @@ class ConnectionFactoryTest extends StandardTestCase $connection = $factory->create($tcp); $parameters = $connection->getParameters(); - $this->assertInstanceOf('Predis\Network\StreamConnection', $connection); + $this->assertInstanceOf('Predis\Connection\StreamConnection', $connection); $this->assertEquals($tcp->scheme, $parameters->scheme); $this->assertEquals($tcp->host, $parameters->host); $this->assertEquals($tcp->database, $parameters->database); @@ -55,7 +55,7 @@ class ConnectionFactoryTest extends StandardTestCase $connection = $factory->create($tcp); $parameters = $connection->getParameters(); - $this->assertInstanceOf('Predis\Network\StreamConnection', $connection); + $this->assertInstanceOf('Predis\Connection\StreamConnection', $connection); $this->assertEquals($tcp->scheme, $parameters->scheme); $this->assertEquals($tcp->database, $parameters->database); } @@ -69,7 +69,7 @@ class ConnectionFactoryTest extends StandardTestCase $connection = $factory->create(null); $parameters = $connection->getParameters(); - $this->assertInstanceOf('Predis\Network\IConnectionSingle', $connection); + $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection); $this->assertEquals('tcp', $parameters->scheme); $this->assertFalse($parameters->isSetByUser('custom')); } @@ -83,7 +83,7 @@ class ConnectionFactoryTest extends StandardTestCase $connection = $factory->create(array('scheme' => 'tcp', 'custom' => 'foobar')); $parameters = $connection->getParameters(); - $this->assertInstanceOf('Predis\Network\IConnectionSingle', $connection); + $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection); $this->assertEquals('tcp', $parameters->scheme); $this->assertTrue($parameters->isSetByUser('custom')); } @@ -97,7 +97,7 @@ class ConnectionFactoryTest extends StandardTestCase $connection = $factory->create('tcp://127.0.0.1?custom=foobar'); $parameters = $connection->getParameters(); - $this->assertInstanceOf('Predis\Network\IConnectionSingle', $connection); + $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection); $this->assertEquals('tcp', $parameters->scheme); $this->assertTrue($parameters->isSetByUser('custom')); } @@ -107,14 +107,14 @@ class ConnectionFactoryTest extends StandardTestCase */ public function testCreateConnectionWithoutInitializationCommands() { - $profile = $this->getMock('Predis\Profiles\IServerProfile'); + $profile = $this->getMock('Predis\Profile\ServerProfileInterface'); $profile->expects($this->never())->method('create'); $factory = new ConnectionFactory(); $parameters = new ConnectionParameters(); $connection = $factory->create($parameters, $profile); - $this->assertInstanceOf('Predis\Network\IConnectionSingle', $connection); + $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection); } /** @@ -129,10 +129,10 @@ class ConnectionFactoryTest extends StandardTestCase $createCommand = function($id, $arguments) use($test, &$commands) { $commands[$id] = $arguments; - return $test->getMock('Predis\Commands\ICommand'); + return $test->getMock('Predis\Command\CommandInterface'); }; - $profile = $this->getMock('Predis\Profiles\IServerProfile'); + $profile = $this->getMock('Predis\Profile\ServerProfileInterface'); $profile->expects($this->exactly(2)) ->method('createCommand') ->with($this->isType('string'), $this->isType('array')) @@ -142,7 +142,7 @@ class ConnectionFactoryTest extends StandardTestCase $parameters = new ConnectionParameters(array('database' => $database, 'password' => $password)); $connection = $factory->create($parameters, $profile); - $this->assertInstanceOf('Predis\Network\IConnectionSingle', $connection); + $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection); $this->assertEquals(2, count($commands)); // TODO: assertCount()? $this->assertEquals(array($database), $commands['select']); $this->assertEquals(array($password), $commands['auth']); @@ -237,7 +237,7 @@ class ConnectionFactoryTest extends StandardTestCase $factory->undefine('unknown'); $connection = $factory->create('tcp://127.0.0.1'); - $this->assertInstanceOf('Predis\Network\IConnectionSingle', $connection); + $this->assertInstanceOf('Predis\Connection\SingleConnectionInterface', $connection); } /** @@ -264,10 +264,10 @@ class ConnectionFactoryTest extends StandardTestCase { list(, $connectionClass) = $this->getMockConnectionClass(); - $cluster = $this->getMock('Predis\Network\IConnectionCluster'); + $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface'); $cluster->expects($this->exactly(2)) ->method('add') - ->with($this->isInstanceOf('Predis\Network\IConnectionSingle')); + ->with($this->isInstanceOf('Predis\Connection\SingleConnectionInterface')); $factory = $this->getMock('Predis\ConnectionFactory', array('create')); $factory->expects($this->never()) @@ -283,10 +283,10 @@ class ConnectionFactoryTest extends StandardTestCase { list(, $connectionClass) = $this->getMockConnectionClass(); - $cluster = $this->getMock('Predis\Network\IConnectionCluster'); + $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface'); $cluster->expects($this->exactly(4)) ->method('add') - ->with($this->isInstanceOf('Predis\Network\IConnectionSingle')); + ->with($this->isInstanceOf('Predis\Connection\SingleConnectionInterface')); $factory = $this->getMock('Predis\ConnectionFactory', array('create')); $factory->expects($this->exactly(3)) @@ -303,7 +303,7 @@ class ConnectionFactoryTest extends StandardTestCase */ public function testClusterWithEmptyListOfParameters() { - $cluster = $this->getMock('Predis\Network\IConnectionCluster'); + $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface'); $cluster->expects($this->never())->method('add'); $factory = $this->getMock('Predis\ConnectionFactory', array('create')); @@ -314,14 +314,14 @@ class ConnectionFactoryTest extends StandardTestCase /** * @group disconnected - * @todo We might want to add a test for IConnectionSingle::pushInitCommand(). + * @todo We might want to add a test for SingleConnectionInterface::pushInitCommand(). */ public function testClusterWithServerProfileArgument() { list(, $connectionClass) = $this->getMockConnectionClass(); - $cluster = $this->getMock('Predis\Network\IConnectionCluster'); - $profile = $this->getMock('Predis\Profiles\IServerProfile'); + $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface'); + $profile = $this->getMock('Predis\Profile\ServerProfileInterface'); $factory = $this->getMock('Predis\ConnectionFactory', array('create')); $factory->expects($this->exactly(2)) @@ -342,10 +342,10 @@ class ConnectionFactoryTest extends StandardTestCase { list(, $connectionClass) = $this->getMockConnectionClass(); - $replication = $this->getMock('Predis\Network\IConnectionReplication'); + $replication = $this->getMock('Predis\Connection\ReplicationConnectionInterface'); $replication->expects($this->exactly(4)) ->method('add') - ->with($this->isInstanceOf('Predis\Network\IConnectionSingle')); + ->with($this->isInstanceOf('Predis\Connection\SingleConnectionInterface')); $factory = $this->getMock('Predis\ConnectionFactory', array('create')); $factory->expects($this->exactly(3)) @@ -363,13 +363,13 @@ class ConnectionFactoryTest extends StandardTestCase // ******************************************************************** // /** - * Returns a mocked Predis\Network\IConnectionSingle. + * Returns a mocked Predis\Connection\SingleConnectionInterface. * * @return Array Mock instance and class name */ protected function getMockConnectionClass() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); return array($connection, get_class($connection)); } diff --git a/tests/Predis/Distribution/HashRingTest.php b/tests/Predis/Distribution/HashRingTest.php index 0bda99b0..a4277dd2 100644 --- a/tests/Predis/Distribution/HashRingTest.php +++ b/tests/Predis/Distribution/HashRingTest.php @@ -27,11 +27,11 @@ class HashRingTest extends DistributionStrategyTestCase /** * @group disconnected */ - public function testGenerateKey() + public function testHash() { $ring = $this->getDistributorInstance(); - $this->assertEquals(crc32('foobar'), $ring->generateKey('foobar')); + $this->assertEquals(crc32('foobar'), $ring->hash('foobar')); } /** diff --git a/tests/Predis/Distribution/KetamaPureRingTest.php b/tests/Predis/Distribution/KetamaPureRingTest.php index 8552a1b1..86cfa72e 100644 --- a/tests/Predis/Distribution/KetamaPureRingTest.php +++ b/tests/Predis/Distribution/KetamaPureRingTest.php @@ -27,12 +27,12 @@ class KetamaPureRingTest extends DistributionStrategyTestCase /** * @group disconnected */ - public function testGenerateKey() + public function testHash() { $ring = $this->getDistributorInstance(); list(, $hash) = unpack('V', md5('foobar', true)); - $this->assertEquals($hash, $ring->generateKey('foobar')); + $this->assertEquals($hash, $ring->hash('foobar')); } /** diff --git a/tests/Predis/HelpersTest.php b/tests/Predis/HelpersTest.php index 213f7646..f36f3320 100644 --- a/tests/Predis/HelpersTest.php +++ b/tests/Predis/HelpersTest.php @@ -23,8 +23,8 @@ class HelpersTest extends StandardTestCase */ public function testConnectionIsCluster() { - $single = $this->getMock('Predis\Network\IConnectionSingle'); - $cluster = $this->getMock('Predis\Network\IConnectionCluster'); + $single = $this->getMock('Predis\Connection\SingleConnectionInterface'); + $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface'); $this->assertFalse(Helpers::isCluster($single)); $this->assertTrue(Helpers::isCluster($cluster)); @@ -37,7 +37,7 @@ class HelpersTest extends StandardTestCase { $this->setExpectedException('Predis\CommunicationException'); - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->once())->method('isConnected')->will($this->returnValue(true)); $connection->expects($this->once())->method('disconnect'); diff --git a/tests/Predis/Iterators/MultiBulkResponseSimpleTest.php b/tests/Predis/Iterator/MultiBulkResponseSimpleTest.php similarity index 96% rename from tests/Predis/Iterators/MultiBulkResponseSimpleTest.php rename to tests/Predis/Iterator/MultiBulkResponseSimpleTest.php index ac9de50d..90fbb1bb 100644 --- a/tests/Predis/Iterators/MultiBulkResponseSimpleTest.php +++ b/tests/Predis/Iterator/MultiBulkResponseSimpleTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Iterators; +namespace Predis\Iterator; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -29,7 +29,7 @@ class MultiBulkResponseSimpleTest extends StandardTestCase $client->rpush('metavars', 'foo', 'hoge', 'lol'); $this->assertInstanceOf('Iterator', $iterator = $client->lrange('metavars', 0, -1)); - $this->assertInstanceOf('Predis\Iterators\MultiBulkResponseSimple', $iterator); + $this->assertInstanceOf('Predis\Iterator\MultiBulkResponseSimple', $iterator); $this->assertTrue($iterator->valid()); $this->assertSame(3, $iterator->count()); diff --git a/tests/Predis/Iterators/MultiBulkResponseTupleTest.php b/tests/Predis/Iterator/MultiBulkResponseTupleTest.php similarity index 91% rename from tests/Predis/Iterators/MultiBulkResponseTupleTest.php rename to tests/Predis/Iterator/MultiBulkResponseTupleTest.php index 7c01518b..7d1622a0 100644 --- a/tests/Predis/Iterators/MultiBulkResponseTupleTest.php +++ b/tests/Predis/Iterator/MultiBulkResponseTupleTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Iterators; +namespace Predis\Iterator; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -29,8 +29,8 @@ class MultiBulkResponseTupleTest extends StandardTestCase $client->zadd('metavars', 1, 'foo', 2, 'hoge', 3, 'lol'); $this->assertInstanceOf('OuterIterator', $iterator = $client->zrange('metavars', 0, -1, 'withscores')); - $this->assertInstanceOf('Predis\Iterators\MultiBulkResponseTuple', $iterator); - $this->assertInstanceOf('Predis\Iterators\MultiBulkResponseSimple', $iterator->getInnerIterator()); + $this->assertInstanceOf('Predis\Iterator\MultiBulkResponseTuple', $iterator); + $this->assertInstanceOf('Predis\Iterator\MultiBulkResponseSimple', $iterator->getInnerIterator()); $this->assertTrue($iterator->valid()); $this->assertSame(3, $iterator->count()); diff --git a/tests/Predis/MonitorContextTest.php b/tests/Predis/Monitor/MonitorContextTest.php similarity index 89% rename from tests/Predis/MonitorContextTest.php rename to tests/Predis/Monitor/MonitorContextTest.php index 2e72c577..a32e1660 100644 --- a/tests/Predis/MonitorContextTest.php +++ b/tests/Predis/Monitor/MonitorContextTest.php @@ -9,11 +9,12 @@ * file that was distributed with this source code. */ -namespace Predis; +namespace Predis\Monitor; use \PHPUnit_Framework_TestCase as StandardTestCase; -use Predis\Profiles\ServerProfile; +use Predis\Client; +use Predis\Profile\ServerProfile; /** * @group realm-monitor @@ -27,7 +28,7 @@ class MonitorContextTest extends StandardTestCase */ public function testMonitorContextRequireMonitorCommand() { - $profile = $this->getMock('Predis\Profiles\IServerProfile'); + $profile = $this->getMock('Predis\Profile\ServerProfileInterface'); $profile->expects($this->once()) ->method('supportsCommand') ->with('monitor') @@ -44,7 +45,7 @@ class MonitorContextTest extends StandardTestCase */ public function testMonitorContextDoesNotWorkOnClusters() { - $cluster = $this->getMock('Predis\Network\IConnectionCluster'); + $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface'); $client = new Client($cluster); $monitor = new MonitorContext($client); @@ -57,7 +58,7 @@ class MonitorContextTest extends StandardTestCase { $cmdMonitor = ServerProfile::getDefault()->createCommand('monitor'); - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $client = $this->getMock('Predis\Client', array('createCommand', 'executeCommand'), array($connection)); $client->expects($this->once()) @@ -79,7 +80,7 @@ class MonitorContextTest extends StandardTestCase */ public function testClosingContextClosesConnection() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $client = $this->getMock('Predis\Client', array('disconnect'), array($connection)); $client->expects($this->exactly(2))->method('disconnect'); @@ -93,7 +94,7 @@ class MonitorContextTest extends StandardTestCase */ public function testGarbageCollectorRunClosesContext() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $client = $this->getMock('Predis\Client', array('disconnect'), array($connection)); $client->expects($this->once())->method('disconnect'); @@ -109,7 +110,7 @@ class MonitorContextTest extends StandardTestCase { $message = '1323367530.939137 (db 15) "MONITOR"'; - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->once()) ->method('read') ->will($this->returnValue($message)); diff --git a/tests/Predis/Options/OptionTest.php b/tests/Predis/Option/AbstractOptionTest.php similarity index 68% rename from tests/Predis/Options/OptionTest.php rename to tests/Predis/Option/AbstractOptionTest.php index 8f3230a8..9a6c235f 100644 --- a/tests/Predis/Options/OptionTest.php +++ b/tests/Predis/Option/AbstractOptionTest.php @@ -9,14 +9,14 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; use \PHPUnit_Framework_TestCase as StandardTestCase; /** * */ -class OptionTest extends StandardTestCase +class AbstractOptionTest extends StandardTestCase { /** * @group disconnected @@ -24,8 +24,8 @@ class OptionTest extends StandardTestCase public function testValidationReturnsTheSameObject() { $value = new \stdClass(); - $options = $this->getMock('Predis\Options\IClientOptions'); - $option = new Option(); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); + $option = $this->getMockForAbstractClass('Predis\Option\AbstractOption'); $this->assertSame($value, $option->filter($options, $value)); } @@ -35,8 +35,8 @@ class OptionTest extends StandardTestCase */ public function testDefaultReturnsNull() { - $options = $this->getMock('Predis\Options\IClientOptions'); - $option = new Option(); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); + $option = $this->getMockForAbstractClass('Predis\Option\AbstractOption'); $this->assertNull($option->getDefault($options)); } @@ -47,9 +47,9 @@ class OptionTest extends StandardTestCase public function testInvokePerformsValidationWhenValueIsSet() { $value = new \stdClass(); - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); - $option = $this->getMock('Predis\Options\Option', array('filter', 'getDefault')); + $option = $this->getMock('Predis\Option\AbstractOption', array('filter', 'getDefault')); $option->expects($this->once()) ->method('filter') ->with($options, $value) @@ -65,9 +65,9 @@ class OptionTest extends StandardTestCase public function testInvokeReturnsDefaultWhenValueIsNotSet() { $expected = new \stdClass(); - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); - $option = $this->getMock('Predis\Options\Option', array('filter', 'getDefault')); + $option = $this->getMock('Predis\Option\AbstractOption', array('filter', 'getDefault')); $option->expects($this->never())->method('filter'); $option->expects($this->once()) ->method('getDefault') diff --git a/tests/Predis/Options/ClientClusterTest.php b/tests/Predis/Option/ClientClusterTest.php similarity index 67% rename from tests/Predis/Options/ClientClusterTest.php rename to tests/Predis/Option/ClientClusterTest.php index 7c69df05..279bf327 100644 --- a/tests/Predis/Options/ClientClusterTest.php +++ b/tests/Predis/Option/ClientClusterTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -23,14 +23,14 @@ class ClientClusterTest extends StandardTestCase */ public function testValidationAcceptsFQNStringAsInitializer() { - $clusterClass = get_class($this->getMock('Predis\Network\IConnectionCluster')); + $clusterClass = get_class($this->getMock('Predis\Connection\ClusterConnectionInterface')); - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientCluster(); $cluster = $option->filter($options, $clusterClass); - $this->assertInstanceOf('Predis\Network\IConnectionCluster', $cluster); + $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $cluster); } /** @@ -38,12 +38,12 @@ class ClientClusterTest extends StandardTestCase */ public function testValidationRecognizesCertainPredefinedShortNames() { - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientCluster(); $cluster = $option->filter($options, 'predis'); - $this->assertInstanceOf('Predis\Network\IConnectionCluster', $cluster); + $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $cluster); } /** @@ -51,20 +51,20 @@ class ClientClusterTest extends StandardTestCase */ public function testValidationAcceptsCallableObjectAsInitializers() { - $value = $this->getMock('Predis\Network\IConnectionCluster'); + $value = $this->getMock('Predis\Connection\ClusterConnectionInterface'); $initializer = $this->getMock('stdClass', array('__invoke')); $initializer->expects($this->once()) ->method('__invoke') - ->with($this->isInstanceOf('Predis\Options\IClientOptions')) + ->with($this->isInstanceOf('Predis\Option\ClientOptionsInterface')) ->will($this->returnValue($value)); - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientCluster(); $cluster = $option->filter($options, $initializer); - $this->assertInstanceOf('Predis\Network\IConnectionCluster', $cluster); + $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $cluster); $this->assertSame($value, $cluster); } @@ -75,8 +75,8 @@ class ClientClusterTest extends StandardTestCase { $this->setExpectedException('InvalidArgumentException'); - $connectionClass = get_class($this->getMock('Predis\Network\IConnectionSingle')); - $options = $this->getMock('Predis\Options\IClientOptions'); + $connectionClass = get_class($this->getMock('Predis\Connection\SingleConnectionInterface')); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientCluster(); $option->filter($options, $connectionClass); @@ -89,7 +89,7 @@ class ClientClusterTest extends StandardTestCase { $this->setExpectedException('InvalidArgumentException'); - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientCluster(); $option->filter($options, 'unknown'); @@ -104,7 +104,7 @@ class ClientClusterTest extends StandardTestCase $value = function($options) { return new \stdClass(); }; - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientCluster(); $option->filter($options, $value); @@ -117,7 +117,7 @@ class ClientClusterTest extends StandardTestCase { $this->setExpectedException('InvalidArgumentException'); - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientCluster(); $option->filter($options, new \stdClass()); diff --git a/tests/Predis/Options/ClientConnectionFactoryTest.php b/tests/Predis/Option/ClientConnectionFactoryTest.php similarity index 62% rename from tests/Predis/Options/ClientConnectionFactoryTest.php rename to tests/Predis/Option/ClientConnectionFactoryTest.php index 7052ba9c..449436c6 100644 --- a/tests/Predis/Options/ClientConnectionFactoryTest.php +++ b/tests/Predis/Option/ClientConnectionFactoryTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -25,17 +25,17 @@ class ClientConnectionFactoryTest extends StandardTestCase */ public function testValidationReturnsDefaultFactoryWithSchemeDefinitionsArray() { - $connectionClass = get_class($this->getMock('Predis\Network\IConnectionSingle')); + $connectionClass = get_class($this->getMock('Predis\Connection\SingleConnectionInterface')); $value = array('tcp' => $connectionClass, 'redis' => $connectionClass); - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); - $default = $this->getMock('Predis\IConnectionFactory'); + $default = $this->getMock('Predis\ConnectionFactoryInterface'); $default->expects($this->exactly(2)) ->method('define') ->with($this->matchesRegularExpression('/^tcp|redis$/'), $connectionClass); - $option = $this->getMock('Predis\Options\ClientConnectionFactory', array('getDefault')); + $option = $this->getMock('Predis\Option\ClientConnectionFactory', array('getDefault')); $option->expects($this->once()) ->method('getDefault') ->with($options) @@ -43,7 +43,7 @@ class ClientConnectionFactoryTest extends StandardTestCase $factory = $option->filter($options, $value); - $this->assertInstanceOf('Predis\IConnectionFactory', $factory); + $this->assertInstanceOf('Predis\ConnectionFactoryInterface', $factory); $this->assertSame($default, $factory); } @@ -52,10 +52,10 @@ class ClientConnectionFactoryTest extends StandardTestCase */ public function testValidationAcceptsFactoryInstancesAsValue() { - $value = $this->getMock('Predis\IConnectionFactory'); - $options = $this->getMock('Predis\Options\IClientOptions'); + $value = $this->getMock('Predis\ConnectionFactoryInterface'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); - $option = $this->getMock('Predis\Options\ClientConnectionFactory', array('getDefault')); + $option = $this->getMock('Predis\Option\ClientConnectionFactory', array('getDefault')); $option->expects($this->never())->method('getDefault'); $this->assertSame($value, $option->filter($options, $value)); @@ -67,9 +67,9 @@ class ClientConnectionFactoryTest extends StandardTestCase public function testValidationAcceptsStringAsValue() { $factory = 'Predis\ConnectionFactory'; - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); - $option = $this->getMock('Predis\Options\ClientConnectionFactory', array('getDefault')); + $option = $this->getMock('Predis\Option\ClientConnectionFactory', array('getDefault')); $option->expects($this->never())->method('getDefault'); $this->assertInstanceOf($factory, $option->filter($options, $factory)); @@ -82,7 +82,7 @@ class ClientConnectionFactoryTest extends StandardTestCase { $this->setExpectedException('InvalidArgumentException'); - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientConnectionFactory(); $option->filter($options, new \stdClass()); @@ -93,25 +93,25 @@ class ClientConnectionFactoryTest extends StandardTestCase */ public function testInvokeReturnsSpecifiedFactoryOrDefault() { - $value = $this->getMock('Predis\IConnectionFactory'); - $options = $this->getMock('Predis\Options\IClientOptions'); + $value = $this->getMock('Predis\ConnectionFactoryInterface'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); - $option = $this->getMock('Predis\Options\ClientConnectionFactory', array('filter', 'getDefault')); + $option = $this->getMock('Predis\Option\ClientConnectionFactory', array('filter', 'getDefault')); $option->expects($this->once()) ->method('filter') ->with($options, $value) ->will($this->returnValue($value)); $option->expects($this->never())->method('getDefault'); - $this->assertInstanceOf('Predis\IConnectionFactory', $option($options, $value)); + $this->assertInstanceOf('Predis\ConnectionFactoryInterface', $option($options, $value)); - $option = $this->getMock('Predis\Options\ClientConnectionFactory', array('filter', 'getDefault')); + $option = $this->getMock('Predis\Option\ClientConnectionFactory', array('filter', 'getDefault')); $option->expects($this->never())->method('filter'); $option->expects($this->once()) ->method('getDefault') ->with($options) ->will($this->returnValue($value)); - $this->assertInstanceOf('Predis\IConnectionFactory', $option($options, null)); + $this->assertInstanceOf('Predis\ConnectionFactoryInterface', $option($options, null)); } } diff --git a/tests/Predis/Options/ClientOptionsTest.php b/tests/Predis/Option/ClientOptionsTest.php similarity index 68% rename from tests/Predis/Options/ClientOptionsTest.php rename to tests/Predis/Option/ClientOptionsTest.php index a2b1090a..812c67cd 100644 --- a/tests/Predis/Options/ClientOptionsTest.php +++ b/tests/Predis/Option/ClientOptionsTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -26,9 +26,9 @@ class ClientOptionsTest extends StandardTestCase { $options = new ClientOptions(); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $options->profile); - $this->assertInstanceOf('Predis\Network\IConnectionCluster', $options->cluster); - $this->assertInstanceOf('Predis\IConnectionFactory', $options->connections); + $this->assertInstanceOf('Predis\ConnectionFactoryInterface', $options->connections); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $options->profile); + $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $options->cluster); $this->assertNull($options->prefix); } @@ -38,16 +38,16 @@ class ClientOptionsTest extends StandardTestCase public function testConstructorWithArrayArgument() { $options = new ClientOptions(array( - 'cluster' => 'Predis\Network\PredisCluster', + 'cluster' => 'Predis\Connection\PredisCluster', 'connections' => 'Predis\ConnectionFactory', 'prefix' => 'prefix:', 'profile' => '2.0', )); - $this->assertInstanceOf('Predis\Commands\Processors\ICommandProcessor', $options->prefix); - $this->assertInstanceOf('Predis\Network\IConnectionCluster', $options->cluster); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $options->profile); - $this->assertInstanceOf('Predis\IConnectionFactory', $options->connections); + $this->assertInstanceOf('Predis\ConnectionFactoryInterface', $options->connections); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $options->profile); + $this->assertInstanceOf('Predis\Connection\ClusterConnectionInterface', $options->cluster); + $this->assertInstanceOf('Predis\Command\Processor\CommandProcessorInterface', $options->prefix); } /** diff --git a/tests/Predis/Options/ClientPrefixTest.php b/tests/Predis/Option/ClientPrefixTest.php similarity index 65% rename from tests/Predis/Options/ClientPrefixTest.php rename to tests/Predis/Option/ClientPrefixTest.php index 697bf1a3..f007c795 100644 --- a/tests/Predis/Options/ClientPrefixTest.php +++ b/tests/Predis/Option/ClientPrefixTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -24,13 +24,13 @@ class ClientPrefixTest extends StandardTestCase public function testValidationReturnsCommandProcessor() { $value = 'prefix:'; - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientPrefix(); $return = $option->filter($options, $value); - $this->assertInstanceOf('Predis\Commands\Processors\ICommandProcessor', $return); - $this->assertInstanceOf('Predis\Commands\Processors\KeyPrefixProcessor', $return); + $this->assertInstanceOf('Predis\Command\Processor\CommandProcessorInterface', $return); + $this->assertInstanceOf('Predis\Command\Processor\KeyPrefixProcessor', $return); $this->assertEquals($value, $return->getPrefix()); } @@ -39,7 +39,7 @@ class ClientPrefixTest extends StandardTestCase */ public function testDefaultReturnsNull() { - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientPrefix(); $this->assertNull($option->getDefault($options)); @@ -50,10 +50,10 @@ class ClientPrefixTest extends StandardTestCase */ public function testInvokeReturnsCommandProcessorOrNull() { - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientPrefix(); - $this->assertInstanceOf('Predis\Commands\Processors\ICommandProcessor', $option($options, 'prefix:')); + $this->assertInstanceOf('Predis\Command\Processor\CommandProcessorInterface', $option($options, 'prefix:')); $this->assertNull($option($options, null)); } } diff --git a/tests/Predis/Options/ClientProfileTest.php b/tests/Predis/Option/ClientProfileTest.php similarity index 71% rename from tests/Predis/Options/ClientProfileTest.php rename to tests/Predis/Option/ClientProfileTest.php index 96104375..0b571bb2 100644 --- a/tests/Predis/Options/ClientProfileTest.php +++ b/tests/Predis/Option/ClientProfileTest.php @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; use \PHPUnit_Framework_TestCase as StandardTestCase; -use Predis\Profiles\ServerProfile; -use Predis\Commands\Processors\KeyPrefixProcessor; +use Predis\Profile\ServerProfile; +use Predis\Command\Processor\KeyPrefixProcessor; /** * @@ -26,12 +26,12 @@ class ClientProfileTest extends StandardTestCase */ public function testValidationReturnsServerProfileWithStringValue() { - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientProfile(); $profile = $option->filter($options, '2.0'); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile); $this->assertEquals('2.0', $profile->getVersion()); $this->assertNull($profile->getProcessor()); } @@ -42,12 +42,12 @@ class ClientProfileTest extends StandardTestCase public function testValidationAcceptsProfileInstancesAsValue() { $value = ServerProfile::get('2.0'); - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientProfile(); $profile = $option->filter($options, $value); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile); $this->assertEquals('2.0', $profile->getVersion()); $this->assertNull($profile->getProcessor()); } @@ -57,20 +57,20 @@ class ClientProfileTest extends StandardTestCase */ public function testValidationAcceptsCallableObjectAsInitializers() { - $value = $this->getMock('Predis\Profiles\IServerProfile'); + $value = $this->getMock('Predis\Profile\ServerProfileInterface'); $initializer = $this->getMock('stdClass', array('__invoke')); $initializer->expects($this->once()) ->method('__invoke') - ->with($this->isInstanceOf('Predis\Options\IClientOptions')) + ->with($this->isInstanceOf('Predis\Option\ClientOptionsInterface')) ->will($this->returnValue($value)); - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientProfile(); $profile = $option->filter($options, $initializer); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile); $this->assertSame($value, $profile); } @@ -81,7 +81,7 @@ class ClientProfileTest extends StandardTestCase { $this->setExpectedException('InvalidArgumentException'); - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientProfile(); $option->filter($options, new \stdClass()); @@ -92,12 +92,12 @@ class ClientProfileTest extends StandardTestCase */ public function testDefaultReturnsDefaultServerProfile() { - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientProfile(); $profile = $option->getDefault($options); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile); $this->assertInstanceOf(get_class(ServerProfile::getDefault()), $profile); $this->assertNull($profile->getProcessor()); } @@ -107,18 +107,18 @@ class ClientProfileTest extends StandardTestCase */ public function testInvokeReturnsSpecifiedServerProfileOrDefault() { - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientProfile(); $profile = $option($options, '2.0'); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile); $this->assertEquals('2.0', $profile->getVersion()); $this->assertNull($profile->getProcessor()); $profile = $option($options, null); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile); $this->assertInstanceOf(get_class(ServerProfile::getDefault()), $profile); $this->assertNull($profile->getProcessor()); } @@ -129,7 +129,7 @@ class ClientProfileTest extends StandardTestCase */ public function testFilterSetsPrefixProcessorFromClientOptions() { - $options = $this->getMock('Predis\Options\ClientOptions', array('__isset', '__get')); + $options = $this->getMock('Predis\Option\ClientOptions', array('__isset', '__get')); $options->expects($this->once()) ->method('__isset') ->with('prefix') @@ -143,9 +143,9 @@ class ClientProfileTest extends StandardTestCase $profile = $option->filter($options, '2.0'); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile); $this->assertEquals('2.0', $profile->getVersion()); - $this->assertInstanceOf('Predis\Commands\Processors\KeyPrefixProcessor', $profile->getProcessor()); + $this->assertInstanceOf('Predis\Command\Processor\KeyPrefixProcessor', $profile->getProcessor()); $this->assertEquals('prefix:', $profile->getProcessor()->getPrefix()); } @@ -155,7 +155,7 @@ class ClientProfileTest extends StandardTestCase */ public function testDefaultSetsPrefixProcessorFromClientOptions() { - $options = $this->getMock('Predis\Options\ClientOptions', array('__isset', '__get')); + $options = $this->getMock('Predis\Option\ClientOptions', array('__isset', '__get')); $options->expects($this->once()) ->method('__isset') ->with('prefix') @@ -169,9 +169,9 @@ class ClientProfileTest extends StandardTestCase $profile = $option->getDefault($options); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile); $this->assertInstanceOf(get_class(ServerProfile::getDefault()), $profile); - $this->assertInstanceOf('Predis\Commands\Processors\KeyPrefixProcessor', $profile->getProcessor()); + $this->assertInstanceOf('Predis\Command\Processor\KeyPrefixProcessor', $profile->getProcessor()); $this->assertEquals('prefix:', $profile->getProcessor()->getPrefix()); } @@ -180,7 +180,7 @@ class ClientProfileTest extends StandardTestCase */ public function testValidationDoesNotSetPrefixProcessorWhenValueIsProfileInstance() { - $options = $this->getMock('Predis\Options\ClientOptions', array('__isset', '__get')); + $options = $this->getMock('Predis\Option\ClientOptions', array('__isset', '__get')); $options->expects($this->never())->method('__isset'); $options->expects($this->never())->method('__get'); @@ -188,7 +188,7 @@ class ClientProfileTest extends StandardTestCase $profile = $option->filter($options, ServerProfile::getDefault()); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile); $this->assertNull($profile->getProcessor()); } @@ -201,7 +201,7 @@ class ClientProfileTest extends StandardTestCase { $value = function($options) { return new \stdClass(); }; - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new ClientProfile(); $option->filter($options, $value); diff --git a/tests/Predis/Options/CustomOptionTest.php b/tests/Predis/Option/CustomOptionTest.php similarity index 84% rename from tests/Predis/Options/CustomOptionTest.php rename to tests/Predis/Option/CustomOptionTest.php index 0b50d705..805cae2e 100644 --- a/tests/Predis/Options/CustomOptionTest.php +++ b/tests/Predis/Option/CustomOptionTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Options; +namespace Predis\Option; use \PHPUnit_Framework_TestCase as StandardTestCase; @@ -51,7 +51,7 @@ class CustomOptionTest extends StandardTestCase */ public function testFilterWithoutCallbackReturnsValue() { - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new CustomOption(); $this->assertEquals('test', $option->filter($options, 'test')); @@ -62,7 +62,7 @@ class CustomOptionTest extends StandardTestCase */ public function testDefaultWithoutCallbackReturnsNull() { - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $option = new CustomOption(); $this->assertNull($option->getDefault($options)); @@ -75,12 +75,12 @@ class CustomOptionTest extends StandardTestCase { $value = 'test'; - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $filter = $this->getMock('stdClass', array('__invoke')); $filter->expects($this->once()) ->method('__invoke') - ->with($this->isInstanceOf('Predis\Options\IClientOptions'), $value) + ->with($this->isInstanceOf('Predis\Option\ClientOptionsInterface'), $value) ->will($this->returnValue(true)); $default = $this->getMock('stdClass', array('__invoke')); @@ -96,7 +96,7 @@ class CustomOptionTest extends StandardTestCase */ public function testInvokeCallsDefaultCallback() { - $options = $this->getMock('Predis\Options\IClientOptions'); + $options = $this->getMock('Predis\Option\ClientOptionsInterface'); $filter = $this->getMock('stdClass', array('__invoke')); $filter->expects($this->never())->method('__invoke'); @@ -104,7 +104,7 @@ class CustomOptionTest extends StandardTestCase $default = $this->getMock('stdClass', array('__invoke')); $default->expects($this->once()) ->method('__invoke') - ->with($this->isInstanceOf('Predis\Options\IClientOptions')) + ->with($this->isInstanceOf('Predis\Option\ClientOptionsInterface')) ->will($this->returnValue(true)); $option = new CustomOption(array('filter' => $filter, 'default' => $default)); diff --git a/tests/Predis/Pipeline/PipelineContextTest.php b/tests/Predis/Pipeline/PipelineContextTest.php index d4b092d2..6940b12d 100644 --- a/tests/Predis/Pipeline/PipelineContextTest.php +++ b/tests/Predis/Pipeline/PipelineContextTest.php @@ -15,7 +15,7 @@ use \PHPUnit_Framework_TestCase as StandardTestCase; use Predis\Client; use Predis\ClientException; -use Predis\Profiles\ServerProfile; +use Predis\Profile\ServerProfile; /** * @@ -40,7 +40,7 @@ class PipelineContextTest extends StandardTestCase public function testConstructorWithOptions() { $client = new Client(); - $executor = $this->getMock('Predis\Pipeline\IPipelineExecutor'); + $executor = $this->getMock('Predis\Pipeline\PipelineExecutorInterface'); $pipeline = new PipelineContext($client, array('executor' => $executor)); $this->assertSame($executor, $pipeline->getExecutor()); @@ -48,7 +48,7 @@ class PipelineContextTest extends StandardTestCase $this->assertInstanceOf('Predis\Pipeline\SafeExecutor', $pipeline->getExecutor()); $options = array('executor' => 'safe'); - $client = new Client($this->getMock('Predis\Network\IConnectionCluster')); + $client = new Client($this->getMock('Predis\Connection\ClusterConnectionInterface')); $pipeline = new PipelineContext($client, array('safe' => true)); $this->assertInstanceOf('Predis\Pipeline\SafeClusterExecutor', $pipeline->getExecutor()); } @@ -58,7 +58,7 @@ class PipelineContextTest extends StandardTestCase */ public function testCallDoesNotSendCommandsWithoutExecute() { - $executor = $this->getMock('Predis\Pipeline\IPipelineExecutor'); + $executor = $this->getMock('Predis\Pipeline\PipelineExecutorInterface'); $executor->expects($this->never())->method('executor'); $pipeline = new PipelineContext(new Client(), array('executor' => $executor)); @@ -73,7 +73,7 @@ class PipelineContextTest extends StandardTestCase */ public function testCallReturnsPipelineForFluentInterface() { - $executor = $this->getMock('Predis\Pipeline\IPipelineExecutor'); + $executor = $this->getMock('Predis\Pipeline\PipelineExecutorInterface'); $executor->expects($this->never())->method('executor'); $pipeline = new PipelineContext(new Client(), array('executor' => $executor)); @@ -89,7 +89,7 @@ class PipelineContextTest extends StandardTestCase { $profile = ServerProfile::getDefault(); - $executor = $this->getMock('Predis\Pipeline\IPipelineExecutor'); + $executor = $this->getMock('Predis\Pipeline\PipelineExecutorInterface'); $executor->expects($this->never())->method('executor'); $pipeline = new PipelineContext(new Client(), array('executor' => $executor)); @@ -104,7 +104,7 @@ class PipelineContextTest extends StandardTestCase */ public function testExecuteWithEmptyBuffer() { - $executor = $this->getMock('Predis\Pipeline\IPipelineExecutor'); + $executor = $this->getMock('Predis\Pipeline\PipelineExecutorInterface'); $executor->expects($this->never())->method('executor'); $pipeline = new PipelineContext(new Client(), array('executor' => $executor)); @@ -117,7 +117,7 @@ class PipelineContextTest extends StandardTestCase */ public function testExecuteWithFilledBuffer() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->exactly(3)) ->method('writeCommand'); $connection->expects($this->exactly(3)) @@ -140,7 +140,7 @@ class PipelineContextTest extends StandardTestCase */ public function testFlushWithFalseArgumentDiscardsBuffer() { - $executor = $this->getMock('Predis\Pipeline\IPipelineExecutor'); + $executor = $this->getMock('Predis\Pipeline\PipelineExecutorInterface'); $executor->expects($this->never())->method('executor'); $pipeline = new PipelineContext(new Client(), array('executor' => $executor)); @@ -159,7 +159,7 @@ class PipelineContextTest extends StandardTestCase */ public function testFlushHandlesPartialBuffers() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->exactly(4)) ->method('writeCommand'); $connection->expects($this->exactly(4)) @@ -223,7 +223,7 @@ class PipelineContextTest extends StandardTestCase */ public function testExecuteWithCallableArgumentRunsPipelineInCallable() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->exactly(4)) ->method('writeCommand'); $connection->expects($this->exactly(4)) @@ -247,7 +247,7 @@ class PipelineContextTest extends StandardTestCase */ public function testExecuteWithCallableArgumentHandlesExceptions() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->never())->method('writeCommand'); $connection->expects($this->never())->method('readResponse'); diff --git a/tests/Predis/Profiles/ServerProfileTest.php b/tests/Predis/Profile/ServerProfileTest.php similarity index 82% rename from tests/Predis/Profiles/ServerProfileTest.php rename to tests/Predis/Profile/ServerProfileTest.php index 52606cfb..42e3430f 100644 --- a/tests/Predis/Profiles/ServerProfileTest.php +++ b/tests/Predis/Profile/ServerProfileTest.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace Predis\Profiles; +namespace Predis\Profile; use \PHPUnit_Framework_TestCase as StandardTestCase; -use Predis\Commands\Processors\ProcessorChain; +use Predis\Command\Processor\ProcessorChain; /** * @@ -29,7 +29,7 @@ class ServerProfileTest extends StandardTestCase { $profile = ServerProfile::get('2.0'); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile); $this->assertEquals('2.0', $profile->getVersion()); } @@ -42,9 +42,9 @@ class ServerProfileTest extends StandardTestCase $profile2 = ServerProfile::get('default'); $profile3 = ServerProfile::getDefault(); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile1); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile2); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile3); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile1); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile2); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile3); $this->assertEquals($profile1->getVersion(), $profile2->getVersion()); $this->assertEquals($profile2->getVersion(), $profile3->getVersion()); } @@ -57,8 +57,8 @@ class ServerProfileTest extends StandardTestCase $profile1 = ServerProfile::get('dev'); $profile2 = ServerProfile::getDevelopment(); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile1); - $this->assertInstanceOf('Predis\Profiles\IServerProfile', $profile2); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile1); + $this->assertInstanceOf('Predis\Profile\ServerProfileInterface', $profile2); $this->assertEquals(self::DEVELOPMENT_PROFILE_VERSION, $profile2->getVersion()); } @@ -77,7 +77,7 @@ class ServerProfileTest extends StandardTestCase */ public function testDefineProfile() { - $profileClass = get_class($this->getMock('Predis\Profiles\IServerProfile')); + $profileClass = get_class($this->getMock('Predis\Profile\ServerProfileInterface')); ServerProfile::define('mock', $profileClass); @@ -138,8 +138,8 @@ class ServerProfileTest extends StandardTestCase { $profile = ServerProfile::getDefault(); - $this->assertSame('Predis\Commands\ConnectionPing', $profile->getCommandClass('ping')); - $this->assertSame('Predis\Commands\ConnectionPing', $profile->getCommandClass('PING')); + $this->assertSame('Predis\Command\ConnectionPing', $profile->getCommandClass('ping')); + $this->assertSame('Predis\Command\ConnectionPing', $profile->getCommandClass('PING')); $this->assertNull($profile->getCommandClass('unknown')); $this->assertNull($profile->getCommandClass('UNKNOWN')); @@ -153,7 +153,7 @@ class ServerProfileTest extends StandardTestCase $profile = ServerProfile::getDefault(); $command = $profile->createCommand('info'); - $this->assertInstanceOf('Predis\Commands\ICommand', $command); + $this->assertInstanceOf('Predis\Command\CommandInterface', $command); $this->assertEquals('INFO', $command->getId()); $this->assertEquals(array(), $command->getArguments()); } @@ -167,7 +167,7 @@ class ServerProfileTest extends StandardTestCase $arguments = array('foo', 'bar'); $command = $profile->createCommand('set', $arguments); - $this->assertInstanceOf('Predis\Commands\ICommand', $command); + $this->assertInstanceOf('Predis\Command\CommandInterface', $command); $this->assertEquals('SET', $command->getId()); $this->assertEquals($arguments, $command->getArguments()); } @@ -198,7 +198,7 @@ class ServerProfileTest extends StandardTestCase */ public function testSetProcessor() { - $processor = $this->getMock('Predis\Commands\Processors\ICommandProcessor'); + $processor = $this->getMock('Predis\Command\Processor\CommandProcessorInterface'); $profile = ServerProfile::getDefault(); $profile->setProcessor($processor); @@ -211,7 +211,7 @@ class ServerProfileTest extends StandardTestCase */ public function testSetAndUnsetProcessor() { - $processor = $this->getMock('Predis\Commands\Processors\ICommandProcessor'); + $processor = $this->getMock('Predis\Command\Processor\CommandProcessorInterface'); $profile = ServerProfile::getDefault(); $profile->setProcessor($processor); @@ -230,10 +230,10 @@ class ServerProfileTest extends StandardTestCase { $argsRef = null; - $processor = $this->getMock('Predis\Commands\Processors\ICommandProcessor'); + $processor = $this->getMock('Predis\Command\Processor\CommandProcessorInterface'); $processor->expects($this->once()) ->method('process') - ->with($this->isInstanceOf('Predis\Commands\ICommand')) + ->with($this->isInstanceOf('Predis\Command\CommandInterface')) ->will($this->returnCallback(function($cmd) use(&$argsRef) { $cmd->setRawArguments($argsRef = array_map('strtoupper', $cmd->getArguments())); })); @@ -250,7 +250,7 @@ class ServerProfileTest extends StandardTestCase */ public function testChainOfProcessors() { - $processor = $this->getMock('Predis\Commands\Processors\ICommandProcessor'); + $processor = $this->getMock('Predis\Command\Processor\CommandProcessorInterface'); $processor->expects($this->exactly(2)) ->method('process'); diff --git a/tests/Predis/Profiles/ServerVersion12Test.php b/tests/Predis/Profile/ServerVersion12Test.php similarity index 99% rename from tests/Predis/Profiles/ServerVersion12Test.php rename to tests/Predis/Profile/ServerVersion12Test.php index ebfdf98c..a1747b56 100644 --- a/tests/Predis/Profiles/ServerVersion12Test.php +++ b/tests/Predis/Profile/ServerVersion12Test.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Profiles; +namespace Predis\Profile; /** * diff --git a/tests/Predis/Profiles/ServerVersion20Test.php b/tests/Predis/Profile/ServerVersion20Test.php similarity index 99% rename from tests/Predis/Profiles/ServerVersion20Test.php rename to tests/Predis/Profile/ServerVersion20Test.php index 02d17d1e..3b497369 100644 --- a/tests/Predis/Profiles/ServerVersion20Test.php +++ b/tests/Predis/Profile/ServerVersion20Test.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Profiles; +namespace Predis\Profile; /** * diff --git a/tests/Predis/Profiles/ServerVersion22Test.php b/tests/Predis/Profile/ServerVersion22Test.php similarity index 99% rename from tests/Predis/Profiles/ServerVersion22Test.php rename to tests/Predis/Profile/ServerVersion22Test.php index 0837e648..00f6e487 100644 --- a/tests/Predis/Profiles/ServerVersion22Test.php +++ b/tests/Predis/Profile/ServerVersion22Test.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Profiles; +namespace Predis\Profile; /** * diff --git a/tests/Predis/Profiles/ServerVersion24Test.php b/tests/Predis/Profile/ServerVersion24Test.php similarity index 99% rename from tests/Predis/Profiles/ServerVersion24Test.php rename to tests/Predis/Profile/ServerVersion24Test.php index 239d5b09..5b3bbd94 100644 --- a/tests/Predis/Profiles/ServerVersion24Test.php +++ b/tests/Predis/Profile/ServerVersion24Test.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Profiles; +namespace Predis\Profile; /** * diff --git a/tests/Predis/Profiles/ServerVersionNextTest.php b/tests/Predis/Profile/ServerVersionNextTest.php similarity index 99% rename from tests/Predis/Profiles/ServerVersionNextTest.php rename to tests/Predis/Profile/ServerVersionNextTest.php index 76679bd2..e3ea3f12 100644 --- a/tests/Predis/Profiles/ServerVersionNextTest.php +++ b/tests/Predis/Profile/ServerVersionNextTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Predis\Profiles; +namespace Predis\Profile; /** * diff --git a/tests/Predis/Protocol/ProtocolExceptionTest.php b/tests/Predis/Protocol/ProtocolExceptionTest.php index 0e970d33..a8b2ac7a 100644 --- a/tests/Predis/Protocol/ProtocolExceptionTest.php +++ b/tests/Predis/Protocol/ProtocolExceptionTest.php @@ -14,7 +14,7 @@ namespace Predis\Protocol; require_once __DIR__.'/../CommunicationExceptionTest.php'; use Predis\CommunicationExceptionTest; -use Predis\Network\IConnectionSingle; +use Predis\Connection\SingleConnectionInterface; /** * @@ -24,7 +24,7 @@ class ProtocolExceptionTest extends CommunicationExceptionTest /** * {@inheritdoc} */ - protected function getException(IConnectionSingle $connection, $message, $code = 0, \Exception $inner = null) + protected function getException(SingleConnectionInterface $connection, $message, $code = 0, \Exception $inner = null) { return new ProtocolException($connection, $message, $code, $inner); } diff --git a/tests/Predis/PubSub/DispatcherLoopTest.php b/tests/Predis/PubSub/DispatcherLoopTest.php index 7c646762..2ed234f6 100644 --- a/tests/Predis/PubSub/DispatcherLoopTest.php +++ b/tests/Predis/PubSub/DispatcherLoopTest.php @@ -14,7 +14,7 @@ namespace Predis\PubSub; use \PHPUnit_Framework_TestCase as StandardTestCase; use Predis\Client; -use Predis\Profiles\ServerProfile; +use Predis\Profile\ServerProfile; /** * @group realm-pubsub diff --git a/tests/Predis/PubSub/PubSubContextTest.php b/tests/Predis/PubSub/PubSubContextTest.php index e398fb30..d94cbbf8 100644 --- a/tests/Predis/PubSub/PubSubContextTest.php +++ b/tests/Predis/PubSub/PubSubContextTest.php @@ -14,7 +14,7 @@ namespace Predis\PubSub; use \PHPUnit_Framework_TestCase as StandardTestCase; use Predis\Client; -use Predis\Profiles\ServerProfile; +use Predis\Profile\ServerProfile; /** * @group realm-pubsub @@ -28,7 +28,7 @@ class PubSubContextTest extends StandardTestCase */ public function testPubSubContextRequirePubSubRelatedCommand() { - $profile = $this->getMock('Predis\Profiles\IServerProfile'); + $profile = $this->getMock('Predis\Profile\ServerProfileInterface'); $profile->expects($this->any()) ->method('supportsCommands') ->will($this->returnValue(false)); @@ -44,7 +44,7 @@ class PubSubContextTest extends StandardTestCase */ public function testPubSubContextDoesNotWorkOnClusters() { - $cluster = $this->getMock('Predis\Network\IConnectionCluster'); + $cluster = $this->getMock('Predis\Connection\ClusterConnectionInterface'); $client = new Client($cluster); $pubsub = new PubSubContext($client); @@ -55,7 +55,7 @@ class PubSubContextTest extends StandardTestCase */ public function testConstructorWithoutSubscriptionsDoesNotOpenContext() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $client = $this->getMock('Predis\Client', array('executeCommand'), array($connection)); $client->expects($this->never())->method('executeCommand'); @@ -73,7 +73,7 @@ class PubSubContextTest extends StandardTestCase $cmdSubscribe = $profile->createCommand('subscribe', array('channel:foo')); $cmdPsubscribe = $profile->createCommand('psubscribe', array('channels:*')); - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->exactly(2))->method('writeCommand'); $client = $this->getMock('Predis\Client', array('createCommand', 'writeCommand'), array($connection)); @@ -93,7 +93,7 @@ class PubSubContextTest extends StandardTestCase */ public function testClosingContextWithTrueClosesConnection() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $client = $this->getMock('Predis\Client', array('disconnect'), array($connection)); $client->expects($this->exactly(1))->method('disconnect'); @@ -114,7 +114,7 @@ class PubSubContextTest extends StandardTestCase $classUnsubscribe = $profile->getCommandClass('unsubscribe'); $classPunsubscribe = $profile->getCommandClass('punsubscribe'); - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $client = $this->getMock('Predis\Client', array('disconnect'), array($connection)); @@ -136,7 +136,7 @@ class PubSubContextTest extends StandardTestCase */ public function testIsNotValidWhenNotSubscribed() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $client = $this->getMock('Predis\Client', array('disconnect'), array($connection)); $pubsub = new PubSubContext($client); @@ -152,7 +152,7 @@ class PubSubContextTest extends StandardTestCase { $rawmessage = array('message', 'channel:foo', 'message from channel'); - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->once())->method('read')->will($this->returnValue($rawmessage)); $client = new Client($connection); @@ -171,7 +171,7 @@ class PubSubContextTest extends StandardTestCase { $rawmessage = array('pmessage', 'channel:*', 'channel:foo', 'message from channel'); - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->once())->method('read')->will($this->returnValue($rawmessage)); $client = new Client($connection); @@ -191,7 +191,7 @@ class PubSubContextTest extends StandardTestCase { $rawmessage = array('subscribe', 'channel:foo', 1); - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->once())->method('read')->will($this->returnValue($rawmessage)); $client = new Client($connection); @@ -210,7 +210,7 @@ class PubSubContextTest extends StandardTestCase { $rawmessage = array('unsubscribe', 'channel:foo', 1); - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->once())->method('read')->will($this->returnValue($rawmessage)); $client = new Client($connection); @@ -229,7 +229,7 @@ class PubSubContextTest extends StandardTestCase { $rawmessage = array('unsubscribe', 'channel:foo', 0); - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->once())->method('read')->will($this->returnValue($rawmessage)); $client = new Client($connection); diff --git a/tests/Predis/ResponseErrorTest.php b/tests/Predis/ResponseErrorTest.php index 560534d5..ec9e8bdc 100644 --- a/tests/Predis/ResponseErrorTest.php +++ b/tests/Predis/ResponseErrorTest.php @@ -27,8 +27,8 @@ class ResponseErrorTest extends StandardTestCase { $error = new ResponseError(self::ERR_WRONG_KEY_TYPE); - $this->assertInstanceOf('Predis\IRedisServerError', $error); - $this->assertInstanceOf('Predis\IReplyObject', $error); + $this->assertInstanceOf('Predis\ResponseErrorInterface', $error); + $this->assertInstanceOf('Predis\ResponseObjectInterface', $error); } /** diff --git a/tests/Predis/ResponseQueuedTest.php b/tests/Predis/ResponseQueuedTest.php index c88b6865..fb40011e 100644 --- a/tests/Predis/ResponseQueuedTest.php +++ b/tests/Predis/ResponseQueuedTest.php @@ -25,7 +25,7 @@ class ResponseQueuedTest extends StandardTestCase { $queued = new ResponseQueued(); - $this->assertInstanceOf('Predis\IReplyObject', $queued); + $this->assertInstanceOf('Predis\ResponseObjectInterface', $queued); } /** diff --git a/tests/Predis/ServerExceptionTest.php b/tests/Predis/ServerExceptionTest.php index 85cf5023..92410448 100644 --- a/tests/Predis/ServerExceptionTest.php +++ b/tests/Predis/ServerExceptionTest.php @@ -38,8 +38,8 @@ class ServerExceptionTest extends StandardTestCase $exception = new ServerException(self::ERR_WRONG_KEY_TYPE); $this->assertInstanceOf('Predis\ServerException', $exception); - $this->assertInstanceOf('Predis\IRedisServerError', $exception); - $this->assertInstanceOf('Predis\IReplyObject', $exception); + $this->assertInstanceOf('Predis\ResponseErrorInterface', $exception); + $this->assertInstanceOf('Predis\ResponseObjectInterface', $exception); $this->assertInstanceOf('Predis\PredisException', $exception); } diff --git a/tests/Predis/Transaction/MultiExecContextTest.php b/tests/Predis/Transaction/MultiExecContextTest.php index db34df48..cde2d6e1 100644 --- a/tests/Predis/Transaction/MultiExecContextTest.php +++ b/tests/Predis/Transaction/MultiExecContextTest.php @@ -16,7 +16,7 @@ use \PHPUnit_Framework_TestCase as StandardTestCase; use Predis\Client; use Predis\ResponseQueued; use Predis\ServerException; -use Predis\Commands\ICommand; +use Predis\Command\CommandInterface; /** * @group realm-transaction @@ -30,7 +30,7 @@ class MultiExecContextTest extends StandardTestCase */ public function testThrowsExceptionOnUnsupportedMultiExecInProfile() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $client = new Client($connection, '1.2'); $tx = new MultiExecContext($client); } @@ -42,7 +42,7 @@ class MultiExecContextTest extends StandardTestCase */ public function testThrowsExceptionOnUnsupportedWatchUnwatchInProfile() { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $client = new Client($connection, '2.0'); $tx = new MultiExecContext($client, array('options' => 'cas')); @@ -584,15 +584,15 @@ class MultiExecContextTest extends StandardTestCase // ******************************************************************** // /** - * Returns a mocked instance of Predis\Network\IConnectionSingle using - * the specified callback to return values from the executeCommand method. + * Returns a mocked instance of Predis\Connection\SingleConnectionInterface + * usingthe specified callback to return values from executeCommand(). * * @param \Closure $executeCallback - * @return \Predis\Network\IConnectionSingle + * @return \Predis\Connection\SingleConnectionInterface */ protected function getMockedConnection($executeCallback) { - $connection = $this->getMock('Predis\Network\IConnectionSingle'); + $connection = $this->getMock('Predis\Connection\SingleConnectionInterface'); $connection->expects($this->any()) ->method('executeCommand') ->will($this->returnCallback($executeCallback)); @@ -628,7 +628,7 @@ class MultiExecContextTest extends StandardTestCase { $multi = $watch = $abort = false; - return function(ICommand $command) use(&$expected, &$commands, &$cas, &$multi, &$watch, &$abort) { + return function(CommandInterface $command) use(&$expected, &$commands, &$cas, &$multi, &$watch, &$abort) { $cmd = $command->getId(); if ($multi || $cmd === 'MULTI') { @@ -690,7 +690,7 @@ class MultiExecContextTest extends StandardTestCase } /** - * Converts an array of instances of Predis\Commands\ICommand and + * Converts an array of instances of Predis\Command\CommandInterface and * returns an array containing their IDs. * * @param array $commands List of commands instances. diff --git a/tests/README.md b/tests/README.md index ad623923..604c5867 100644 --- a/tests/README.md +++ b/tests/README.md @@ -76,9 +76,9 @@ $ phpunit --exclude-group slow We also provide an helper script in the `bin` directory that can be used to automatically generate a file with the scheleton of a test case to test a Redis command by specifying -the name of the class in the `Predis\Commands` namespace (only classes in this namespace +the name of the class in the `Predis\Command` namespace (only classes in this namespace are considered valid). For example, to generate a test case for `SET` (represented by the -`Predis\Commands\StringSet` class): +`Predis\Command\StringSet` class): ```bash $ ./bin/generate-command-test.php --class=StringSet