Debian Codegraph @

vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXExpressionContainer.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\JSX;
11
12 use Peast\Syntax\Node\Node;
13
14 /**
15 * A node that represents an expression container in JSX.
16 *
17 * @author Marco Marchiò <[email protected]>
18 */
19 class JSXExpressionContainer extends Node
20 {
21 /**
22 * Map of node properties
23 *
24 * @var array
25 */
26 protected $propertiesMap = array(
27 "expression" => true
28 );
29
30 /**
31 * The wrapped expression
32 *
33 * @var \Peast\Syntax\Node\Expression|JSXEmptyExpression
34 */
35 protected $expression;
36
37 /**
38 * Returns the wrapped expression
39 *
40 * @return \Peast\Syntax\Node\Expression|JSXEmptyExpression
41 */
42 public function getExpression()
43 {
44 return $this->expression;
45 }
46
47 /**
48 * Sets the wrapped expression
49 *
50 * @param \Peast\Syntax\Node\Expression|JSXEmptyExpression $expression Wrapped
51 * expression
52 *
53 * @return $this
54 */
55 public function setExpression($expression)
56 {
57 $this->assertType(
58 $expression,
59 array("Expression", "JSX\\JSXEmptyExpression")
60 );
61 $this->expression = $expression;
62 return $this;
63 }
64 }