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|null 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|null $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 = null, array $stmts = [], array $attributes = []
27: ) {
28: $this->attributes = $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: }
42: