mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-16 11:26:55 +01:00
719ca71d4a
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.
30 lines
765 B
PHP
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');
|
|
}
|
|
}
|