Debian Codegraph @

vendor/mck89/peast/lib/Peast/Syntax/Node/CatchClause.php

raw
1 <?php
2 /**
3 * This file is part of the Peast package
4 *
5 * (c) Marco Marchiò <[email protected]>
6 *
7 * For the full copyright and license information refer to the LICENSE file
8 * distributed with this source code
9 */
10 namespace Peast\Syntax\Node;
11
12 /**
13 * A node that represents the catch clause in a try-catch statement.
14 *
15 * @author Marco Marchiò <[email protected]>
16 */
17 class CatchClause extends Node
18 {
19 /**
20 * Map of node properties
21 *
22 * @var array
23 */
24 protected $propertiesMap = array(
25 "param" => true,
26 "body" => true
27 );
28
29 /**
30 * The catch clause parameter
31 *
32 * @var Pattern
33 */
34 protected $param;
35
36 /**
37 * The body of the catch clause
38 *
39 * @var BlockStatement
40 */
41 protected $body;
42
43 /**
44 * Returns the catch clause parameter
45 *
46 * @return Pattern
47 */
48 public function getParam()
49 {
50 return $this->param;
51 }
52
53 /**
54 * Sets the catch clause parameter
55 *
56 * @param Pattern $param Catch clause parameter
57 *
58 * @return $this
59 */
60 public function setParam($param)
61 {
62 $this->assertType($param, "Pattern", true);
63 $this->param = $param;
64 return $this;
65 }
66
67 /**
68 * Returns the body of the catch clause
69 *
70 * @return BlockStatement
71 */
72 public function getBody()
73 {
74 return $this->body;
75 }
76
77 /**
78 * Sets the body of the catch clause
79 *
80 * @param BlockStatement $body The block of code inside the catch clause
81 *
82 * @return $this
83 */
84 public function setBody(BlockStatement $body)
85 {
86 $this->body = $body;
87 return $this;
88 }
89 }