Debian Codegraph @

vendor/mck89/peast/lib/Peast/Syntax/Node/ClassBody.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 class body.
14 *
15 * @author Marco Marchiò <[email protected]>
16 */
17 class ClassBody extends Node
18 {
19 /**
20 * Map of node properties
21 *
22 * @var array
23 */
24 protected $propertiesMap = array(
25 "body" => true
26 );
27
28 /**
29 * Class methods and properties
30 *
31 * @var MethodDefinition[]|PropertyDefinition[]|StaticBlock[]
32 */
33 protected $body = array();
34
35 /**
36 * Returns class methods and properties
37 *
38 * @return MethodDefinition[]|PropertyDefinition[]|StaticBlock[]
39 */
40 public function getBody()
41 {
42 return $this->body;
43 }
44
45 /**
46 * Sets class methods and properties
47 *
48 * @param MethodDefinition[]|PropertyDefinition[]|StaticBlock[] $body Class methods array
49 *
50 * @return $this
51 */
52 public function setBody($body)
53 {
54 $this->assertArrayOf(
55 $body,
56 array("MethodDefinition", "PropertyDefinition", "StaticBlock")
57 );
58 $this->body = $body;
59 return $this;
60 }
61 }