Skip to content

Commit

Permalink
Merge branch refs/heads/1.10.x into 1.11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
phpstan-bot committed Jun 22, 2023
2 parents 074440e + fcf1939 commit fdde07f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Type/Constant/ConstantArrayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Nette\Utils\Strings;
use PHPStan\Analyser\OutOfClassScope;
use PHPStan\DependencyInjection\BleedingEdgeToggle;
use PHPStan\Internal\CombinationsHelper;
use PHPStan\Php\PhpVersion;
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprIntegerNode;
Expand Down Expand Up @@ -563,7 +564,11 @@ public function findTypeAndMethodNames(): array
continue;
}

if ($has->yes() && !$phpVersion->supportsCallableInstanceMethods()) {
if (
BleedingEdgeToggle::isBleedingEdge()
&& $has->yes()
&& !$phpVersion->supportsCallableInstanceMethods()
) {
$methodReflection = $type->getMethod($method->getValue(), new OutOfClassScope());
if ($classOrObject->isString()->yes() && !$methodReflection->isStatic()) {
continue;
Expand Down
7 changes: 6 additions & 1 deletion src/Type/Constant/ConstantStringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Nette\Utils\Strings;
use PhpParser\Node\Name;
use PHPStan\Analyser\OutOfClassScope;
use PHPStan\DependencyInjection\BleedingEdgeToggle;
use PHPStan\PhpDocParser\Ast\ConstExpr\QuoteAwareConstExprStringNode;
use PHPStan\PhpDocParser\Ast\Type\ConstTypeNode;
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
Expand Down Expand Up @@ -212,7 +213,11 @@ public function isCallable(): TrinaryLogic
$classRef = $reflectionProvider->getClass($matches[1]);
if ($classRef->hasMethod($matches[2])) {
$method = $classRef->getMethod($matches[2], new OutOfClassScope());
if (!$phpVersion->supportsCallableInstanceMethods() && !$method->isStatic()) {
if (
BleedingEdgeToggle::isBleedingEdge()
&& !$phpVersion->supportsCallableInstanceMethods()
&& !$method->isStatic()
) {
return TrinaryLogic::createNo();
}

Expand Down

0 comments on commit fdde07f

Please sign in to comment.