Abstract the checks for 0 parameters (if (\count($original_parameter_list) === 0) {) into a single method.
Additionally, certain scalars and final classes don't need to be replaced with more specific types (?int, string, float in real types (and possibly phpdoc), arrayshape in phpdoc, etc)
Memoize the result based on that
if (\count($original_parameter_list) === 0) {
) into a single method. Additionally, certain scalars and final classes don't need to be replaced with more specific types (?int
,string
,float
in real types (and possibly phpdoc), arrayshape in phpdoc, etc) Memoize the result based on that