Debian Codegraph @

vendor/mck89/peast/lib/Peast/Syntax/Node/WithStatement.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 a with statement.
14 * For example: with (test) {}
15 *
16 * @author Marco Marchiò <[email protected]>
17 */
18 class WithStatement extends Node implements Statement
19 {
20 /**
21 * Map of node properties
22 *
23 * @var array
24 */
25 protected $propertiesMap = array(
26 "object" => true,
27 "body" => true
28 );
29
30 /**
31 * The statement subject
32 *
33 * @var Expression
34 */
35 protected $object;
36
37 /**
38 * The statement body
39 *
40 * @var Expression
41 */
42 protected $body;
43
44 /**
45 * Returns the statement subject
46 *
47 * @return Expression
48 */
49 public function getObject()
50 {
51 return $this->object;
52 }
53
54 /**
55 * Sets the statement subject
56 *
57 * @param Expression $object Statement subject
58 *
59 * @return $this
60 */
61 public function setObject(Expression $object)
62 {
63 $this->object = $object;
64 return $this;
65 }
66
67 /**
68 * Returns the statement body
69 *
70 * @return Expression
71 */
72 public function getBody()
73 {
74 return $this->body;
75 }
76
77 /**
78 * Sets the statement body
79 *
80 * @param Statement $body Statement body
81 *
82 * @return $this
83 */
84 public function setBody(Statement $body)
85 {
86 $this->body = $body;
87 return $this;
88 }
89 }