Skip to content

Conversation

@matthiasnoback
Copy link
Contributor

This fixes an issue reported earlier: phpstan/phpstan#5855

Please let me know if you want me to provide anything else at this point.

@ondrejmirtes
Copy link
Member

It's technically a BC break but I doubt that anyone calls these directly:


[BC] CHANGED: The return type of PHPStan\Type\DynamicFunctionReturnTypeExtension#getTypeFromFunctionCall() changed from PHPStan\Type\Type to the non-covariant ?PHPStan\Type\Type
[BC] CHANGED: The return type of PHPStan\Type\DynamicFunctionReturnTypeExtension#getTypeFromFunctionCall() changed from PHPStan\Type\Type to ?PHPStan\Type\Type
[BC] CHANGED: The return type of PHPStan\Type\DynamicMethodReturnTypeExtension#getTypeFromMethodCall() changed from PHPStan\Type\Type to the non-covariant ?PHPStan\Type\Type
[BC] CHANGED: The return type of PHPStan\Type\DynamicMethodReturnTypeExtension#getTypeFromMethodCall() changed from PHPStan\Type\Type to ?PHPStan\Type\Type
[BC] CHANGED: The return type of PHPStan\Type\DynamicStaticMethodReturnTypeExtension#getTypeFromStaticMethodCall() changed from PHPStan\Type\Type to the non-covariant ?PHPStan\Type\Type
[BC] CHANGED: The return type of PHPStan\Type\DynamicStaticMethodReturnTypeExtension#getTypeFromStaticMethodCall() changed from PHPStan\Type\Type to ?PHPStan\Type\Type

@ondrejmirtes ondrejmirtes merged commit a897d3a into phpstan:master Mar 10, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@matthiasnoback
Copy link
Contributor Author

It's technically a BC break

Never saw that tool being used, seems very useful!
Right, as you mentioned earlier, for implementers it's no issue, but for clients it could be.

Thanks for the quick merge!

I think it would be nice to update the documentation about type extensions as well: instead of always returning a type using the default selectFromArgs() call you can now return null if you don't have a specific type. Can I do that? Should this happen on the phpstan/phpstan repository?

@ondrejmirtes
Copy link
Member

Yes, documentation pages have "Edit this page" link at the bottom 😊 Please don't forget to mention that "null" can be used since PHPStan 1.5.0. (I'll merge it after the release which is gonna be in a few weeks).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants