Assertion generate UnusedMethodCall with Psalm
theofidry opened this issue · 3 comments
theofidry commented
I have something along the lines of:
class Foo {
public function getAggregateClass(): ?string
{
Assert::nullOrImplementsInterface(
$this->aggregateClass,
Identifiable::class,
'Expected the aggregate class name to refer to an implementation of %2$s. Got: %s'
);
return $this->aggregateClass;
}
}
The assertion ::nullOrImplementsInterface()
generates a UnusedMethodCall
issue. Note that Assert::implementsInterface()
does not hence this is likely an issue with the null*
variants.
Tested on:
- PHP 7.4.13
- Psalm 4.3.1@2feba22a005a18bf31d4c7b9bdb9252c73897476
- webmozart/assert 1.9.1
zerkms commented
Would it be too much to ask you setup a little test repository with all dependencies and configuration set up?
Otherwise, if no one will look at it I think I can have some time later this week.
zerkms commented
Could not reproduce it https://github.com/zerkms/webmozart-assert-issue-229
theofidry commented
I'll try to have a look at it ASAP