Nelmio\Alice\Throwable\Exception\Generator\Context\CachedValueNotFound::create PHP Метод

create() публичный статический Метод

public static create ( string $key ) : self
$key string
Результат self
    public static function create(string $key) : self
    {
        return new self(sprintf('No value with the key "%s" was found in the cache.', $key));
    }

Usage Example

Пример #1
0
 /**
  * @param string $key
  *
  * @throws CachedValueNotFound
  *
  * @return mixed
  */
 public function getCachedValue(string $key)
 {
     if (false === array_key_exists($key, $this->cache)) {
         throw CachedValueNotFound::create($key);
     }
     return $this->cache[$key];
 }
CachedValueNotFound