PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.8.9
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.8.9
4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 All 200 releases
betterdocs / includes / Dependencies / PhpParser / Node / Stmt / Foreach_.php

Foreach_.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 3.8.9, at includes/Dependencies/PhpParser/Node/Stmt/Foreach_.php

44 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPDeveloper\BetterDocs\Dependencies\PhpParser\Node\Stmt;
4
5 use WPDeveloper\BetterDocs\Dependencies\PhpParser\Node;
6
7 class Foreach_ extends Node\Stmt
8 {
9 /** @var Node\Expr Expression to iterate */
10 public $expr;
11 /** @var null|Node\Expr Variable to assign key to */
12 public $keyVar;
13 /** @var bool Whether to assign value by reference */
14 public $byRef;
15 /** @var Node\Expr Variable to assign value to */
16 public $valueVar;
17 /** @var Node[] Statements */
18 public $stmts;
19
20 /**
21 * Constructs a foreach node.
22 *
23 * @param Node\Expr $expr Expression to iterate
24 * @param Node\Expr $valueVar Variable to assign value to
25 * @param array $subNodes Array of the following optional subnodes:
26 * 'keyVar' => null : Variable to assign key to
27 * 'byRef' => false : Whether to assign value by reference
28 * 'stmts' => array(): Statements
29 * @param array $attributes Additional attributes
30 */
31 public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNodes = array(), array $attributes = array()) {
32 parent::__construct($attributes);
33 $this->expr = $expr;
34 $this->keyVar = isset($subNodes['keyVar']) ? $subNodes['keyVar'] : null;
35 $this->byRef = isset($subNodes['byRef']) ? $subNodes['byRef'] : false;
36 $this->valueVar = $valueVar;
37 $this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
38 }
39
40 public function getSubNodeNames() {
41 return array('expr', 'keyVar', 'byRef', 'valueVar', 'stmts');
42 }
43 }
44