From e5be4e97ffc41ca3b0386651a626b781a3637a85 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 6 Oct 2023 18:26:22 +0200 Subject: Update for PHP 8.2 --- Mustache/Exception/InvalidArgumentException.php | 18 +++++++++++ Mustache/Exception/LogicException.php | 18 +++++++++++ Mustache/Exception/RuntimeException.php | 18 +++++++++++ Mustache/Exception/SyntaxException.php | 41 +++++++++++++++++++++++++ Mustache/Exception/UnknownFilterException.php | 38 +++++++++++++++++++++++ Mustache/Exception/UnknownHelperException.php | 38 +++++++++++++++++++++++ Mustache/Exception/UnknownTemplateException.php | 38 +++++++++++++++++++++++ 7 files changed, 209 insertions(+) create mode 100644 Mustache/Exception/InvalidArgumentException.php create mode 100644 Mustache/Exception/LogicException.php create mode 100644 Mustache/Exception/RuntimeException.php create mode 100644 Mustache/Exception/SyntaxException.php create mode 100644 Mustache/Exception/UnknownFilterException.php create mode 100644 Mustache/Exception/UnknownHelperException.php create mode 100644 Mustache/Exception/UnknownTemplateException.php (limited to 'Mustache/Exception') diff --git a/Mustache/Exception/InvalidArgumentException.php b/Mustache/Exception/InvalidArgumentException.php new file mode 100644 index 0000000..becf2ed --- /dev/null +++ b/Mustache/Exception/InvalidArgumentException.php @@ -0,0 +1,18 @@ +token = $token; + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + parent::__construct($msg, 0, $previous); + } else { + parent::__construct($msg); // @codeCoverageIgnore + } + } + + /** + * @return array + */ + public function getToken() + { + return $this->token; + } +} diff --git a/Mustache/Exception/UnknownFilterException.php b/Mustache/Exception/UnknownFilterException.php new file mode 100644 index 0000000..0651c17 --- /dev/null +++ b/Mustache/Exception/UnknownFilterException.php @@ -0,0 +1,38 @@ +filterName = $filterName; + $message = sprintf('Unknown filter: %s', $filterName); + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + parent::__construct($message, 0, $previous); + } else { + parent::__construct($message); // @codeCoverageIgnore + } + } + + public function getFilterName() + { + return $this->filterName; + } +} diff --git a/Mustache/Exception/UnknownHelperException.php b/Mustache/Exception/UnknownHelperException.php new file mode 100644 index 0000000..193be78 --- /dev/null +++ b/Mustache/Exception/UnknownHelperException.php @@ -0,0 +1,38 @@ +helperName = $helperName; + $message = sprintf('Unknown helper: %s', $helperName); + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + parent::__construct($message, 0, $previous); + } else { + parent::__construct($message); // @codeCoverageIgnore + } + } + + public function getHelperName() + { + return $this->helperName; + } +} diff --git a/Mustache/Exception/UnknownTemplateException.php b/Mustache/Exception/UnknownTemplateException.php new file mode 100644 index 0000000..32a778a --- /dev/null +++ b/Mustache/Exception/UnknownTemplateException.php @@ -0,0 +1,38 @@ +templateName = $templateName; + $message = sprintf('Unknown template: %s', $templateName); + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + parent::__construct($message, 0, $previous); + } else { + parent::__construct($message); // @codeCoverageIgnore + } + } + + public function getTemplateName() + { + return $this->templateName; + } +} -- cgit v1.2.3-55-g7522