phpstan icon indicating copy to clipboard operation
phpstan copied to clipboard

Missing parameter and return typehints not reported on Closures

Open neildaniels opened this issue 3 years ago • 0 comments

Bug report

I would have expected that missing typehints for parameters and return types would be required at some level (probably the same normal functions, but would okay with a higher level).

Code snippet that reproduces the problem

$b = function($b) {
	return 'B';
};

https://phpstan.org/r/dd90e502-6f07-46f9-a935-921e7720b5a0

Expected output

I would expect it complain about missing typehints on Closure, similar to what it does for a normal function.

Did PHPStan help you today? Did it make you happy in any way?

neildaniels avatar Aug 06 '22 02:08 neildaniels