Skip to content

Commit 5ab5a59

Browse files
gharlannicolas-grekas
authored andcommitted
optimize in_array calls
1 parent 37cb740 commit 5ab5a59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DebugClassLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,8 @@ private function setReturnType(string $types, string $class, string $method, str
846846
$iterable = $object = true;
847847
foreach ($typesMap as $n => $t) {
848848
if ('null' !== $n) {
849-
$iterable = $iterable && (\in_array($n, ['array', 'iterable']) || str_contains($n, 'Iterator'));
850-
$object = $object && (\in_array($n, ['callable', 'object', '$this', 'static']) || !isset(self::SPECIAL_RETURN_TYPES[$n]));
849+
$iterable = $iterable && (\in_array($n, ['array', 'iterable'], true) || str_contains($n, 'Iterator'));
850+
$object = $object && (\in_array($n, ['callable', 'object', '$this', 'static'], true) || !isset(self::SPECIAL_RETURN_TYPES[$n]));
851851
}
852852
}
853853

0 commit comments

Comments
 (0)