mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-15 19:07:06 +01:00
574665b45b
Expr\List will now contain ArrayItems instead of plain variables. I'm reusing ArrayItem, because code handling list() must also handle arrays, and this allows both to go through the same code path. This also renames Expr\List->vars to ->items. TODO: Should Expr\List be dropped in favor of Expr\Array with an extra flag?
27 lines
598 B
PHP
27 lines
598 B
PHP
<?php
|
|
|
|
namespace PhpParser\Node\Expr;
|
|
|
|
use PhpParser\Node\Expr;
|
|
|
|
class List_ extends Expr
|
|
{
|
|
/** @var ArrayItem[] List of items to assign to */
|
|
public $items;
|
|
|
|
/**
|
|
* Constructs a list() destructuring node.
|
|
*
|
|
* @param ArrayItem[] $items List of items to assign to
|
|
* @param array $attributes Additional attributes
|
|
*/
|
|
public function __construct(array $items, array $attributes = array()) {
|
|
parent::__construct($attributes);
|
|
$this->items = $items;
|
|
}
|
|
|
|
public function getSubNodeNames() {
|
|
return array('items');
|
|
}
|
|
}
|