public function hit($key, $decaySeconds = 1)
    {
        $key = $this->name . $key;

        /** @var \Neutrino\Cache\CacheStrategy $cache */
        $cache = $this->{Services::CACHE};

        if (!$cache->exists($key, $decaySeconds)) {
            $cache->save($key, 0, $decaySeconds);
        }

        $value = (int)$cache->get($key, $decaySeconds);

        $value++;
        $cache->save($key, $value, $decaySeconds);

        return $value;
    }
public function hit($key, $decaySeconds = 1)
    {
        $key = $this->name . $key;

        /** @var \Neutrino\Cache\CacheStrategy $cache */
        $cache = $this->{Services::CACHE};

        if (!$cache->exists($key, $decaySeconds)) {
            $cache->save($key, 0, $decaySeconds);
        }

        $value = (int)$cache->get($key, $decaySeconds);

        $value++;
        $cache->save($key, $value, $decaySeconds);

        return $value;
    }
public function hit ( $ key , $ decaySeconds = 1 ) { $ key = $ this -> name . $ key ; /** @var \Neutrino\Cache\CacheStrategy $cache */ $ cache = $ this -> { Services :: CACHE } ; if ( ! $ cache -> exists ( $ key , $ decaySeconds ) ) { $ cache -> save ( $ key , 0 , $ decaySeconds ) ; } $ value = ( int ) $ cache -> get ( $ key , $ decaySeconds ) ; $ value ++ ; $ cache -> save ( $ key , $ value , $ decaySeconds ) ; return $ value ; }
Increment the counter for a given key for a given decay time.

@param  string $key
@param  int    $decaySeconds

@return int
Increment the counter for a given key for a given decay time .