49cecf39d9a3f60832c5a310d9e200b26d6020f4
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / Node / Stmt / Catch_.php
1 <?php declare(strict_types=1);
2
3 namespace PhpParser\Node\Stmt;
4
5 use PhpParser\Node;
6 use PhpParser\Node\Expr;
7
8 class Catch_ extends Node\Stmt
9 {
10     /** @var Node\Name[] Types of exceptions to catch */
11     public $types;
12     /** @var Expr\Variable Variable for exception */
13     public $var;
14     /** @var Node\Stmt[] Statements */
15     public $stmts;
16
17     /**
18      * Constructs a catch node.
19      *
20      * @param Node\Name[]   $types      Types of exceptions to catch
21      * @param Expr\Variable $var        Variable for exception
22      * @param Node\Stmt[]   $stmts      Statements
23      * @param array         $attributes Additional attributes
24      */
25     public function __construct(
26         array $types, Expr\Variable $var, array $stmts = [], array $attributes = []
27     ) {
28         parent::__construct($attributes);
29         $this->types = $types;
30         $this->var = $var;
31         $this->stmts = $stmts;
32     }
33
34     public function getSubNodeNames() : array {
35         return ['types', 'var', 'stmts'];
36     }
37     
38     public function getType() : string {
39         return 'Stmt_Catch';
40     }
41 }