TryCatch.php 929 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace PhpParser\Node\Stmt;
  3. use PhpParser\Node;
  4. class TryCatch extends Node\Stmt
  5. {
  6. /** @var Node[] Statements */
  7. public $stmts;
  8. /** @var Catch_[] Catches */
  9. public $catches;
  10. /** @var null|Finally_ Optional finally node */
  11. public $finally;
  12. /**
  13. * Constructs a try catch node.
  14. *
  15. * @param Node[] $stmts Statements
  16. * @param Catch_[] $catches Catches
  17. * @param null|Finally_ $finally Optionaly finally node
  18. * @param array|null $attributes Additional attributes
  19. */
  20. public function __construct(array $stmts, array $catches, Finally_ $finally = null, array $attributes = array()) {
  21. parent::__construct($attributes);
  22. $this->stmts = $stmts;
  23. $this->catches = $catches;
  24. $this->finally = $finally;
  25. }
  26. public function getSubNodeNames() {
  27. return array('stmts', 'catches', 'finally');
  28. }
  29. }