aboutsummaryrefslogtreecommitdiff
path: root/lib/exTpl/NotExpression.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/exTpl/NotExpression.php')
-rw-r--r--lib/exTpl/NotExpression.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/exTpl/NotExpression.php b/lib/exTpl/NotExpression.php
new file mode 100644
index 0000000..cf7472d
--- /dev/null
+++ b/lib/exTpl/NotExpression.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace exTpl;
+
+/**
+ * NotExpression represents the logical negation operator ('!').
+ */
+class NotExpression extends UnaryExpression
+{
+ /**
+ * Returns the value of this expression.
+ *
+ * @param Context $context symbol table
+ */
+ public function value(Context $context): bool
+ {
+ return !$this->expr->value($context);
+ }
+}