Skip to content

Conversation

alexander-schranz
Copy link

This make it possible to add PHPStan\dumpType to nested calls like:

$test = new Test(\PHPStan\dumpType($other));

without additional errors returned.

* @param mixed $value
* @return mixed
* @param T $value
* @return T
*
* @throws void
*/
function dumpType($value) // phpcs:ignore Squiz.Functions.GlobalFunction.Found

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the return type should be void.

Copy link
Author

@alexander-schranz alexander-schranz Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Pull Requests target is to return the value not to make it null or void.

@ondrejmirtes
Copy link
Member

No, sorry, I think that would be very surprising behaviour. You can always save the value into a variable and dump that.

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.

3 participants