Improve Imagick method types#2325
Improve Imagick method types#2325ondrejmirtes merged 3 commits intophpstan:1.10.xfrom zonuexe:types/imagick
Conversation
resources/functionMap.php
Outdated
There was a problem hiding this comment.
resources/functionMap.php
Outdated
resources/functionMap.php
Outdated
There was a problem hiding this comment.
imagick 3.6.0 Returns a bool now; previously, an int was returned.
resources/functionMap.php
Outdated
There was a problem hiding this comment.
Oddly, getImageWidth is declared as unsigned long width, but getImageHeight seems to be just long height.
resources/functionMap.php
Outdated
resources/functionMap.php
Outdated
There was a problem hiding this comment.
resources/functionMap.php
Outdated
There was a problem hiding this comment.
I'm not a big fan of narrowing down parameter types. It requires people to suddently start typehinting PHPStan-specific types in their PHPDocs instead of int. For the same reason I haven't merged #2163 and #2271 yet.
But I think it'd be fine to introduce these typehints in bleedingEdge/PHPStan 2.0.
I've added support for bleedingEdge-specific functionMap: 06b746d
My suggestion is:
- Submit a PR that only changes return types for everyone.
- Submit a next PR that changes parameter types in
functionMap_bleedingEdge.php.
Thank you!
There was a problem hiding this comment.
I'm not a big fan of narrowing down parameter types.
I agree with your policy because it makes sense. Thank you for your review!
|
Thank you! |
Follows
Imagickconstants and detailedarraytypes.