Skip to content

Commit

Permalink
Squiz/FunctionDeclarationArgumentSpacing: minor simplification
Browse files Browse the repository at this point in the history
No need to recreate the type hint when it's already available in the return value of the `getMethodParameters()` method.
  • Loading branch information
jrfnl committed Jan 23, 2025
1 parent d1897a0 commit 8b6a8d4
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,7 @@ public function processBracket($phpcsFile, $openBracket)
}
}//end if
} else {
$hint = $phpcsFile->getTokensAsString($param['type_hint_token'], (($param['type_hint_end_token'] - $param['type_hint_token']) + 1));
if ($param['nullable_type'] === true) {
$hint = '?'.$hint;
}
$hint = $param['type_hint'];

if ($tokens[($commaToken + 1)]['code'] !== T_WHITESPACE) {
$error = 'Expected 1 space between comma and type hint "%s"; 0 found';
Expand Down

0 comments on commit 8b6a8d4

Please sign in to comment.