Skip to content

Commit 4c27e0f

Browse files
Add No filter
1 parent 8993085 commit 4c27e0f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Type/Constant/ConstantArrayType.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ public function equals(Type $type): bool
458458

459459
public function isCallable(): TrinaryLogic
460460
{
461-
$typeAndMethods = $this->findTypeAndMethodNames();
461+
$typeAndMethods = $this->findTypeAndMethodNames(false);
462462
if ($typeAndMethods === []) {
463463
return TrinaryLogic::createNo();
464464
}
@@ -561,7 +561,7 @@ public function findTypeAndMethodName(): ?ConstantArrayTypeAndMethod
561561
}
562562

563563
/** @return ConstantArrayTypeAndMethod[] */
564-
public function findTypeAndMethodNames(): array
564+
public function findTypeAndMethodNames(bool $atLeastMaybe = true): array
565565
{
566566
$callableArray = $this->getClassOrObjectAndMethods();
567567
if ($callableArray === []) {
@@ -594,7 +594,9 @@ public function findTypeAndMethodNames(): array
594594
}
595595
}
596596

597-
$typeAndMethods[] = ConstantArrayTypeAndMethod::createConcrete($type, $method->getValue(), $has);
597+
if (!$atLeastMaybe || !$has->no()) {
598+
$typeAndMethods[] = ConstantArrayTypeAndMethod::createConcrete($type, $method->getValue(), $has);
599+
}
598600
}
599601

600602
return $typeAndMethods;

0 commit comments

Comments
 (0)