When using $method = (new Factory)->fromMethodReflection($refMethod); and printing the code with $method->__toString(); the readonly keyword is missing.
Steps To Reproduce
class Number
{
public function __construct(public readonly int $value) {}
}
$reflectionClass = new \ReflectionClass(Number::class);
$reflectionMethod = $reflectionClass->getMethod('__construct');
$method = (new Factory)->fromMethodReflection($reflectionMethod);
$result = (string)$method;
Version:
6.36.0
Bug Description
When using
$method = (new Factory)->fromMethodReflection($refMethod);
and printing the code with$method->__toString();
thereadonly
keyword is missing.Steps To Reproduce
Expected Behavior
Should include
readonly
Possible Solution
Factory::fromParameterReflection()
: