increment() public method

Note that if the value of the specified key is *not* an integer, the increment operation will have no effect whatsoever. Redis chooses to not typecast values to integers when performing an atomic increment operation.
public increment ( string $key, integer $offset = 1 ) : integer | boolean
$key string Key of numeric cache item to increment.
$offset integer Offset to increment - defaults to `1`.
return integer | boolean The item's new value on successful increment, else `false`.
Example #1
0
 public function testIncrementWithScope()
 {
     $adapter = new Redis(array('scope' => 'primary'));
     $this->_redis->set('primary:key1', 1, 60);
     $this->_redis->set('key1', 1, 60);
     $adapter->increment('key1');
     $expected = 1;
     $result = $this->_redis->get('key1');
     $this->assertEqual($expected, $result);
     $expected = 2;
     $result = $this->_redis->get('primary:key1');
     $this->assertEqual($expected, $result);
 }