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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method below has a parameter with that is nullable, followed by a non-optional parameter. It's an unfortunate consequence of using the default value of null to indicate a nullable parameter (rather than something like this that this is perfectly valid and sometimes necessary code.
Uncaught TypeError: Argument 1 passed to PhonyMock__0::method() must be an
instance of SomeClass, null given, called in test.php on line 17 and defined in
MockFactory.php(146) : eval()'d code:5
I suspect the mock generation code is using the "number of required parameters" from the function reflector to determine whether or not a parameter has a default value, rather than checking each parameter individually, possibly as an optimisation.
The method below has a parameter with that is nullable, followed by a non-optional parameter. It's an unfortunate consequence of using the default value of null to indicate a nullable parameter (rather than something like this that this is perfectly valid and sometimes necessary code.
This code fails like so:
I suspect the mock generation code is using the "number of required parameters" from the function reflector to determine whether or not a parameter has a default value, rather than checking each parameter individually, possibly as an optimisation.