| 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 |
use Peast\Syntax\Node\Expression; |
| 14 |
|
| 15 |
/** |
| 16 |
* A node that represents a JSX namespaced name. |
| 17 |
* |
| 18 |
* @author Marco Marchiò <[email protected]> |
| 19 |
*/ |
| 20 |
class JSXNamespacedName extends Node implements Expression |
| 21 |
{ |
| 22 |
/** |
| 23 |
* Map of node properties |
| 24 |
* |
| 25 |
* @var array |
| 26 |
*/ |
| 27 |
protected $propertiesMap = array( |
| 28 |
"namespace" => false, |
| 29 |
"name" => false |
| 30 |
); |
| 31 |
|
| 32 |
/** |
| 33 |
* Node's namespace |
| 34 |
* |
| 35 |
* @var JSXIdentifier |
| 36 |
*/ |
| 37 |
protected $namespace; |
| 38 |
|
| 39 |
/** |
| 40 |
* Node's name |
| 41 |
* |
| 42 |
* @var JSXIdentifier |
| 43 |
*/ |
| 44 |
protected $name; |
| 45 |
|
| 46 |
/** |
| 47 |
* Returns node's namespace |
| 48 |
* |
| 49 |
* @return JSXIdentifier |
| 50 |
*/ |
| 51 |
public function getNamespace() |
| 52 |
{ |
| 53 |
return $this->namespace; |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* Sets node's namespace |
| 58 |
* |
| 59 |
* @param JSXIdentifier $namespace Namespace |
| 60 |
* |
| 61 |
* @return $this |
| 62 |
*/ |
| 63 |
public function setNamespace($namespace) |
| 64 |
{ |
| 65 |
$this->namespace = $namespace; |
| 66 |
return $this; |
| 67 |
} |
| 68 |
|
| 69 |
/** |
| 70 |
* Return node's name |
| 71 |
* |
| 72 |
* @return JSXIdentifier |
| 73 |
*/ |
| 74 |
public function getName() |
| 75 |
{ |
| 76 |
return $this->name; |
| 77 |
} |
| 78 |
|
| 79 |
/** |
| 80 |
* Sets node's name |
| 81 |
* |
| 82 |
* @param JSXIdentifier $name Name |
| 83 |
* |
| 84 |
* @return $this |
| 85 |
*/ |
| 86 |
public function setName($name) |
| 87 |
{ |
| 88 |
$this->name = $name; |
| 89 |
return $this; |
| 90 |
} |
| 91 |
} |