Catch_.php 893 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace PhpParser\Node\Stmt;
  3. use PhpParser\Node;
  4. class Catch_ extends Node\Stmt
  5. {
  6. /** @var Node\Name Class of exception */
  7. public $type;
  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 $type Class of exception
  16. * @param string $var Variable for exception
  17. * @param Node[] $stmts Statements
  18. * @param array $attributes Additional attributes
  19. */
  20. public function __construct(Node\Name $type, $var, array $stmts = array(), array $attributes = array()) {
  21. parent::__construct(null, $attributes);
  22. $this->type = $type;
  23. $this->var = $var;
  24. $this->stmts = $stmts;
  25. }
  26. public function getSubNodeNames() {
  27. return array('type', 'var', 'stmts');
  28. }
  29. }