菜谱项目

Catch_.php 918B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace PhpParser\Node\Stmt;
  3. use PhpParser\Node;
  4. class Catch_ extends Node\Stmt
  5. {
  6. /** @var Node\Name[] Types of exceptions to catch */
  7. public $types;
  8. /** @var string Variable for exception */
  9. public $var;
  10. /** @var Node[] Statements */
  11. public $stmts;
  12. /**
  13. * Constructs a catch node.
  14. *
  15. * @param Node\Name[] $types Types of exceptions to catch
  16. * @param string $var Variable for exception
  17. * @param Node[] $stmts Statements
  18. * @param array $attributes Additional attributes
  19. */
  20. public function __construct(array $types, $var, array $stmts = array(), array $attributes = array()) {
  21. parent::__construct($attributes);
  22. $this->types = $types;
  23. $this->var = $var;
  24. $this->stmts = $stmts;
  25. }
  26. public function getSubNodeNames() {
  27. return array('types', 'var', 'stmts');
  28. }
  29. }