XmlImportAstElseif.php
1 month ago
XmlImportAstExpression.php
1 month ago
XmlImportAstFloat.php
1 month ago
XmlImportAstForeach.php
1 month ago
XmlImportAstFunction.php
1 month ago
XmlImportAstIf.php
1 month ago
XmlImportAstInteger.php
1 month ago
XmlImportAstLiteral.php
1 month ago
XmlImportAstMath.php
1 month ago
XmlImportAstPrint.php
1 month ago
XmlImportAstSequence.php
1 month ago
XmlImportAstSpintax.php
1 month ago
XmlImportAstStatement.php
1 month ago
XmlImportAstString.php
1 month ago
XmlImportAstText.php
1 month ago
XmlImportAstWith.php
1 month ago
XmlImportAstXPath.php
1 month ago
XmlImportAstXpathClause.php
1 month ago
XmlImportAstLiteral.php
54 lines
| 1 | <?php |
| 2 | // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals |
| 3 | /** |
| 4 | * @author Olexandr Zanichkovsky <olexandr.zanichkovsky@zophiatech.com> |
| 5 | * @package AST |
| 6 | */ |
| 7 | |
| 8 | require_once dirname(__FILE__) . '/XmlImportAstExpression.php'; |
| 9 | |
| 10 | /** |
| 11 | * Represents a literal node |
| 12 | * |
| 13 | * @abstract |
| 14 | */ |
| 15 | abstract class XmlImportAstLiteral extends XmlImportAstExpression |
| 16 | { |
| 17 | /** |
| 18 | * Vsalue of a node |
| 19 | * |
| 20 | * @var mixed |
| 21 | */ |
| 22 | private $value; |
| 23 | |
| 24 | /** |
| 25 | * Creates new instance of a token |
| 26 | * |
| 27 | * @param mixed $value |
| 28 | */ |
| 29 | public function __construct($value) |
| 30 | { |
| 31 | $this->value = $value; |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Gets a value of a node |
| 36 | * |
| 37 | * @return mixed |
| 38 | */ |
| 39 | public function getValue() |
| 40 | { |
| 41 | return $this->value; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * String representation of an literal |
| 46 | * |
| 47 | * @return string |
| 48 | */ |
| 49 | public function __toString() |
| 50 | { |
| 51 | return get_class($this) . ': "' . $this->getValue() . "\""; |
| 52 | } |
| 53 | } |
| 54 |