Debian Codegraph @

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