@@ -727,6 +727,7 @@ private function handleAllNot(
727
727
if ($ methodName === 'allNotNull ' ) {
728
728
return $ this ->arrayOrIterable (
729
729
$ scope ,
730
+ $ node ,
730
731
$ node ->getArgs ()[0 ]->value ,
731
732
static function (Type $ type ): Type {
732
733
return TypeCombinator::removeNull ($ type );
@@ -747,6 +748,7 @@ static function (Type $type): Type {
747
748
748
749
return $ this ->arrayOrIterable (
749
750
$ scope ,
751
+ $ node ,
750
752
$ node ->getArgs ()[0 ]->value ,
751
753
static function (Type $ type ) use ($ objectType ): Type {
752
754
return TypeCombinator::remove ($ type , $ objectType );
@@ -758,6 +760,7 @@ static function (Type $type) use ($objectType): Type {
758
760
$ valueType = $ scope ->getType ($ node ->getArgs ()[1 ]->value );
759
761
return $ this ->arrayOrIterable (
760
762
$ scope ,
763
+ $ node ,
761
764
$ node ->getArgs ()[0 ]->value ,
762
765
static function (Type $ type ) use ($ valueType ): Type {
763
766
return TypeCombinator::remove ($ type , $ valueType );
@@ -815,6 +818,7 @@ private function handleAll(
815
818
816
819
return $ this ->arrayOrIterable (
817
820
$ scope ,
821
+ $ expression ,
818
822
$ exprNode ,
819
823
static function () use ($ type ): Type {
820
824
return $ type ->getIterableValueType ();
@@ -830,6 +834,7 @@ static function () use ($type): Type {
830
834
831
835
private function arrayOrIterable (
832
836
Scope $ scope ,
837
+ Expr $ rootExpr ,
833
838
Expr $ expr ,
834
839
Closure $ typeCallback
835
840
): SpecifiedTypes
@@ -861,7 +866,10 @@ private function arrayOrIterable(
861
866
return $ this ->typeSpecifier ->create (
862
867
$ expr ,
863
868
$ specifiedType ,
864
- TypeSpecifierContext::createTruthy ()
869
+ TypeSpecifierContext::createTruthy (),
870
+ false ,
871
+ $ scope ,
872
+ $ rootExpr ,
865
873
);
866
874
}
867
875
0 commit comments