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
Is your feature request related to a problem? Please describe.
Right now ( due to autoloading), infection can not mutate functions, but it can mutate methods.
e.g
functionadd(int$a, int$b): int
{
// no mutation herereturn$a + $b;
}
classCalculator
{
functionadd(int$a, int$b): int
{
// + is mutated to -return$a + $b;
}
}
Currently the Interceptor is registered in the bootstrap file, so it will work as follows:
vendor/bin/phpunit
autoloader gets registered
all functions are autoloaded
phpunit executes bootstrap file
interceptor is registered
Interceptor intercepts autoloader
Describe the solution you'd like
If we move the registering of the interceptor before the autoloader is registered, we can mutate functions, as we intercept the autoloading before they are autoloaded.
We could have our own php script, instead of running the original one, like so:
Is your feature request related to a problem? Please describe.
Right now ( due to autoloading), infection can not mutate functions, but it can mutate methods.
e.g
Currently the Interceptor is registered in the bootstrap file, so it will work as follows:
vendor/bin/phpunit
Describe the solution you'd like
If we move the registering of the interceptor before the autoloader is registered, we can mutate functions, as we intercept the autoloading before they are autoloaded.
We could have our own php script, instead of running the original one, like so:
Describe alternatives you've considered
N/A
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: