Skip to content

Commit

Permalink
Use isset() over strlen() for better performance
Browse files Browse the repository at this point in the history
  • Loading branch information
fredden committed Mar 29, 2023
1 parent 8acfada commit c38bb12
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit c38bb12

Please sign in to comment.