Do not use new classes for variadic RPUSH, LPUSH, SADD, SREM and HDEL in the 2.4 profile.

This commit is contained in:
Daniele Alessandri
2011-05-31 21:26:04 +02:00
parent 2012963ed0
commit 42521f2558
11 changed files with 25 additions and 93 deletions
+6
View File
@@ -2,11 +2,17 @@
namespace Predis\Commands;
use Predis\Helpers;
class HashDelete extends Command {
public function getId() {
return 'HDEL';
}
protected function filterArguments(Array $arguments) {
return Helpers::filterVariadicValues($arguments);
}
public function parseResponse($data) {
return (bool) $data;
}
-19
View File
@@ -1,19 +0,0 @@
<?php
namespace Predis\Commands;
use Predis\Helpers;
class HashDeleteV24x extends Command {
public function getId() {
return 'HDEL';
}
protected function filterArguments(Array $arguments) {
return Helpers::filterVariadicValues($arguments);
}
public function parseResponse($data) {
return (bool) $data;
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
namespace Predis\Commands;
class ListPushHead extends Command {
class ListPushHead extends ListPushTail {
public function getId() {
return 'LPUSH';
}
-9
View File
@@ -1,9 +0,0 @@
<?php
namespace Predis\Commands;
class ListPushHeadV24x extends ListPushTailV24x {
public function getId() {
return 'LPUSH';
}
}
+6
View File
@@ -2,8 +2,14 @@
namespace Predis\Commands;
use Predis\Helpers;
class ListPushTail extends Command {
public function getId() {
return 'RPUSH';
}
protected function filterArguments(Array $arguments) {
return Helpers::filterVariadicValues($arguments);
}
}
-15
View File
@@ -1,15 +0,0 @@
<?php
namespace Predis\Commands;
use Predis\Helpers;
class ListPushTailV24x extends Command {
public function getId() {
return 'RPUSH';
}
protected function filterArguments(Array $arguments) {
return Helpers::filterVariadicValues($arguments);
}
}
+6
View File
@@ -2,11 +2,17 @@
namespace Predis\Commands;
use Predis\Helpers;
class SetAdd extends Command {
public function getId() {
return 'SADD';
}
protected function filterArguments(Array $arguments) {
return Helpers::filterVariadicValues($arguments);
}
public function parseResponse($data) {
return (bool) $data;
}
-19
View File
@@ -1,19 +0,0 @@
<?php
namespace Predis\Commands;
use Predis\Helpers;
class SetAddV24x extends Command {
public function getId() {
return 'SADD';
}
protected function filterArguments(Array $arguments) {
return Helpers::filterVariadicValues($arguments);
}
public function parseResponse($data) {
return (bool) $data;
}
}
+6
View File
@@ -2,11 +2,17 @@
namespace Predis\Commands;
use Predis\Helpers;
class SetRemove extends Command {
public function getId() {
return 'SREM';
}
protected function filterArguments(Array $arguments) {
return Helpers::filterVariadicValues($arguments);
}
public function parseResponse($data) {
return (bool) $data;
}
-19
View File
@@ -1,19 +0,0 @@
<?php
namespace Predis\Commands;
use Predis\Helpers;
class SetRemoveV24x extends Command {
public function getId() {
return 'SREM';
}
protected function filterArguments(Array $arguments) {
return Helpers::filterVariadicValues($arguments);
}
public function parseResponse($data) {
return (bool) $data;
}
}
-11
View File
@@ -6,17 +6,6 @@ class ServerVersionNext extends ServerVersion22 {
public function getVersion() { return '2.4'; }
public function getSupportedCommands() {
return array_merge(parent::getSupportedCommands(), array(
/* commands operating on lists */
'rpush' => '\Predis\Commands\ListPushTailV24x',
'lpush' => '\Predis\Commands\ListPushHeadV24x',
/* commands operating on sets */
'sadd' => '\Predis\Commands\SetAddV24x',
'srem' => '\Predis\Commands\SetRemoveV24x',
/* commands operating on hashes */
'hdel' => '\Predis\Commands\HashDeleteV24x',
/* remote server control commands */
'info' => '\Predis\Commands\ServerInfoV24x',
'client' => '\Predis\Commands\ServerClient',