@param \ReflectionParameter $parameter
@param mixed                $value

@return mixed

@throws HttpException If the object cannot be instantiated.
972680
private function getParameterValue(\ReflectionParameter $parameter, $value)
    {
        $class = $parameter->getClass();

        if ($class) {
            $className = $class->getName();

            if ($parameter->isVariadic()) {
                $result = [];

                foreach ($value as $subValue) {
                    $result[] = $this->getObject($className, $subValue);
                }

                return $result;
            }

            return $this->getObject($className, $value);
        }

        return $value;
    }
678647
public function toParameterValue($value)
    {
        foreach ($this->getTransformers() as $transformer) {
            $value = $transformer->toParameterValue($value);
        }

        return $value;
    }
1216884
private function typeHintChecker(\ReflectionParameter $parameter, $parameters)
    {
        $class = $parameter->getClass();
        $typeHint = null;
        if (!$class instanceof \ReflectionClass) {
            return null;
        }

        $typeHint = $class->getName();
        foreach ($parameters as $item) {
            if ($item instanceof $typeHint) {
                return $item;
            }
        }

        return null;
    }
559586
public function normalizeValue(Parameter $parameter, string $value = null)
    {
        if (\is_bool($default = $parameter->default())) {
            return !$default;
        }

        if ($parameter->variadic()) {
            return (array) $value;
        }

        if (null === $value) {
            return $parameter->required() ? null : true;
        }

        return $parameter->filter($value);
    }
898082
public function bindValue($parameter, $value, $type = \PDO::PARAM_STR)
    {
        $this->bindedValues[$parameter] = $value;

        return $this->bindParam($parameter, $this->bindedValues[$parameter], $type);
    }
1280448
private function getArgumentByName(\ReflectionParameter $parameter, $parameters)
    {
        foreach ($parameters as $name => $item) {
            $paramName = $parameter->getName();
            if ($name === $paramName) {
                return $item;
            }
        }

        return null;
    }
138254
final public function get(string $parameter)
    {
        if (!\array_key_exists($parameter, $this->payload)) {
            throw new InvalidParameterException(\sprintf(
                'Payload parameter %s on %s does not exist',
                $parameter,
                static::class
            ));
        }

        $value = $this->payload[$parameter];

        $transformer = $this->getParameterTransformerMethod($parameter);
        if (\method_exists($this, $transformer)) {
            $value = $this->$transformer($value);
        }

        return $value;
    }
725968
private function getValue(string $class, string $method, $value)
    {
        $parameter = new ReflectionParameter(array($class, $method), 0);
        $type = $parameter->getType();

        if ($type) {
            $dataType = $type->getName();
            if ($dataType === 'DateTimeImmutable') {
                $value = new DateTimeImmutable($value);
            }
            if ($dataType === 'DateTime') {
                $value = new DateTime($value);
            }
        }

        return $value;
    }
1185170
protected function resolveArgumentValue($value)
    {
        if ($value instanceof ClassMeta) {
            $value = $value->setContainer($this)->newInstance();
        } elseif ($value instanceof ValueReference) {
            $v = $value->get($this->getParameters());

            if ($v === null && $this->parent instanceof Container) {
                $v = $value->get($this->parent->getParameters());
            }

            $value = $v;
        } elseif ($value instanceof RawWrapper) {
            $value = $value->get();
        }

        return $value;
    }
1125691
public function execute($httpMethod, $url, array $parameters = [])
    {
        if ($this->config instanceof Config) {
            try {
                $this->response = $this->getClient()->{$httpMethod}($this->config->getAccountNumber() . $url, [
                    'json' => $parameters,
                ]);

                return json_decode((string) $this->response->getBody());

            } catch (ClientException $e) {
                throw new Handler($e);
            }

            return;
        }

        throw new \RuntimeException('The API requires a configuration instance.');
    }
1124217
public function get(string $parameter): Bind
	{
		if (!$this->has($parameter)) {
			throw new Exception("Bind name \"{$parameter}\" does not exists");
		}

		return $this->bindings[$parameter];
	}
504832
private function getObject(string $className, $value)
    {
        $packedObject = new PackedObject($className, $value);

        try {
            $object = $this->objectPacker->unpack($packedObject);
        }
        catch (ObjectNotConvertibleException $e) {
            throw new HttpBadRequestException($e->getMessage(), $e);
        }
        catch (ObjectNotFoundException $e) {
            throw new HttpNotFoundException($e->getMessage(), $e);
        }

        if ($object === null) {
            throw new HttpInternalServerErrorException('No object packer available for ' . $className);
        }

        return $object;
    }
662097
public function setParam(string $name, $value): Request
    {
        if (is_object($value)) {
            if (property_exists($value, '__toString')) {
                $value = $value->__toString();
            } else {
                $class = get_class($value);
                throw new HttpException("Can not set param={$name} when instance of {$class} can't be converted to string");
            }
        }

        $this->params[$name] = $value;
        return $this;
    }
2689
protected function arguments(\ReflectionFunctionAbstract $reflection, $parameters = array())
    {
        $arguments = array();

        foreach ($reflection->getParameters() as $key => $parameter)
        {
            $name = $parameter->getName();

            if ($class = $parameter->getClass())
            {
                $name = $class->getName();
            }

            if (isset($parameters[$name]))
            {
                if ($parameter->isDefaultValueAvailable())
                {
                    $arguments[$name] = $parameter->getDefaultValue();
                }

                if ($parameters[$name])
                {
                    $arguments[$name] = $parameters[$name];
                }

                continue;
            }

            $arguments[$name] = $this->instance($name);
        }

        return $arguments;
    }
28967
public function getDependency(\ReflectionParameter $parameter, \ReflectionClass $reflected)
    {
        if ($parameter->isArray() || !$parameter->getClass()) {

            if ($parameter->isArray()) {
                return 'array';
            }

            return null;
        }

        $class = $parameter->getClass()->name;

        if ($class == 'Closure') {
            return null;
        }

        $reflected = new \ReflectionClass($class);

        if ($this->provider->hasBinding($reflected->name)) {
            return $this->provider->getBinding($reflected->name);
        } else {
            // TODO: inspect this
            return $reflected->name;
        }
    }
1321986
public function parameter($key, $value = NULL)
	{
		if (func_num_args() === 1)
		{
			if ( ! array_key_exists($key, $this->_parameters))
			{
				throw new \InvalidArgumentException('Parameter not set: '.$key);
			}
			return $this->_parameters[$key];
		}
		$this->_parameters[$key] = $value;
		return $this;
	}
17256
protected function serializeInternalClass($value, $className, ReflectionClass $ref)
    {
        $paramsToSerialize = $this->getObjectProperties($ref, $value);
        $data = [self::CLASS_IDENTIFIER_KEY => $className];
        $data += \array_map([$this, 'serializeData'], $this->extractObjectData($value, $ref, $paramsToSerialize));

        return $data;
    }