public function parseParameterReflector(ReflectionParameter $reflector)
    {
        $this->typeCheck->parseParameterReflector(func_get_args());

        $class = null;
        try {
            $class = $reflector->getClass();
        } catch (ReflectionException $e) {
            $className = null;
            if ($declaringClass = $reflector->getDeclaringClass()) {
                $className = ClassName::fromString(
                    $declaringClass->getName()
                )->toAbsolute();
            }

            throw new Exception\TypeHintUndefinedClassException(
                $className,
                $reflector->getDeclaringFunction()->getName(),
                $reflector,
                $e
            );
        }

        if ($class) {
            $type = new ObjectType(ClassName::fromString($class->getName())->toAbsolute());
        } elseif ($reflector->isArray()) {
            $type = new TraversableType(
                new ArrayType,
                new MixedType,
                new MixedType
            );
        } else {
            $reflectorReflector = new ReflectionObject($reflector);
            if (
                $reflectorReflector->hasMethod('isCallable') &&
                $reflector->isCallable()
            ) {
                $type = new CallableType;
            } else {
                $type = new MixedType;
            }
        }

        if (
            !$type instanceof MixedType &&
            $reflector->allowsNull()
        ) {
            $type = new OrType(array(
                $type,
                new NullType,
            ));
        }

        return new Parameter(
            $reflector->getName(),
            $type,
            null,
            $reflector->isOptional(),
            $reflector->isPassedByReference()
        );
    }
public function parseParameterReflector(ReflectionParameter $reflector)
    {
        $this->typeCheck->parseParameterReflector(func_get_args());

        $class = null;
        try {
            $class = $reflector->getClass();
        } catch (ReflectionException $e) {
            $className = null;
            if ($declaringClass = $reflector->getDeclaringClass()) {
                $className = ClassName::fromString(
                    $declaringClass->getName()
                )->toAbsolute();
            }

            throw new Exception\TypeHintUndefinedClassException(
                $className,
                $reflector->getDeclaringFunction()->getName(),
                $reflector,
                $e
            );
        }

        if ($class) {
            $type = new ObjectType(ClassName::fromString($class->getName())->toAbsolute());
        } elseif ($reflector->isArray()) {
            $type = new TraversableType(
                new ArrayType,
                new MixedType,
                new MixedType
            );
        } else {
            $reflectorReflector = new ReflectionObject($reflector);
            if (
                $reflectorReflector->hasMethod('isCallable') &&
                $reflector->isCallable()
            ) {
                $type = new CallableType;
            } else {
                $type = new MixedType;
            }
        }

        if (
            !$type instanceof MixedType &&
            $reflector->allowsNull()
        ) {
            $type = new OrType(array(
                $type,
                new NullType,
            ));
        }

        return new Parameter(
            $reflector->getName(),
            $type,
            null,
            $reflector->isOptional(),
            $reflector->isPassedByReference()
        );
    }
@param ReflectionParameter $reflector

@return Parameter