Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Impact of RFC
wrong native return type of __call(): string
https://github.com/mockery/mockery/blob/05b2459503f7e821295dd22c18d206d3e49d957b/tests/PHP70/Generator/StringManipulation/Pass/MagicMethodTypeHintsPassTest.php#L349
wrong native return type of __callstatic(): int
https://github.com/mockery/mockery/blob/05b2459503f7e821295dd22c18d206d3e49d957b/tests/PHP70/Generator/StringManipulation/Pass/MagicMethodTypeHintsPassTest.php#L353
wrong native return type of __call(): string
https://github.com/mockery/mockery/blob/05b2459503f7e821295dd22c18d206d3e49d957b/tests/PHP70/Generator/StringManipulation/Pass/MagicMethodTypeHintsPassTest.php#L380
wrong native return type of __call(): int
https://github.com/mockery/mockery/blob/05b2459503f7e821295dd22c18d206d3e49d957b/tests/PHP70/Generator/StringManipulation/Pass/MagicMethodTypeHintsPassTest.php#L382
wrong native return type of __call(): void
https://github.com/cakephp/cakephp/blob/8718b2e9bbd092b991a1da6472d1a28e89b63dac/src/Controller/Component/FlashComponent.php#L137
wrong native return type of __get(): void
https://github.com/sebastianbergmann/object-enumerator/blob/9bb439a4522a4ea30382861dfb87653c4f4b375b/tests/_fixture/ExceptionThrower.php#L23
wrong native return type of __call(): string
https://github.com/solariumphp/solarium/blob/500018020f7dc34f29cfc474ca0432ae22772640/src/QueryType/Stream/ExpressionBuilder.php#L251
@carusogabriel

This comment has been minimized.

Copy link
Owner Author

@carusogabriel carusogabriel commented Apr 15, 2020

This result was only possible thanks to @nikic's script: https://gist.github.com/nikic/a2bfa3e2f604f66115c3e4b8963a6c72.

@nicolas-grekas

This comment has been minimized.

Copy link

@nicolas-grekas nicolas-grekas commented Apr 15, 2020

To me, none of those look like actual bugs. LSP allows narrowing the return type, this looks like what's happening here.

@carusogabriel

This comment has been minimized.

Copy link
Owner Author

@carusogabriel carusogabriel commented Apr 15, 2020

@nicolas-grekas Indeed, even __get() fits under the LSP. I'll update the RFC 👍

@carusogabriel

This comment has been minimized.

Copy link
Owner Author

@carusogabriel carusogabriel commented May 26, 2020

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