Skip to content

Commit c38bb12

Browse files
committed
Use isset() over strlen() for better performance
1 parent 8acfada commit c38bb12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart)
406406

407407
foreach ($typeNames as $typeName) {
408408
// Strip nullable operator.
409-
if (strlen($typeName) > 1 && $typeName[0] === '?') {
409+
if (isset($typeName[0]) === true && $typeName[0] === '?') {
410410
$typeName = substr($typeName, 1);
411411
}
412412

0 commit comments

Comments
 (0)