diff options
Diffstat (limited to 'src/NXP/Classes/Token.php')
-rw-r--r-- | src/NXP/Classes/Token.php | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/NXP/Classes/Token.php b/src/NXP/Classes/Token.php index 924771e..b2a0a64 100644 --- a/src/NXP/Classes/Token.php +++ b/src/NXP/Classes/Token.php @@ -4,31 +4,34 @@ namespace NXP\Classes; class Token { - public const Literal = "literal"; - public const Variable = "variable"; - public const Operator = "operator"; - public const LeftParenthesis = "LP"; - public const RightParenthesis = "RP"; - public const Function = "function"; - public const ParamSeparator = "separator"; - public const String = "string"; - public const Space = "space"; - - /** @var self::* */ - public $type = self::Literal; - - /** @var float|string */ + public const Literal = 'literal'; + + public const Variable = 'variable'; + + public const Operator = 'operator'; + + public const LeftParenthesis = 'LP'; + + public const RightParenthesis = 'RP'; + + public const Function = 'function'; + + public const ParamSeparator = 'separator'; + + public const String = 'string'; + + public const Space = 'space'; + + public string $type = self::Literal; + public $value; - /** @var string */ - public $name; + public ?string $name; /** * Token constructor. - * @param self::* $type - * @param float|string $value */ - public function __construct(string $type, $value, string $name = null) + public function __construct(string $type, $value, ?string $name = null) { $this->type = $type; $this->value = $value; |