@param string $key

@throws \Exception

@return mixed
334379
public static function getAndRemove(string $key)
    {
        static::startSessionIfNotHasStartedForceWrite();

        $value = static::get($key);
        static::remove($key);

        return $value;
    }
1129471
public function get(string $key)
    {
        if ($this->replacedPayload) {
            if (! \array_key_exists($key, $this->payload)) {
                throw new \BadMethodCallException("Message payload of {$this->messageName()} does not contain a key $key.");
            }

            return $this->payload[$key];
        }

        if ($key !== self::MESSAGE) {
            throw new \BadMethodCallException(__CLASS__ . ' payload only contains a ' . self::MESSAGE . ' key.');
        }

        return $this->message;
    }
549587
public function offsetGet( $key )
	{
		if( !isset( $this->____pairs ) )
			$this->getPairs();
		if( !array_key_exists( $key, $this->____pairs ) )
			throw new Exception( 'Pair Key "'.$key.'" is not set in Row.' );
		if( !isset( $this->$key ) )
			return NULL;
		return $this->$key;
	}
214844
private function getHashOption($key) {
        $option = $this->hasOption($key) ? $this->getOption($key) : [];
        if (!is_array($option)) {
            throw new \common_exception_InconsistentData($key.' is not an array');
        }
        return $option;
    }
358769
public function getObject($key)
    {
        try {
            $result = $this->get(self::OBJECT, $key);
            if (!settype($result, 'object')) {
                return null;
            }
        } catch (\Exception $e) {
            return null;
        }
        return $result;
    }
1094159
public function get($key)
	{
		// If the cached data has expired remove it and return.
		if ($this->exists($key) && $this->isExpired($key))
		{
			try
			{
				$this->remove($key);
			}
			catch (\RuntimeException $e)
			{
				throw new \RuntimeException(sprintf('Unable to clean expired cache entry for %s.', $key), null, $e);
			}

			return new Item($key);
		}

		if (!$this->exists($key))
		{
			return new Item($key);
		}

		$resource = @fopen($this->fetchStreamUri($key), 'rb');

		if (!$resource)
		{
			throw new \RuntimeException(sprintf('Unable to fetch cache entry for %s.  Connot open the resource.', $key));
		}

		// If locking is enabled get a shared lock for reading on the resource.
		if ($this->options['file.locking'] && !flock($resource, LOCK_SH))
		{
			throw new \RuntimeException(sprintf('Unable to fetch cache entry for %s.  Connot obtain a lock.', $key));
		}

		$data = stream_get_contents($resource);

		// If locking is enabled release the lock on the resource.
		if ($this->options['file.locking'] && !flock($resource, LOCK_UN))
		{
			throw new \RuntimeException(sprintf('Unable to fetch cache entry for %s.  Connot release the lock.', $key));
		}

		fclose($resource);

		$item = new Item($key);
		$item->setValue(unserialize($data));

		return $item;
	}
1190924
public static function get(string $key)
    {
        if (!in_array($key, self::$allowedKeys) || !isset(self::$storedValues[$key])) {
            throw new \InvalidArgumentException('Invalid key given');
        }

        return self::$storedValues[$key];
    }
1293384
public function get($key)
    {
        $key = $this->createKey($key);
        return $this->instance->get($key);
    }
139158
protected function get($key)
    {
        return isset($this->errors[$key]) ? $this->errors[$key] : null;
    }
897531
public function get( $key ) {

		if ( $this->has( $key ) ) {
			return $this->container[strtolower( $key )];
		}

		throw new InvalidArgumentException( "{$key} is unknown" );
	}
446197
public function getOrFail($key)
    {
        $value = $this->get($key, new None());
        if (!$value instanceof None) {
            return $value;
        }
        throw new KeyNotFoundException("Key '$key' not found'");
    }
490470
public function bucket($key = null) {
        if (!$this->id) {
            throw new Exception("The server has no ID, can\'t get buckets");
        }

        $bucket = new Bucket($this->patrol);

        $bucket->defaults([
            'server_id' => $this->id
        ]);

        if (is_null($key)) {
            return $bucket;
        }

        try {
            return $bucket->find($key);
        } catch (Exception $ex) {
            if ($ex->getMessage() === "Bucket does not exist") {
                $bucket->key = $key;
                return $bucket;
            }
        }

        return null;
    }
1338178
protected function getConfigItem(string $key)
    {
        if ($this->config === null) {
            $this->config = $this->container->config->get('exceptions', []);
        }

        return array_get($this->config, $key);
    }
1118586
protected function getValue($key)
    {
        $getResult = $this->getClient()->get($key);

        if ($this->getClient()->getResultCode() === \Memcached::RES_NOTFOUND) {
            throw new KeyNotFoundException();
        } elseif ($getResult === false) {
            throw new \Exception($this->getClient()->getResultMessage(), $this->getClient()->getResultCode());
        }

        return $getResult;
    }
267077
public function get($key)
    {
        $bucket = $this->locate($key);

        if ($bucket === null) {
            $message = sprintf('Key not found: %s', VarPrinter::toString($key));
            throw new KeyException($message);
        }

        return $bucket->value();
    }
1082517
public function getDate($key)
    {
        try {
            $result = $this->get(self::DATE, $key);
            if (!$result instanceof DateTime) {
                return null;
            }
        } catch (\Exception $e) {
            return null;
        }
        return $result;
    }
261462
protected function get($key)
    {
        $this->checkForNonEmptyKey($key);
        if (!$this->settingsHaveBeenRetrieved) {
            $this->retrieveSettings();
        }
        if (!isset($this->cachedSettings[$key])) {
            return null;
        }

        return $this->cachedSettings[$key];
    }