From 8900cefc9d1172c82fb2b3e08be219b6c1ab3fcf Mon Sep 17 00:00:00 2001 From: Yohta Kimura Date: Sat, 17 Dec 2022 21:25:23 +0900 Subject: [PATCH] micro optimization --- src/Type/TypeCombinator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Type/TypeCombinator.php b/src/Type/TypeCombinator.php index fd95ad86b96..1ce462e96cd 100644 --- a/src/Type/TypeCombinator.php +++ b/src/Type/TypeCombinator.php @@ -512,11 +512,11 @@ private static function processArrayAccessoryTypes(array $arrayTypes): array if ($innerType instanceof TemplateType) { break; } - if ($innerType instanceof HasOffsetValueType) { - $accessoryTypes[sprintf('hasOffsetValue(%s)', $innerType->getOffsetType()->describe(VerbosityLevel::cache()))][$i] = $innerType; + if (!($innerType instanceof AccessoryType) && !($innerType instanceof CallableType)) { continue; } - if (!($innerType instanceof AccessoryType) && !($innerType instanceof CallableType)) { + if ($innerType instanceof HasOffsetValueType) { + $accessoryTypes[sprintf('hasOffsetValue(%s)', $innerType->getOffsetType()->describe(VerbosityLevel::cache()))][$i] = $innerType; continue; }