protected function _cache($key, Closure $callback) {
        if (isset($this->_cache[$key])) {
            return $this->_cache[$key];
        }

        // Requires 5.4
        // Closure::bind($callback, $this, __CLASS__);

        $this->_cache[$key] = $callback($this);

        return $this->_cache[$key];
    }
protected function _cache($key, Closure $callback) {
        if (isset($this->_cache[$key])) {
            return $this->_cache[$key];
        }

        // Requires 5.4
        // Closure::bind($callback, $this, __CLASS__);

        $this->_cache[$key] = $callback($this);

        return $this->_cache[$key];
    }
protected function _cache ( $ key , Closure $ callback ) { if ( isset ( $ this -> _cache [ $ key ] ) ) { return $ this -> _cache [ $ key ] ; } // Requires 5.4 // Closure::bind($callback, $this, __CLASS__); $ this -> _cache [ $ key ] = $ callback ( $ this ) ; return $ this -> _cache [ $ key ] ; }
Cache the results of a callback.

@param string $key
@param \Closure $callback
@return mixed
Cache the results of a callback .