1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-03 09:47:59 +01:00
PHP-Parser/lib/PhpParser/Node/Stmt/Namespace_.php
Nikita Popov caa5c0cc76 Graceful handling for "special" errors
Nearly all special errors are now handled gracefully, i.e. the
parser will be able to continue after encountering them. In some
cases the associated error range has been improved using the new
end attribute stack.

To achieve this the error handling code has been moved out of the
node constructors and into special methods in the parser.
2016-10-09 12:38:18 +02:00

32 lines
747 B
PHP

<?php
namespace PhpParser\Node\Stmt;
use PhpParser\Node;
use PhpParser\Error;
class Namespace_ extends Node\Stmt
{
/** @var null|Node\Name Name */
public $name;
/** @var Node[] Statements */
public $stmts;
/**
* Constructs a namespace node.
*
* @param null|Node\Name $name Name
* @param null|Node[] $stmts Statements
* @param array $attributes Additional attributes
*/
public function __construct(Node\Name $name = null, $stmts = array(), array $attributes = array()) {
parent::__construct($attributes);
$this->name = $name;
$this->stmts = $stmts;
}
public function getSubNodeNames() {
return array('name', 'stmts');
}
}