Skip to content

Commit 6e3130a

Browse files
staabmondrejmirtes
authored andcommitted
ConstantStringType: prevent unnecessary work
1 parent 4a49df4 commit 6e3130a

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/Type/Constant/ConstantStringType.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,15 @@ public function isCallable(): TrinaryLogic
209209
return TrinaryLogic::createMaybe();
210210
}
211211

212-
$phpVersion = PhpVersionStaticAccessor::getInstance();
213212
$classRef = $reflectionProvider->getClass($matches[1]);
214213
if ($classRef->hasMethod($matches[2])) {
215-
$method = $classRef->getMethod($matches[2], new OutOfClassScope());
216-
if (
217-
!$phpVersion->supportsCallableInstanceMethods()
218-
&& !$method->isStatic()
219-
) {
220-
return TrinaryLogic::createNo();
214+
$phpVersion = PhpVersionStaticAccessor::getInstance();
215+
if (!$phpVersion->supportsCallableInstanceMethods()) {
216+
$method = $classRef->getMethod($matches[2], new OutOfClassScope());
217+
218+
if (!$method->isStatic()) {
219+
return TrinaryLogic::createNo();
220+
}
221221
}
222222

223223
return TrinaryLogic::createYes();

0 commit comments

Comments
 (0)