aboutsummaryrefslogtreecommitdiff
path: root/lib/exTpl/NotExpression.php
diff options
context:
space:
mode:
authorDavid Siegfried <david.siegfried@uni-vechta.de>2024-05-08 07:38:22 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-05-08 07:38:22 +0000
commit15c29abc3dc12e40c40a9331f6b9478386d2bf7d (patch)
tree66f3723eb6ca406119e1112f2fefade6bf338a53 /lib/exTpl/NotExpression.php
parent2c4c41a7733923cbd0f9f93eb7c90ad412efda1f (diff)
move exTpl to lib, re #4119
Merge request studip/studip!2963
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);
+ }
+}