2011-06-05 18:40:04 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2011-08-14 18:44:24 +02:00
|
|
|
* @property PHPParser_Node_Expr $expr Expression to iterate
|
|
|
|
* @property null|PHPParser_Node_Expr $keyVar Variable to assign key to
|
|
|
|
* @property bool $byRef Whether to assign value by reference
|
|
|
|
* @property PHPParser_Node_Expr $valueVar Variable to assign value to
|
2011-10-28 19:06:24 +02:00
|
|
|
* @property PHPParser_Node[] $stmts Statements
|
2011-06-05 18:40:04 +02:00
|
|
|
*/
|
|
|
|
class PHPParser_Node_Stmt_Foreach extends PHPParser_Node_Stmt
|
|
|
|
{
|
2011-10-28 19:06:24 +02:00
|
|
|
/**
|
|
|
|
* Constructs a foreach node.
|
|
|
|
*
|
|
|
|
* @param PHPParser_Node_Expr $expr Expression to iterate
|
|
|
|
* @param PHPParser_Node_Expr $valueVar Variable to assign value to
|
|
|
|
* @param array $subNodes Array of the following optional subnodes:
|
|
|
|
* 'keyVar' => null : Variable to assign key to
|
|
|
|
* 'byRef' => false : Whether to assign value by reference
|
|
|
|
* 'stmts' => array(): Statements
|
2012-04-29 23:32:09 +02:00
|
|
|
* @param array $attributes Additional attributes
|
2011-10-28 19:06:24 +02:00
|
|
|
*/
|
2012-04-29 23:32:09 +02:00
|
|
|
public function __construct(PHPParser_Node_Expr $expr, PHPParser_Node_Expr $valueVar, array $subNodes = array(), array $attributes = array()) {
|
2011-10-28 19:06:24 +02:00
|
|
|
parent::__construct(
|
|
|
|
$subNodes + array(
|
|
|
|
'keyVar' => null,
|
|
|
|
'byRef' => false,
|
|
|
|
'stmts' => array(),
|
|
|
|
),
|
2012-04-29 23:32:09 +02:00
|
|
|
$attributes
|
2011-10-28 19:06:24 +02:00
|
|
|
);
|
|
|
|
$this->expr = $expr;
|
|
|
|
$this->valueVar = $valueVar;
|
|
|
|
}
|
2011-06-05 18:40:04 +02:00
|
|
|
}
|