private function getParameterValues ($function, array $parameters = []) {
        $functionParams = [];
        $parameterIndex = 0;
        foreach ($function->getParameters() as $parameter) {
            $parameterName = $parameter->getName();
            $parameterValue = null;

            if (array_key_exists($parameterName, $parameters)) {
                $parameterValue = $parameters[$parameterName];
            }
            else if ($parameter->hasType()) {
                $type = $parameter->getType();
                if (!$type->isBuiltin()) {
                    $typeName = (string)$type;
                    if (array_key_exists($typeName, $parameters)) {
                        $parameterValue = $parameters[$typeName];
                    }
                    else if (!$parameter->isDefaultValueAvailable()) {
                        $typeClass = new ReflectionClass($typeName);
                        foreach ($typeClass->getMethods(ReflectionMethod::IS_STATIC) as $staticMethod) {
                            if ($staticMethod->getReturnType() != null && ((string)$staticMethod->getReturnType() == $typeName) && $staticMethod->getNumberOfParameters() == 0) {
                                $parameterValue = $staticMethod->invoke(null);
                                break;
                            }
                        }
                    }
                }
            }

            if ($parameterValue == null) {
                if (array_key_exists($parameterIndex, $parameters)) {
                    $parameterValue = $parameters[$parameterIndex];
                    $parameterIndex++;
                }
                else if ($parameter->isDefaultValueAvailable()) {
                    $parameterValue = $parameter->getDefaultValue();
                }
            }
            $functionParams[] = $parameterValue;
        }
        return $functionParams;
    }