diff options
Diffstat (limited to 'lib/exTpl/MinusExpression.php')
| -rw-r--r-- | lib/exTpl/MinusExpression.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/exTpl/MinusExpression.php b/lib/exTpl/MinusExpression.php new file mode 100644 index 0000000..6b81e91 --- /dev/null +++ b/lib/exTpl/MinusExpression.php @@ -0,0 +1,19 @@ +<?php + +namespace exTpl; + +/** + * MinusExpression represents the unary minus operator ('-'). + */ +class MinusExpression extends UnaryExpression +{ + /** + * Returns the value of this expression. + * + * @param Context $context symbol table + */ + public function value(Context $context): mixed + { + return -$this->expr->value($context); + } +} |
