function test17 in Coder 8.2
Same name in this branch
Same name and namespace in other branches
Return with optional null and function with some void returns.
When a function has an optional null as a return value then it should not result in an error when there is a void return in the function.
Parameters
string $arg: An argument.
Return value
int|null Return has an optional null.
File
- coder_sniffer/
Drupal/ Test/ good/ good.php, line 1431 - This file contains all the valid notations for the drupal coding standard.
Code
function test17($arg) {
if ($arg === 1) {
return;
}
return 1;
}