-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
Bug report
KnpLabs/php-github-api when have a interface_exists check around a trait to provide support for httplug v1 and v2.
Since updating phpstan/phpstan (0.12.24 => 0.12.28) we get an error. It seems that phpstan always ends up in the else statement instead of the correct part based on the actual check. We are running phpstan with v2 of httplug so it should use the trait from the if part.
Now we get this error
------ ---------------------------------------------------------------------------------------------------------------------------------------------------------
Line Github/HttpClient/Plugin/HistoryTrait.php (in context of class Github\HttpClient\Plugin\History)
------ ---------------------------------------------------------------------------------------------------------------------------------------------------------
28 Parameter #2 $exception (Http\Client\Exception) of method Github\HttpClient\Plugin\History::addFailure() is not compatible with parameter #2 $exception
(Psr\Http\Client\ClientExceptionInterface) of method Http\Client\Common\Plugin\Journal::addFailure().
------ ---------------------------------------------------------------------------------------------------------------------------------------------------------
Code snippet that reproduces the problem
I think this is a correct reproducer: https://phpstan.org/r/d47b3549-6e08-4948-a540-27bb868ad61f
Expected output
No error reported.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels