| 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 meta property. |
| 14 |
* For example: new.target |
| 15 |
* |
| 16 |
* @author Marco Marchiò <[email protected]> |
| 17 |
*/ |
| 18 |
class MetaProperty extends Node implements Expression |
| 19 |
{ |
| 20 |
/** |
| 21 |
* Map of node properties |
| 22 |
* |
| 23 |
* @var array |
| 24 |
*/ |
| 25 |
protected $propertiesMap = array( |
| 26 |
"meta" => false, |
| 27 |
"property" => false |
| 28 |
); |
| 29 |
|
| 30 |
/** |
| 31 |
* Subject |
| 32 |
* |
| 33 |
* @var string |
| 34 |
*/ |
| 35 |
protected $meta; |
| 36 |
|
| 37 |
/** |
| 38 |
* Property |
| 39 |
* |
| 40 |
* @var string |
| 41 |
*/ |
| 42 |
protected $property; |
| 43 |
|
| 44 |
/** |
| 45 |
* Returns the subject |
| 46 |
* |
| 47 |
* @return string |
| 48 |
*/ |
| 49 |
public function getMeta() |
| 50 |
{ |
| 51 |
return $this->meta; |
| 52 |
} |
| 53 |
|
| 54 |
/** |
| 55 |
* Sets the subject |
| 56 |
* |
| 57 |
* @param string $meta Subject |
| 58 |
* |
| 59 |
* @return $this |
| 60 |
*/ |
| 61 |
public function setMeta($meta) |
| 62 |
{ |
| 63 |
$this->meta = $meta; |
| 64 |
return $this; |
| 65 |
} |
| 66 |
|
| 67 |
/** |
| 68 |
* Returns the property |
| 69 |
* |
| 70 |
* @return string |
| 71 |
*/ |
| 72 |
public function getProperty() |
| 73 |
{ |
| 74 |
return $this->property; |
| 75 |
} |
| 76 |
|
| 77 |
/** |
| 78 |
* Sets the property |
| 79 |
* |
| 80 |
* @param string $property Property |
| 81 |
* |
| 82 |
* @return $this |
| 83 |
*/ |
| 84 |
public function setProperty($property) |
| 85 |
{ |
| 86 |
$this->property = $property; |
| 87 |
return $this; |
| 88 |
} |
| 89 |
} |