| @@ 15-50 (lines=36) @@ | ||
| 12 | /** |
|
| 13 | * Class BooleanValue |
|
| 14 | */ |
|
| 15 | class BooleanValue extends AbstractValue |
|
| 16 | { |
|
| 17 | /** |
|
| 18 | * ConstantValue constructor. |
|
| 19 | * @param bool $value |
|
| 20 | * @param int $offset |
|
| 21 | */ |
|
| 22 | public function __construct(bool $value, int $offset = 0) |
|
| 23 | { |
|
| 24 | parent::__construct($value, $offset); |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * @return string |
|
| 29 | */ |
|
| 30 | public function toString(): string |
|
| 31 | { |
|
| 32 | return $this->getValue() ? 'true' : 'false'; |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @return bool |
|
| 37 | */ |
|
| 38 | public function getValue(): bool |
|
| 39 | { |
|
| 40 | return parent::getValue(); |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * @return string |
|
| 45 | */ |
|
| 46 | public function __toString(): string |
|
| 47 | { |
|
| 48 | return '(bool)' . parent::__toString(); |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||
| @@ 15-50 (lines=36) @@ | ||
| 12 | /** |
|
| 13 | * Class ConstantValue |
|
| 14 | */ |
|
| 15 | class ConstantValue extends AbstractValue |
|
| 16 | { |
|
| 17 | /** |
|
| 18 | * ConstantValue constructor. |
|
| 19 | * @param string $value |
|
| 20 | * @param int $offset |
|
| 21 | */ |
|
| 22 | public function __construct(string $value, int $offset = 0) |
|
| 23 | { |
|
| 24 | parent::__construct($value, $offset); |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * @return string |
|
| 29 | */ |
|
| 30 | public function toString(): string |
|
| 31 | { |
|
| 32 | return $this->getValue(); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @return string |
|
| 37 | */ |
|
| 38 | public function getValue(): string |
|
| 39 | { |
|
| 40 | return parent::getValue(); |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * @return string |
|
| 45 | */ |
|
| 46 | public function __toString(): string |
|
| 47 | { |
|
| 48 | return '(const)' . parent::__toString(); |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||
| @@ 15-50 (lines=36) @@ | ||
| 12 | /** |
|
| 13 | * Class IntValue |
|
| 14 | */ |
|
| 15 | class IntValue extends AbstractValue |
|
| 16 | { |
|
| 17 | /** |
|
| 18 | * FloatValue constructor. |
|
| 19 | * @param int $value |
|
| 20 | * @param int $offset |
|
| 21 | */ |
|
| 22 | public function __construct(int $value, int $offset = 0) |
|
| 23 | { |
|
| 24 | parent::__construct($value, $offset); |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * @return string |
|
| 29 | */ |
|
| 30 | public function toString(): string |
|
| 31 | { |
|
| 32 | return (string)$this->getValue(); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @return int |
|
| 37 | */ |
|
| 38 | public function getValue(): int |
|
| 39 | { |
|
| 40 | return parent::getValue(); |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * @return string |
|
| 45 | */ |
|
| 46 | public function __toString(): string |
|
| 47 | { |
|
| 48 | return '(int)' . parent::__toString(); |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||