2323final class ArrayHandler implements ExprHandler
2424{
2525
26- public function __construct (
27- private NodeScopeResolver $ nodeScopeResolver ,
28- )
29- {
30- }
31-
3226 public function supports (Expr $ expr ): bool
3327 {
3428 return $ expr instanceof Array_;
3529 }
3630
37- public function processExpr (Stmt $ stmt , Expr $ expr , MutatingScope $ scope , ExpressionResultStorage $ storage , callable $ nodeCallback , ExpressionContext $ context ): ExpressionResult
31+ public function processExpr (NodeScopeResolver $ nodeScopeResolver , Stmt $ stmt , Expr $ expr , MutatingScope $ scope , ExpressionResultStorage $ storage , callable $ nodeCallback , ExpressionContext $ context ): ExpressionResult
3832 {
3933 $ itemNodes = [];
4034 $ hasYield = false ;
@@ -43,24 +37,24 @@ public function processExpr(Stmt $stmt, Expr $expr, MutatingScope $scope, Expres
4337 $ isAlwaysTerminating = false ;
4438 foreach ($ expr ->items as $ arrayItem ) {
4539 $ itemNodes [] = new LiteralArrayItem ($ scope , $ arrayItem );
46- $ this -> nodeScopeResolver ->callNodeCallback ($ nodeCallback , $ arrayItem , $ scope , $ storage );
40+ $ nodeScopeResolver ->callNodeCallback ($ nodeCallback , $ arrayItem , $ scope , $ storage );
4741 if ($ arrayItem ->key !== null ) {
48- $ keyResult = $ this -> nodeScopeResolver ->processExprNode ($ stmt , $ arrayItem ->key , $ scope , $ storage , $ nodeCallback , $ context ->enterDeep ());
42+ $ keyResult = $ nodeScopeResolver ->processExprNode ($ stmt , $ arrayItem ->key , $ scope , $ storage , $ nodeCallback , $ context ->enterDeep ());
4943 $ hasYield = $ hasYield || $ keyResult ->hasYield ();
5044 $ throwPoints = array_merge ($ throwPoints , $ keyResult ->getThrowPoints ());
5145 $ impurePoints = array_merge ($ impurePoints , $ keyResult ->getImpurePoints ());
5246 $ isAlwaysTerminating = $ isAlwaysTerminating || $ keyResult ->isAlwaysTerminating ();
5347 $ scope = $ keyResult ->getScope ();
5448 }
5549
56- $ valueResult = $ this -> nodeScopeResolver ->processExprNode ($ stmt , $ arrayItem ->value , $ scope , $ storage , $ nodeCallback , $ context ->enterDeep ());
50+ $ valueResult = $ nodeScopeResolver ->processExprNode ($ stmt , $ arrayItem ->value , $ scope , $ storage , $ nodeCallback , $ context ->enterDeep ());
5751 $ hasYield = $ hasYield || $ valueResult ->hasYield ();
5852 $ throwPoints = array_merge ($ throwPoints , $ valueResult ->getThrowPoints ());
5953 $ impurePoints = array_merge ($ impurePoints , $ valueResult ->getImpurePoints ());
6054 $ isAlwaysTerminating = $ isAlwaysTerminating || $ valueResult ->isAlwaysTerminating ();
6155 $ scope = $ valueResult ->getScope ();
6256 }
63- $ this -> nodeScopeResolver ->callNodeCallback ($ nodeCallback , new LiteralArrayNode ($ expr , $ itemNodes ), $ scope , $ storage );
57+ $ nodeScopeResolver ->callNodeCallback ($ nodeCallback , new LiteralArrayNode ($ expr , $ itemNodes ), $ scope , $ storage );
6458
6559 return new ExpressionResult (
6660 $ scope ,
0 commit comments