| 1 | <?php |
||
| 8 | class TryCatch extends Node\Stmt |
||
| 9 | { |
||
| 10 | /** @var Node[] Statements */ |
||
| 11 | public $stmts; |
||
| 12 | /** @var Catch_[] Catches */ |
||
| 13 | public $catches; |
||
| 14 | /** @var null|Node[] Finally statements */ |
||
| 15 | public $finallyStmts; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Constructs a try catch node. |
||
| 19 | * |
||
| 20 | * @param Node[] $stmts Statements |
||
| 21 | * @param Catch_[] $catches Catches |
||
| 22 | * @param null|Node[] $finallyStmts Finally statements (null means no finally clause) |
||
| 23 | * @param array|null $attributes Additional attributes |
||
| 24 | */ |
||
| 25 | public function __construct(array $stmts, array $catches, array $finallyStmts = null, array $attributes = array()) { |
||
| 26 | if (empty($catches) && null === $finallyStmts) { |
||
| 27 | throw new Error('Cannot use try without catch or finally'); |
||
| 28 | } |
||
| 29 | |||
| 30 | parent::__construct($attributes); |
||
| 31 | $this->stmts = $stmts; |
||
| 32 | $this->catches = $catches; |
||
| 33 | $this->finallyStmts = $finallyStmts; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getSubNodeNames() { |
||
| 39 | } |
||
| 40 |