Version: 4.1.3
Bug Description
getType does not return correct type
Steps To Reproduce
$class = new ClassType('Hello');
$method = $class->addMethod('greeting');
$param = $method->addParameter('name', null)
->setType('string')
->setNullable();
echo $param->getType(); // "string"
The class was generated correctly
class Hello
{
public function greeting(?string $name = null)
{
}
}
Expected Behavior
$param->getType() should return ?string or null|string instead of string