@param $key

@return \GraphAware\Bolt\Result\Type\Relationship

@throws \InvalidArgumentException When the value is not null or instance of Relationship
962314
public function relationshipValue($key)
    {
        if (!isset($this->keyToIndexMap[$key]) || !$this->values[$this->keyToIndexMap[$key]] instanceof Relationship) {
            throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, 'RELATIONSHIP'));
        }

        return $this->value($key);
    }
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);
    }
581479
public function getParam($key)
    {
        if (!isset($this->params[$key])) {
            throw new InvalidArgumentException("The request parameter with key '$key' is invalid."); 
        }
        return $this->params[$key];
    }
610689
public function getRelation($key)
    {
        $relation = new AVRelation($this, $key);
        if (isset($this->estimatedData[$key]))
        {
            $object = $this->estimatedData[$key];
            if ($object instanceof AVRelation)
            {
                $relation->setTargetClass($object->getTargetClass());
            }
        }

        return $relation;
    }
896206
public function get($key)
    {
        if (!isset($this->elements[$key])) {
            throw new InvalidArgumentException('Adapter does not exist');
        }

        return $this->elements[$key];
    }
614052
public function getDependencies(string $key): array
    {
        if (!isset($this->components[$key])) {
            throw new \InvalidArgumentException(sprintf('Component with key "%s" not found.', $key));
        }
        return $this->components[$key]->getDependencies();
    }
894387
public function getCustomValue($key)
    {
        if (!array_key_exists($key, $this->customValues)) {
            throw InvalidPayloadException::notExistingCustomValue($key);
        }

        return $this->customValues[$key];
    }
1189575
public function getAttribute($key)
    {
        // If the key references an attribute, return its plain value from the model.
        if (array_key_exists($key, $this->attributes) || $this->hasGetMutator($key)) {
            return $this->getAttributeValue($key);
        }

        // If the key already exists in the relationships array...
        else if (array_key_exists($key, $this->relations)) {
            return $this->relations[$key];
        }

        // If the "attribute" exists as a method on the model, it is a relationship.
        $camelKey = Str::camel($key);

        if (method_exists($this, $camelKey)) {
            return $this->getRelationshipFromMethod($key, $camelKey);
        }
    }
933364
public function getExistsRelations($storeKey)
    {
        if (!isset($this->relations[$storeKey])) {
            throw new \InvalidArgumentException(sprintf(
                'Invalid relation store key "%s"; must be loaded',
                $storeKey
            ));
        }
        return $this->relations[$storeKey];
    }
321616
public function setKey($key)
    {
        try {
            $this->blockCipher->setKey($key);
        } catch (CryptException\InvalidArgumentException $e) {
            throw new Exception\InvalidArgumentException($e->getMessage());
        }
        $this->encryption['key'] = $key;
        return $this;
    }
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];
    }
1071433
public function get_argument( $key ) {
		if ( $this->has_argument( $key ) ) {
			return $this->arguments[ $key ];
		}

		throw new \InvalidArgumentException( sprintf( 'Argument "%s" not found.', $key ) );
	}
71743
public function post($key = null)
    {
        if ($key) {

            if (isset($_POST[$key])) {
                return $_POST[$key];
            }

            throw new \InvalidArgumentException(sprintf(
                '%s ist not a valid key for $_POST', $key
            ));

        }

        return $_POST;
    }
570608
public function getRequired(string $key)
    {
        if (!$this->has($key)) {
            throw new \InvalidArgumentException('Element ' . $key . ' does not exist');
        }

        return $this->collection[$this->keyMap[strtolower($key)]];
    }
511262
protected function createChild($key)
    {
        $relation = $this->getValueOrRelationForKey($key);
        // if this is not a relation, then it's the actual value
        // returned by a method (like for example computed attributes)
        // so we just return it as the value

        if (!$relation instanceof Relation) {
            return $relation;
        }

        $this->supportedRelationOrThrow($key, $relation);

        // TODO we need to bind the relation to the datasource here
        $model = Rel::make($relation)->getChild();

        if (!$this->isEloquentObject($model)) {
            throw new \LogicException(sprintf(
                'newModelFromRelation should return an Eloquent Model/Collection, but returned a %s (parent: %s, key: %s, relation: %s)',
                get_type_class($model),
                get_type_class($this->getDelegatedStorage()), $key, get_type_class($relation)
            ));
        }

        return $model;
    }
232802
public function getRelationship($key)
    {
        if (array_key_exists($key, $this->relationships)) {
            return $this->relationships[$key];
        }

        return null;
    }
914176
public function getRawValue($key)
    {
        if (!array_key_exists($key, $this->data())) {
            throw new \InvalidArgumentException(sprintf('key [%s] is not present in response array.', $key));
        }

        return $this->data()[$key];
    }