@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | /** |
| 74 | 74 | * Obtain multiple cache items by their unique keys |
| 75 | 75 | * |
| 76 | - * @param array|Traversable $keys A list of keys that can obtained in a single operation. |
|
| 76 | + * @param string[] $keys A list of keys that can obtained in a single operation. |
|
| 77 | 77 | * |
| 78 | 78 | * @return array An array of key => value pairs. Cache keys that do not exist or are stale will have a value of null. |
| 79 | 79 | */ |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | /** |
| 98 | 98 | * Delete multiple cache items in a single operation |
| 99 | 99 | * |
| 100 | - * @param array|Traversable $keys The array of string-based keys to be deleted |
|
| 100 | + * @param string[] $keys The array of string-based keys to be deleted |
|
| 101 | 101 | * |
| 102 | 102 | * @return bool True on success and false on failure |
| 103 | 103 | */ |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @param string $key The cache item key |
| 112 | 112 | * @param integer $step The value to increment by, defaulting to 1 |
| 113 | 113 | * |
| 114 | - * @return int|bool The new value on success and false on failure |
|
| 114 | + * @return integer The new value on success and false on failure |
|
| 115 | 115 | */ |
| 116 | 116 | public function increment($key, $step = 1) |
| 117 | 117 | { |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | * @param string $key The cache item key |
| 124 | 124 | * @param integer $step The value to decrement by, defaulting to 1 |
| 125 | 125 | * |
| 126 | - * @return int|bool The new value on success and false on failure |
|
| 126 | + * @return integer The new value on success and false on failure |
|
| 127 | 127 | */ |
| 128 | 128 | public function decrement($key, $step = 1) |
| 129 | 129 | { |
@@ -16,10 +16,10 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function __construct(array $config) |
| 18 | 18 | { |
| 19 | - $this->handler= new \Memcached($config['bucket']); |
|
| 19 | + $this->handler = new \Memcached($config['bucket']); |
|
| 20 | 20 | $this->handler->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, true); |
| 21 | 21 | $this->handler->setOption(\Memcached::OPT_BINARY_PROTOCOL, true); |
| 22 | - if(\Memcached::HAVE_IGBINARY){ |
|
| 22 | + if (\Memcached::HAVE_IGBINARY) { |
|
| 23 | 23 | ini_set("memcached.serializer", "igbinary"); |
| 24 | 24 | } |
| 25 | 25 | if (!count($this->handler->getServerList())) { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * |
| 53 | 53 | * @return bool True on success and false on failure |
| 54 | 54 | */ |
| 55 | - public function set($key, $value, $ttl = null){ |
|
| 55 | + public function set($key, $value, $ttl = null) { |
|
| 56 | 56 | return $this->handler->set($key, $value, intval($ttl)); |
| 57 | 57 | } |
| 58 | 58 | /** |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * |
| 63 | 63 | * @return bool True on success and false on failure |
| 64 | 64 | */ |
| 65 | - public function delete($key){ |
|
| 65 | + public function delete($key) { |
|
| 66 | 66 | return (bool) $this->handler->delete($key); |
| 67 | 67 | } |
| 68 | 68 | /** |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @return bool True on success and false on failure |
| 72 | 72 | */ |
| 73 | - public function clear(){ |
|
| 73 | + public function clear() { |
|
| 74 | 74 | return $this->handler->flush(); |
| 75 | 75 | } |
| 76 | 76 | /** |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Composer\Autoload\ClassLoader; |
| 5 | 5 | |
| 6 | -require_once dirname(__DIR__) . '/vendor/autoload.php'; |
|
| 6 | +require_once dirname(__DIR__).'/vendor/autoload.php'; |
|
| 7 | 7 | $loader = new ClassLoader(); |
| 8 | 8 | $loader->add('tests', dirname(__DIR__)); |
| 9 | 9 | $loader->register(); |
@@ -21,10 +21,10 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | public function testSetGetDeleteItem() |
| 23 | 23 | { |
| 24 | - $ins1 = $this->client->set('test1','value1'); |
|
| 24 | + $ins1 = $this->client->set('test1', 'value1'); |
|
| 25 | 25 | $this->assertTrue($ins1); |
| 26 | 26 | $value1 = $this->client->get('test1'); |
| 27 | - $this->assertEquals('value1',$value1); |
|
| 27 | + $this->assertEquals('value1', $value1); |
|
| 28 | 28 | $delete = $this->client->delete('test1'); |
| 29 | 29 | $this->assertTrue($delete); |
| 30 | 30 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $this->assertEquals(0, $counter_d_0); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - public function testClear(){ |
|
| 73 | + public function testClear() { |
|
| 74 | 74 | $clear = $this->client->clear(); |
| 75 | 75 | $this->assertTrue($clear); |
| 76 | 76 | } |