Skip to content

Commit 262fb85

Browse files
committed
Retain rootExpr for TypeSpecifier
1 parent d753a63 commit 262fb85

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ private function handleAllNot(
727727
if ($methodName === 'allNotNull') {
728728
return $this->arrayOrIterable(
729729
$scope,
730+
$node,
730731
$node->getArgs()[0]->value,
731732
static function (Type $type): Type {
732733
return TypeCombinator::removeNull($type);
@@ -747,6 +748,7 @@ static function (Type $type): Type {
747748

748749
return $this->arrayOrIterable(
749750
$scope,
751+
$node,
750752
$node->getArgs()[0]->value,
751753
static function (Type $type) use ($objectType): Type {
752754
return TypeCombinator::remove($type, $objectType);
@@ -758,6 +760,7 @@ static function (Type $type) use ($objectType): Type {
758760
$valueType = $scope->getType($node->getArgs()[1]->value);
759761
return $this->arrayOrIterable(
760762
$scope,
763+
$node,
761764
$node->getArgs()[0]->value,
762765
static function (Type $type) use ($valueType): Type {
763766
return TypeCombinator::remove($type, $valueType);
@@ -815,6 +818,7 @@ private function handleAll(
815818

816819
return $this->arrayOrIterable(
817820
$scope,
821+
$expression,
818822
$exprNode,
819823
static function () use ($type): Type {
820824
return $type->getIterableValueType();
@@ -830,6 +834,7 @@ static function () use ($type): Type {
830834

831835
private function arrayOrIterable(
832836
Scope $scope,
837+
Expr $rootExpr,
833838
Expr $expr,
834839
Closure $typeCallback
835840
): SpecifiedTypes
@@ -861,7 +866,10 @@ private function arrayOrIterable(
861866
return $this->typeSpecifier->create(
862867
$expr,
863868
$specifiedType,
864-
TypeSpecifierContext::createTruthy()
869+
TypeSpecifierContext::createTruthy(),
870+
false,
871+
$scope,
872+
$rootExpr,
865873
);
866874
}
867875

0 commit comments

Comments
 (0)