1 <?php declare(strict_types=1);
3 namespace PhpParser\Node\Stmt;
6 use PhpParser\Node\Expr;
8 class Catch_ extends Node\Stmt
10 /** @var Node\Name[] Types of exceptions to catch */
12 /** @var Expr\Variable Variable for exception */
14 /** @var Node\Stmt[] Statements */
18 * Constructs a catch node.
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
25 public function __construct(
26 array $types, Expr\Variable $var, array $stmts = [], array $attributes = []
28 parent::__construct($attributes);
29 $this->types = $types;
31 $this->stmts = $stmts;
34 public function getSubNodeNames() : array {
35 return ['types', 'var', 'stmts'];
38 public function getType() : string {