1: <?php
2: namespace Pharborist\Exceptions;
3:
4: use Pharborist\ParentNode;
5: use Pharborist\Namespaces\NameNode;
6: use Pharborist\ParenTrait;
7: use Pharborist\StatementBlockNode;
8: use Pharborist\Variables\VariableNode;
9:
10: /**
11: * A catch in a try control structure.
12: */
13: class CatchNode extends ParentNode {
14: use ParenTrait;
15:
16: /**
17: * @var NameNode
18: */
19: protected $exceptionType;
20:
21: /**
22: * @var VariableNode
23: */
24: protected $variable;
25:
26: /**
27: * @var StatementBlockNode
28: */
29: protected $body;
30:
31: /**
32: * @return NameNode
33: */
34: public function getExceptionType() {
35: return $this->exceptionType;
36: }
37:
38: /**
39: * Returns the variable for the caught exception.
40: *
41: * @return VariableNode
42: */
43: public function getVariable() {
44: return $this->variable;
45: }
46:
47: /**
48: * @return StatementBlockNode
49: */
50: public function getBody() {
51: return $this->body;
52: }
53: }
54: