Skip to content
Permalink
Browse files

Factory: uses ReflectionNamedType

  • Loading branch information...
dg committed Mar 15, 2019
1 parent 0b79d86 commit acff8b136fad84b860a626d133e791f95781f9f5
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/PhpGenerator/Factory.php
@@ -76,7 +76,7 @@ public function fromMethodReflection(\ReflectionMethod $from): Method
$method->setVariadic($from->isVariadic());
$method->setComment(Helpers::unformatDocComment((string) $from->getDocComment()));
if ($from->hasReturnType()) {
$method->setReturnType((string) $from->getReturnType());
$method->setReturnType($from->getReturnType()->getName());
$method->setReturnNullable($from->getReturnType()->allowsNull());
}
return $method;
@@ -96,7 +96,7 @@ public function fromFunctionReflection(\ReflectionFunction $from)
$function->setComment(Helpers::unformatDocComment((string) $from->getDocComment()));
}
if ($from->hasReturnType()) {
$function->setReturnType((string) $from->getReturnType());
$function->setReturnType($from->getReturnType()->getName());
$function->setReturnNullable($from->getReturnType()->allowsNull());
}
return $function;
@@ -107,7 +107,7 @@ public function fromParameterReflection(\ReflectionParameter $from): Parameter
{
$param = new Parameter($from->getName());
$param->setReference($from->isPassedByReference());
$param->setTypeHint($from->hasType() ? (string) $from->getType() : null);
$param->setTypeHint($from->hasType() ? $from->getType()->getName() : null);
$param->setNullable($from->hasType() && $from->getType()->allowsNull());
if ($from->isDefaultValueAvailable()) {
$param->setDefaultValue($from->isDefaultValueConstant()

0 comments on commit acff8b1

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.