From 768acd96fa4545349df8d4d98a3ad4465c685793 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Wed, 3 Apr 2024 09:43:09 +0200 Subject: [PATCH] Add missing Smarty getErrorUnassigned/setErrorUnassigned methods Fixes #979 --- changelog/979.md | 1 + src/Smarty.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 changelog/979.md diff --git a/changelog/979.md b/changelog/979.md new file mode 100644 index 00000000..75eb84fe --- /dev/null +++ b/changelog/979.md @@ -0,0 +1 @@ +- Fixed missing Smarty getErrorUnassigned/setErrorUnassigned methods [#979](https://github.com/smarty-php/smarty/issues/979) \ No newline at end of file diff --git a/src/Smarty.php b/src/Smarty.php index bf1d3fad..c1381ac2 100644 --- a/src/Smarty.php +++ b/src/Smarty.php @@ -2228,5 +2228,21 @@ class Smarty extends \Smarty\TemplateBase { return $template; } + /** + * Whether Smarty displays an error when using an unassigned variable + */ + public function getErrorUnassigned(): bool + { + return (bool) $this->error_unassigned; + } + + /** + * Set if Smarty should display an error on using an unassigned variable + */ + public function setErrorUnassigned(bool $error_unassigned): void + { + $this->error_unassigned = $error_unassigned; + } + }