Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/dumpType.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,27 @@
namespace PHPStan;

/**
* @template T
* @phpstan-pure
* @param mixed $value
* @return mixed
* @param T $value
* @return T
*
* @throws void
*/
function dumpType($value) // phpcs:ignore Squiz.Functions.GlobalFunction.Found
Copy link
Contributor

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.

{
return null;
return $value;
}

/**
* @template T
* @phpstan-pure
* @param mixed $value
* @return mixed
* @param T $value
* @return T
*
* @throws void
*/
function dumpPhpDocType($value) // phpcs:ignore Squiz.Functions.GlobalFunction.Found
{
return null;
return $value;
}
Loading