@@ -7,14 +7,14 @@ |
||
| 7 | 7 | $loop = React\EventLoop\Factory::create(); |
| 8 | 8 | $client = Factory::createClient($loop); |
| 9 | 9 | |
| 10 | -$client->set('name', 'test')->then(function(){ |
|
| 10 | +$client->set('name', 'test')->then(function() { |
|
| 11 | 11 | echo "The value was stored\n"; |
| 12 | 12 | }); |
| 13 | 13 | $client->end(); |
| 14 | -$client->get('name')->then(function($data){ |
|
| 14 | +$client->get('name')->then(function($data) { |
|
| 15 | 15 | var_dump($data); |
| 16 | 16 | echo "The value was retrieved\n"; |
| 17 | -}, function(Exception $e){ |
|
| 17 | +}, function(Exception $e) { |
|
| 18 | 18 | echo $e->getMessage(), "\n"; |
| 19 | 19 | }); |
| 20 | 20 | |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | |
| 10 | 10 | $client |
| 11 | 11 | ->someCommand() |
| 12 | - ->then('var_dump', function(Exception $e){ |
|
| 12 | + ->then('var_dump', function(Exception $e) { |
|
| 13 | 13 | echo $e->getMessage(); |
| 14 | 14 | }); |
| 15 | 15 | |
@@ -7,11 +7,11 @@ |
||
| 7 | 7 | $loop = React\EventLoop\Factory::create(); |
| 8 | 8 | $client = Factory::createClient($loop); |
| 9 | 9 | |
| 10 | -$client->add('name', ['test'])->then(function($result){ |
|
| 10 | +$client->add('name', ['test'])->then(function($result) { |
|
| 11 | 11 | var_dump($result); |
| 12 | 12 | echo "The value was added\n"; |
| 13 | 13 | }); |
| 14 | -$client->get('name')->then(function($data){ |
|
| 14 | +$client->get('name')->then(function($data) { |
|
| 15 | 15 | var_dump($data); |
| 16 | 16 | echo "The value was retrieved\n"; |
| 17 | 17 | }); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | // echo "The value was stored\n"; |
| 13 | 13 | //}); |
| 14 | 14 | $client->set('var', 2); |
| 15 | -$client->incr('var', 2)->then(function($data){ |
|
| 15 | +$client->incr('var', 2)->then(function($data) { |
|
| 16 | 16 | var_dump($data); |
| 17 | 17 | }); |
| 18 | 18 | |
@@ -7,12 +7,12 @@ |
||
| 7 | 7 | $loop = React\EventLoop\Factory::create(); |
| 8 | 8 | $client = Factory::createClient($loop); |
| 9 | 9 | |
| 10 | -$client->set('name', ['test'])->then(function($result){ |
|
| 10 | +$client->set('name', ['test'])->then(function($result) { |
|
| 11 | 11 | var_dump($result); |
| 12 | 12 | echo "The value was stored\n"; |
| 13 | 13 | }); |
| 14 | 14 | $client->flushAll()->then('var_dump'); |
| 15 | -$client->get('name')->then(function($data){ |
|
| 15 | +$client->get('name')->then(function($data) { |
|
| 16 | 16 | var_dump($data); |
| 17 | 17 | echo "The value was retrieved\n"; |
| 18 | 18 | }); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | $client = Factory::createClient($loop); |
| 9 | 9 | $client->set('example', 'Hello world'); |
| 10 | 10 | |
| 11 | -$client->get('example')->then(function ($data) { |
|
| 11 | +$client->get('example')->then(function($data) { |
|
| 12 | 12 | echo $data . PHP_EOL; // Hello world |
| 13 | 13 | }); |
| 14 | 14 | |
@@ -7,10 +7,10 @@ |
||
| 7 | 7 | $loop = React\EventLoop\Factory::create(); |
| 8 | 8 | |
| 9 | 9 | $client = Factory::createClient($loop); |
| 10 | -$client->version()->then(function($result){ |
|
| 10 | +$client->version()->then(function($result) { |
|
| 11 | 11 | echo "Memcached version: $result\n"; |
| 12 | 12 | }); |
| 13 | -$client->verbosity(2)->then(function($result){ |
|
| 13 | +$client->verbosity(2)->then(function($result) { |
|
| 14 | 14 | var_dump($result); die(); |
| 15 | 15 | }); |
| 16 | 16 | |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | |
| 10 | 10 | $client |
| 11 | 11 | ->touch('some_key', 12) |
| 12 | - ->then('var_dump', function(Exception $e){ |
|
| 12 | + ->then('var_dump', function(Exception $e) { |
|
| 13 | 13 | echo 'Error: ' . $e->getMessage(); |
| 14 | 14 | }); |
| 15 | 15 | |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | $client = Factory::createClient($loop); |
| 10 | 10 | |
| 11 | 11 | $loop->addPeriodicTimer(1, function() use ($client) { |
| 12 | - $client->version()->then(function($version){ |
|
| 12 | + $client->version()->then(function($version) { |
|
| 13 | 13 | echo 'Memcached version: ', $version, "\n"; |
| 14 | 14 | }); |
| 15 | 15 | }); |