Closed Hywan closed 4 years ago
Howdy!
This code:
function f(): Generator { yield 42; }
will throw this error: PHPCS.E.NeutronStandard.Functions.TypeHint.UnusedReturnType saying:
PHPCS.E.NeutronStandard.Functions.TypeHint.UnusedReturnType
Return type with no return
Yes, there is no return statement, but we have a yield ;-).
return
yield
I guess a similar issue will happen when we use iterable instead of Generator.
iterable
Generator
Howdy!
This code:
will throw this error:
PHPCS.E.NeutronStandard.Functions.TypeHint.UnusedReturnType
saying:Yes, there is no
return
statement, but we have ayield
;-).