Inspekt\Cage::getValue PHP Method

getValue() public method

Retrieves a value from the source array. This should NOT be called directly, but needs to be public for use by AccessorAbstract. Maybe a different approach should be considered
public getValue ( string $key ) : mixed
$key string
return mixed
    public function getValue($key)
    {
        if (strpos($key, self::ISPK_ARRAY_PATH_SEPARATOR) !== false) {
            $key = trim($key, self::ISPK_ARRAY_PATH_SEPARATOR);
            $keys = explode(self::ISPK_ARRAY_PATH_SEPARATOR, $key);
            return $this->getValueRecursive($keys, $this->source);
        } else {
            if (!$this->keyExists($key)) {
                throw new KeyDoesNotExistException("Key '{$key}' does not exist");
            }
            return $this->source[$key];
        }
    }