Parse a dot.notated.key to an object

@param string|AccessKey $key The key

@return AccessKey The parsed key
182385
private function parseKey($key)
    {
        if (is_object($key) and $key instanceof AccessKey) {
            return $key;
        }

        $key = AccessKey::create($key);

        return $key;
    }
750780
private function getKey($key)
    {
        if (!isset($this->cache[$key])) {
            if (!isset($this->mappings[$key])) {
                list($type, $name) = explode('.', $key);
                throw new InvalidArgumentException("No {$type} visitor has been mapped for {$name}");
            }
            $this->cache[$key] = new $this->mappings[$key];
        }

        return $this->cache[$key];
    }
223610
protected function parse_key($key)
    {
        $ekey = new enigma_key();

        foreach ($key->getUserIds() as $idx => $user) {
            $id = new enigma_userid();
            $id->name    = $user->getName();
            $id->comment = $user->getComment();
            $id->email   = $user->getEmail();
            $id->valid   = $user->isValid();
            $id->revoked = $user->isRevoked();

            $ekey->users[$idx] = $id;
        }

        $ekey->name = trim($ekey->users[0]->name . ' <' . $ekey->users[0]->email . '>');

        // keep reference to Crypt_GPG's key for performance reasons
        $ekey->reference = $key;

        foreach ($key->getSubKeys() as $idx => $subkey) {
            $skey = new enigma_subkey();
            $skey->id          = $subkey->getId();
            $skey->revoked     = $subkey->isRevoked();
            $skey->created     = $subkey->getCreationDate();
            $skey->expires     = $subkey->getExpirationDate();
            $skey->fingerprint = $subkey->getFingerprint();
            $skey->has_private = $subkey->hasPrivate();
            $skey->algorithm   = $subkey->getAlgorithm();
            $skey->length      = $subkey->getLength();
            $skey->usage       = $subkey->usage();

            $ekey->subkeys[$idx] = $skey;
        };

        $ekey->id = $ekey->subkeys[0]->id;

        return $ekey;
    }
718963
function get($key) {
        if(\is_array($key) || \is_object($key)) {
            throw new \InvalidArgumentException('Key can not be an array or object');
        }
        
        $key = (string) $key;
        return parent::get($key);
    }
1206289
public function offsetGet($key)
    {
        assert(
            is_string($key),
            sprintf('Invalid metadata key: (%s) %s', gettype($key), VarPrinter::toString($key))
        );

        return $this->get($key);
    }
1018365
private function __key($key)
    {
        if ($key instanceof AnObjectHandlable) {
            $key = $key->getHandle();
        } elseif (gettype($key) == 'object') {
            $key = spl_object_hash($key);
        }

        return $key;
    }
94254
protected function parseSubkeys($key) {
        $k          = $key;
        $subkeys    = [];
        $quoteChars = ["'", '"'];                       // single and double quotes

        while (true) {
            $k = trim($k);

            foreach ($quoteChars as $char) {
                if (strpos($k, $char) === 0) {          // subkey starts with a quote char
                    $pos = strpos($k, $char, 1);        // find the ending quote char
                    if ($pos === false) throw new InvalidArgumentException('Invalid argument $key: '.$key);
                    $subkeys[] = substr($k, 1, $pos-1);
                    $k         = trim(substr($k, $pos+1));
                    if (!strlen($k))                    // last subkey or next char is a key separator
                        break 2;
                    if (strpos($k, '.') !== 0) throw new InvalidArgumentException('Invalid argument $key: '.$key);
                    $k = substr($k, 1);
                    continue 2;
                }
            }

            // key is not quoted
            $pos = strpos($k, '.');                     // find next key separator
            if ($pos === false) {
                $subkeys[] = $k;                        // last subkey
                break;
            }
            $subkeys[] = trim(substr($k, 0, $pos));
            $k         = substr($k, $pos+1);            // next subkey
        }
        return $subkeys;
    }
279147
protected function getKey($key) {
		$key = '/' . $this->environment . '.' . $key;
		$key = str_replace('.', '/', $key);
		if (!empty($this->appName)) {
			$key = '/' . $this->appName . $key;
		}
		return $key;
	}
580055
protected function getKeyID($key)
    {
        $state = Versioned::get_reading_mode();
        if ($state) {
            return $key . '_' . md5($state);
        }
        return $key;
    }
1274479
private function _validateKey($key): string 
    {
        if(
            !\is_scalar($key) &&
            !\is_object($key) &&
            !\method_exists($key, "__toString")
        ) {
            throw InvalidKeyException::invalidKey();
        }
        return (string) $key;
    }
903007
protected function normalizeKey($key)
    {
        if ($this->normalization & static::NORMALIZE_TRIM) {
            $key = trim($key);
        }

        if ($this->normalization & static::NORMALIZE_DELIMITERS) {
            $key = static::normalizeKeyDelimiters($key);
        }

        if ($this->normalization & static::NORMALIZE_CASE) {
            $key = strtolower($key);
        }

        if ($this->normalization & static::NORMALIZE_CANONICAL) {
            $key = static::canonicalizeKey($key);
        }

        return $key;
    }
347567
public function setKey($key)
    {
        $arr = $this->parseKey($key);
        $this->key = $arr['key'];
        $this->identifier = $arr['identifier'];
        $this->prefix = $arr['prefix'];

        return $this;
    }
713501
public function getKey($key)
    {
        $tokens = explode('.', $key);


        $first = array_shift($tokens);
        $first = str_replace('POINT', '.', $first);

        $that = $this;

        $value = $that[$first];

        foreach($tokens as $k) {
            $k = str_replace('POINT', '.', $k);
            if (false === isset($value[$k])) {
                return null;
            }
            $value = $value[$k];
        }

        return $value;
    }
1007052
protected function parse($key)
    {
        $values = $this->registry;
        $parts = explode(".", $key);
        foreach ($parts as $part) {
            if ($part === "") {
                return $values;
            }
            if (!is_array($values) || !array_key_exists($part, $values)) {
                return ;
            }
            $values = $values[$part];
        }

        return $values;
    }
475436
protected function parseArrayKey($key)
    {
        preg_match(static::ARRAY_KEY_PATTERN, $key, $matches);
        return (isset($matches['array_key']) ? $matches['array_key'] : null);
    }
681598
protected function _normalizeKey($key)
    {
        if (!is_string($key) && !is_numeric($key))
            $key = md5(Std\flatten($key));

        return $key;
    }
1028180
public function read($key)
    {
        if (isset($this->states[$key]) and $this->states[$key]->isOpen()) {
            return $this->states[$key];
        }
        if (! isset($this->files[$key]) and ! $this->touch($key)) {
            throw new AccessException('State file missing or inaccessible: ' . $key);
        }
        $this->states[$key] = new State($this->files[$key], false);
        return $this->states[$key];
    }