Since $rnts is declared private, accessing it with static will lead to errors in possible sub-classes; you can either use self, or increase the visibility of $rnts to at least protected.
Loading history...
38
$func = new \ReflectionFunction(static fn(string $param): string => $param);
The expression return static::rnts could return the type null which is incompatible with the type-hinted return ReflectionNamedType. Consider adding an additional type-check to rule them out.
Loading history...
43
}
44
45
/**
46
* Only way to generate an int ReflectionNamedType (Internal use).
47
*
48
* @return \ReflectionNamedType
49
*/
50
public static function getIntReflectionNamedType(): \ReflectionNamedType
Since $rnti is declared private, accessing it with static will lead to errors in possible sub-classes; you can either use self, or increase the visibility of $rnti to at least protected.
Loading history...
53
$func = new \ReflectionFunction(static fn(int $param): int => $param);
The expression return static::rnti could return the type null which is incompatible with the type-hinted return ReflectionNamedType. Consider adding an additional type-check to rule them out.