public function getCachedExperiment($name)
    {
        if ($this->cache->contains($name)) {
            $experiment = $this->cache->fetch($name);
        } elseif ($this->has($name)) {
            $experiment = $this->get($name)->getSerializableData();
        } else {
            return null;
        }

        if (!isset($experiment['type']) || $experiment['type'] !== 'experiment') {
            throw new LogicException(
                sprintf('The setting `%s` was found but it is not an experiment', $name)
            );
        }

        $this->cache->save($name, $experiment);

        return $experiment;
    }
public function getCachedExperiment($name)
    {
        if ($this->cache->contains($name)) {
            $experiment = $this->cache->fetch($name);
        } elseif ($this->has($name)) {
            $experiment = $this->get($name)->getSerializableData();
        } else {
            return null;
        }

        if (!isset($experiment['type']) || $experiment['type'] !== 'experiment') {
            throw new LogicException(
                sprintf('The setting `%s` was found but it is not an experiment', $name)
            );
        }

        $this->cache->save($name, $experiment);

        return $experiment;
    }
public function getCachedExperiment ( $ name ) { if ( $ this -> cache -> contains ( $ name ) ) { $ experiment = $ this -> cache -> fetch ( $ name ) ; } elseif ( $ this -> has ( $ name ) ) { $ experiment = $ this -> get ( $ name ) -> getSerializableData ( ) ; } else { return null ; } if ( ! isset ( $ experiment [ 'type' ] ) || $ experiment [ 'type' ] !== 'experiment' ) { throw new LogicException ( sprintf ( 'The setting `%s` was found but it is not an experiment' , $ name ) ) ; } $ this -> cache -> save ( $ name , $ experiment ) ; return $ experiment ; }
Get full experiment by caching.

@param string $name

@return array|null

@throws LogicException
Get full experiment by caching .