Debian Codegraph @

vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXBoundaryElement.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 base class for boundary elements.
16 *
17 * @author Marco Marchiò <[email protected]>
18 *
19 * @abstract
20 */
21 abstract class JSXBoundaryElement extends Node
22 {
23 /**
24 * Map of node properties
25 *
26 * @var array
27 */
28 protected $propertiesMap = array(
29 "name" => true
30 );
31
32 /**
33 * Element name
34 *
35 * @var JSXIdentifier|JSXMemberExpression|JSXNamespacedName
36 */
37 protected $name;
38
39 /**
40 * Returns the element name
41 *
42 * @return JSXIdentifier|JSXMemberExpression|JSXNamespacedName
43 */
44 public function getName()
45 {
46 return $this->name;
47 }
48
49 /**
50 * Sets the element name
51 *
52 * @param JSXIdentifier|JSXMemberExpression|JSXNamespacedName $name Element
53 * name
54 *
55 * @return $this
56 */
57 public function setName($name)
58 {
59 $this->assertType(
60 $name,
61 array("JSX\\JSXIdentifier", "JSX\\JSXMemberExpression", "JSX\\JSXNamespacedName")
62 );
63 $this->name = $name;
64 return $this;
65 }
66 }