Debian Codegraph @

vendor/mck89/peast/lib/Peast/Syntax/Node/BlockStatement.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 block of code wrapped in curly braces.
14 *
15 * @author Marco Marchiò <[email protected]>
16 */
17 class BlockStatement extends Node implements Statement
18 {
19 /**
20 * Map of node properties
21 *
22 * @var array
23 */
24 protected $propertiesMap = array(
25 "body" => true
26 );
27
28 /**
29 * Block's body
30 *
31 * @var Statement[]
32 */
33 protected $body = array();
34
35 /**
36 * Returns block's body
37 *
38 * @return Statement[]
39 */
40 public function getBody()
41 {
42 return $this->body;
43 }
44
45 /**
46 * Sets block's body
47 *
48 * @param Statement[] $body Array of Statements that are the body of the
49 * block
50 *
51 * @return $this
52 */
53 public function setBody($body)
54 {
55 $this->assertArrayOf($body, "Statement");
56 $this->body = $body;
57 return $this;
58 }
59 }