示例#1
0
 /**
  * Get a cookie from this container.
  * @param  string $key
  *  String reference to get from the container
  * @return mixed
  *  Mixed value from the container
  */
 public function offsetGet($key)
 {
     if (!isset($this->fresh[$key]) && !isset($this->existing[$key])) {
         throw new \InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $key));
     }
     $cookie = $this->fresh->offsetExists($key) ? $this->fresh->offsetGet($key) : null;
     $cookie = is_null($cookie) && $this->existing->offsetExists($key) ? $this->existing->offsetGet($key) : $cookie;
     return $cookie;
 }