diff --git a/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php b/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php index 91f5693ef4..1101165cbd 100644 --- a/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php +++ b/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php @@ -406,7 +406,7 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart) foreach ($typeNames as $typeName) { // Strip nullable operator. - if (strlen($typeName) > 1 && $typeName[0] === '?') { + if (isset($typeName[0]) === true && $typeName[0] === '?') { $typeName = substr($typeName, 1); }