Closed
Description
currently, our CS mandate to use return;
to return null
from a function.
But there is 2 different cases actually:
- a function without any return value (returning void), for which
return;
makes sense - a function returning something or
null
, for whichreturn null;
would be more meaningful
The original discussion said that PHP had no concept of void
and so that our CS should not distinguish these 2 cases (and so should have a single rule). But PHP 7.1 now has such concept: https://wiki.php.net/rfc/void_return_type
I think we should revisit this rule in our coding standards, to distinguish functions returning void and functions returning something or null.
what do you think ?