Debian Codegraph @

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