private function cache(string $method, $object, callable $callback)
    {
        $hash = spl_object_hash($object);

        if (! isset($this->cache[$method][$hash])) {
            $this->cache[$method][$hash] = $callback();
        }

        return $this->cache[$method][$hash];
    }
private function cache(string $method, $object, callable $callback)
    {
        $hash = spl_object_hash($object);

        if (! isset($this->cache[$method][$hash])) {
            $this->cache[$method][$hash] = $callback();
        }

        return $this->cache[$method][$hash];
    }
private function cache ( string $ method , $ object , callable $ callback ) { $ hash = spl_object_hash ( $ object ) ; if ( ! isset ( $ this -> cache [ $ method ] [ $ hash ] ) ) { $ this -> cache [ $ method ] [ $ hash ] = $ callback ( ) ; } return $ this -> cache [ $ method ] [ $ hash ] ; }
Caches the output of a worker function.

@param string   $method   The name of the calling method.
@param object   $object   The object to use as the cache key.
@param callable $callback The callback that does the actual work.

@return mixed The callback return value, potentially cached.
Caches the output of a worker function .