Steps required to reproduce the problem
- Start with a project using phpstan/phpstan 1.10.48, phpstan/phpstan-phpunit 1.13.15, phpspec/prophecy dev-master, phpspec-prophecy-phpunit dev-master, and some tests using Prophecy like
(new Prophet())->prophesize(Some::class)
- Upgrade phpspec/prophecy to 1.18 (from dev-master)
Expected Result
- PHPStan finished without internal errors
Actual Result
- PHPStan runs into an internal error
Xdebug analysis shows that the difference before/after is in ProphesizeDynamicReturnTypeExtension::getTypeFromMethodCall line 70 where the $returnType instanceof check used to be true but is not anymore:
- before: GenericObjectType
- after: ConditionalTypeForParameter
Steps required to reproduce the problem
(new Prophet())->prophesize(Some::class)Expected Result
Actual Result
Xdebug analysis shows that the difference before/after is in
ProphesizeDynamicReturnTypeExtension::getTypeFromMethodCallline 70 where the$returnTypeinstanceof check used to be true but is not anymore: