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
When I run infection, despite having coverage of the public getID method being used, infection still tries to change the visibility of the method in the trait to protected, which then causes a fatal error because it no longer matches the interface.
Fatal error: Access level to Infected\SourceClass::getId() must be public (as in class Infected\HasID)
Apologies if this has been asked before, but I couldn't find another example, or figure out a way around it.
Essentially, if I have the following interface, trait and class:
And I have the following tests to cover both the trait and the class:
When I run infection, despite having coverage of the public
getID
method being used, infection still tries to change the visibility of the method in the trait toprotected
, which then causes a fatal error because it no longer matches the interface.Is there a way around this?
Playground version is available here: https://infection-php.dev/r/wmz2
The text was updated successfully, but these errors were encountered: