1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-11 17:09:41 +01:00
PHP-Parser/lib/PhpParser/Node/Stmt/Declare_.php
Nikita Popov 719ca71d4a Distinguish declare(); and declare(){}
It makes semantic difference and the latter form is actually
forbidden for strict_types.

This sets Declare->stmts to null for the body-less case.
2015-12-07 12:12:00 +01:00

30 lines
765 B
PHP

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