@param string|array $key
@param null         $default
@param null         $castType
@param bool         $nullable

@return array|mixed
@throws InvalidArgumentException
420647
public static function getQuery($key, $default = NULL, $castType = NULL, $nullable = TRUE)
	{
		if (!is_scalar($key) && !is_array($key)) {
			throw new InvalidArgumentException('$key must be scalar or array');
		}

		if (is_scalar($key)) {
			$result = static::_getQuery($key, $default, $castType, $nullable);
		} else {
			$isAssoc = Kohana_Arr::is_assoc($key);
			$result = [];
			foreach ($key as $keyName => $keyData) {
				$resultKey = $keyData;
				if ($isAssoc) {
					$queryKey = $keyName;
				} else {
					$queryKey = $keyData;
				}
				$result[$resultKey] = static::_getQuery($queryKey, $default, $castType, $nullable);
			}
		}

		return $result;
	}
105216
static public function get($key = null, $default = null) {
        if (is_null($key)) return json_decode(json_encode(self::$_config));
        
        $config = &self::$_config;
        
        return Utils::arrayGet($config, $key, $default);
    }
1027246
private static function get($key = null, $default = null) {

		if(null !== $key && isset(static :: $method['method'], static :: $method['data'])) {

			if(static :: isMethod(static :: $method['method'])) {

				$helper  = new StringToArray();
				$data 	 = $helper -> execute($key, $default, static :: $method['data']);

				//Trim string
				if(true === isset(static :: $options[self :: TRIM_STRING])) {

					if(is_string($data) === 0) {
						$data = trim($data);
					}
				}

				//Convert empty string to NULL
				if(true === isset(static :: $options[self :: EMPTY_STRING_TO_NULL])) {

					if(is_string($data) && strlen($data) === 0) {
						$data = null;
					}
				}

				//Convert empty array to NULL
				if(true === isset(static :: $options[self :: EMPTY_ARRAY_TO_NULL])) {

					if(is_array($data) && count($data) === 0) {
						$data = null;
					}
				}

				$default = null === $data ? $default : $data;
			}

			static :: $method = [];
		}

		return $default;
	}
934341
public static function get($key, $default = null) {

		if(true === is_array($key)) {

			$tmp = static :: $data;

			foreach($key as $index) {

				if(false === isset($tmp[$index])) {
					return $default;
				}

				$tmp = $tmp[$index];
			}

			return $tmp;
		}

		if(true === isset(static :: $data[$key])) {
			return static :: $data[$key];
		}

		return $default;
	}
784769
public function json($key = null, $default = null)
    {
        if (! isset($this->json)) {
            $this->json = new ParameterBag((array) json_decode($this->getContent(), true));
        }
        if (is_null($key)) {
            return $this->json;
        }
        return $this->json->get($key,$default);
    }
382529
protected function applyCast(string $key): void
    {
        $casts = $this->casts();

        if ( ! count($casts) || ! array_key_exists($key, $casts)) {
            return;
        }

        if ( ! isset($this->attributes[ $key ])) {
            $value = null;
        } else {
            $value = $this->attributes[ $key ];
        }

        // If the cast type is a simple scalar, apply it and return
        if (in_array($casts[ $key ], static::SCALAR_CASTS)) {
            $this->attributes[ $key ] = call_user_func([$this, 'castValueAs' . ucfirst($casts[ $key ])], $value);
            return;
        }

        // Otherwise attempt a data object cast
        $dataObjectClass = $casts[ $key ];
        $dataObjectArray = false;

        // If the model is postfixed with [], an array of models is expected
        if (substr($dataObjectClass, -2) === '[]') {
            $dataObjectClass = substr($dataObjectClass, 0, -2);
            $dataObjectArray = true;
        }

        if (null === $value) {
            if ($dataObjectArray) {
                $this->attributes[ $key ] = [];
                return;
            }

            if ($this->castUnsetObjects) {
                $this->attributes[ $key ] = $this->makeNestedDataObject($dataObjectClass, [], $key);
            }
            return;
        }

        if ($dataObjectArray) {

            if (is_array($this->attributes[ $key ])) {

                foreach ($this->attributes[ $key ] as $index => &$item) {

                    if (null === $item && ! $this->castUnsetObjects) {
                        continue;
                    }

                    if ( ! ($item instanceof $dataObjectClass)) {

                        $item = $this->makeNestedDataObject($dataObjectClass, $item ?: [], $key . '.' . $index);
                    }
                }
            }

            unset($item);

            return;
        }

        // Single data object
        if ( ! ($this->attributes[ $key ] instanceof $dataObjectClass)) {
            $this->attributes[ $key ] = $this->makeNestedDataObject(
                $dataObjectClass,
                $this->attributes[ $key ],
                $key
            );
        }
    }
620712
protected function isAesCastable($key)
    {
        return array_key_exists($key, $this->casts) and $this->casts[$key] == $this->castName;
    }
1061446
public function get($key = null, $default = null)
    {
        if ($this->has($key)) {
            return $this->getValueAtKey($key, $this->payload());
        }
        return $default;
    }
335177
public function get($key = null, $default = null)
	{
		$fail = uniqid('__FAIL__', true);

		$result = Arr::get($this->data, $key, $fail);

		if ($result === $fail)
		{
			if ($this->parentEnabled)
			{
				$result = $this->parent->get($key, $default);
			}
			else
			{
				$result = result($default);
			}
		}

		return $result;
	}
1368152
public function id($key = null, $default = null)
    {
        $element = $this->getHandler()->getKeyMapElement($key, $default);
        return is_array($element) && array_key_exists('id', $element) ? (int) $element['id'] : $default;
    }
377053
public function input($key = null, $default = null)
    {
        $input = $this->getInputSource()->all() + $this->query->all();

        return array_get($input, $key, $default);
    }
586538
private static function castArrayTo($arrItem, $strType)
    {
        if ($strType == Type::ARRAY_TYPE) {
            return $arrItem;
        } elseif ($strType == Type::CALLABLE_TYPE && is_callable($arrItem)) {
            return $arrItem;
        } else {
            throw new InvalidCast(sprintf('Unable to cast Array to %s', $strType));
        }
    }
976055
public static function getArray(
        array $params,
        string $key,
        $default = null
    ) {
        if (self::has($params, $key)) {
            return (array)$params[$key];
        }

        return $default;
    }
352489
public function getParam($key = null, $default = null)
    {
        if (!isset($key)) {
            return $this->params;
        }

        foreach ((array) $key as $k) {
            if (isset($this->params[$k])) {
                return $this->params[$k];
            }
        }

        return $default;
    }
273357
public function get($key, $default = null)
    {
        $key = $this->resolveAlias($key);

        $accessor = 'get' . $this->toCamelCase($key) . 'Value';

        $value = isset($this->data[$key]) ? $this->data[$key] : null;

        if (is_callable([$this, $accessor])) {
            return $this->$accessor($value);
        }

        if ($cast = $this->getCast($key)) {
            $value = $this->castValue($key, $value);
        }

        if ($value === null) {
            return $default;
        }

        return $value;
    }
132488
public function get($key, $default = null): array
    {
        if (!$this->has($key)) {
            if (\is_array($default)) {
                return $default;
            }

            return $default === null ? [] : [$default];
        }

        return $this->headers[Helpers::normalizeHeaderName($key)];
    }
1041276
public function getMetadata($key = null, $default = null)
    {
        if (null === $key) {
            return $this->metadata;
        }

        if (!is_scalar($key)) {
            throw new Exception\InvalidArgumentException('Non-scalar argument provided for key');
        }

        if (array_key_exists($key, $this->metadata)) {
            return $this->metadata[$key];
        }

        return $default;
    }