@AlessandroMinoccheri sure. Let's say there are two UndefinedMethod
violations saying The method SomeClass::expects does not exist
in this code:
private SomeClass $mock;
// ...
$this->mock->expects($this->once())
// ...
$this->mock->expects($this->once())
The baseline file looks like this:
<file src="Test.php">
<UndefinedMethod>
<code>expects</code>
<code>expects</code>
</UndefinedMethod>
</file>
It's also not ideal, especially since the code snippet is sometimes really weird/random, like in this example:
<code>ry\Adapter\O</code>
But even though it's sometimes bullshit, it works fine for us ✌️
I'm really happy to see this PR. I've the same struggle, everytime we change imports or class attributes the line numbers are chaning. Having an option to ignore them would be a good compromise for us too.
Another option could be what psalm is kind doing. They store a code snippet instead of the line number.