Skip to content

Commit 1169e38

Browse files
committed
Squiz/FunctionDeclarationArgumentSpacing: minor simplification
No need to recreate the type hint when it's already available in the return value of the `getMethodParameters()` method.
1 parent 07b5e34 commit 1169e38

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,7 @@ public function processBracket($phpcsFile, $openBracket)
384384
}
385385
}//end if
386386
} else {
387-
$hint = $phpcsFile->getTokensAsString($param['type_hint_token'], (($param['type_hint_end_token'] - $param['type_hint_token']) + 1));
388-
if ($param['nullable_type'] === true) {
389-
$hint = '?'.$hint;
390-
}
387+
$hint = $param['type_hint'];
391388

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

0 commit comments

Comments
 (0)