mirror of
https://github.com/predis/predis.git
synced 2026-08-24 14:29:35 +00:00
Apply some coding style changes.
This commit is contained in:
@@ -9,12 +9,15 @@ require 'SharedConfigurations.php';
|
||||
|
||||
use Predis\Commands\ScriptedCommand;
|
||||
|
||||
class IncrementExistingKey extends ScriptedCommand {
|
||||
protected function keysCount() {
|
||||
class IncrementExistingKey extends ScriptedCommand
|
||||
{
|
||||
protected function keysCount()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function getScript() {
|
||||
public function getScript()
|
||||
{
|
||||
return
|
||||
<<<LUA
|
||||
if redis('exists', KEYS[1]) == 1 then
|
||||
@@ -25,8 +28,10 @@ LUA;
|
||||
}
|
||||
|
||||
$client = new Predis\Client($single_server, 'dev');
|
||||
|
||||
$client->getProfile()->defineCommand('increx', 'IncrementExistingKey');
|
||||
|
||||
$client->set('foo', 10);
|
||||
|
||||
var_dump($client->increx('foo')); // int(11)
|
||||
var_dump($client->increx('bar')); // NULL
|
||||
|
||||
Reference in New Issue
Block a user