Skip to content

Fatal error mutator interface #1908

Closed Answered by maks-rafalko
terabytesoftw asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, I don't think we can do something smart here and prevent generating this mutation by Infection out of the box.

Reproducer: https://infection-php.dev/r/kop7

At the time of mutating, Infection sees the trait and it doesn't know in which class this trait is going to be used - it just mutates the trait.

Traits can't implement interfaces, so it's impossible to understand if the public method of the trait is part of the contract (interface), looking only to the trait.

Fatal errors are treated as killed Mutants, so the only issue here is we are wasting time by generating always killed mutant.

Still, we can ignore such mutations by adding ignore rules: see https://infection-php.dev/r/grde

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by maks-rafalko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants