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 11, 2025
1 parent 07b5e34 commit 1169e38
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 384,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 1169e38

Please sign in to comment.