diff options
author | Simon Rettberg | 2023-10-06 18:26:22 +0200 |
---|---|---|
committer | Simon Rettberg | 2023-10-06 18:26:22 +0200 |
commit | e5be4e97ffc41ca3b0386651a626b781a3637a85 (patch) | |
tree | 20152d35607de272edae44725efba13f21da85a1 /Mustache/Exception | |
parent | api: Hard-code bogus name/mail for read only (STUDENT) login (diff) | |
download | bwlp-webadmin-e5be4e97ffc41ca3b0386651a626b781a3637a85.tar.gz bwlp-webadmin-e5be4e97ffc41ca3b0386651a626b781a3637a85.tar.xz bwlp-webadmin-e5be4e97ffc41ca3b0386651a626b781a3637a85.zip |
Update for PHP 8.2
Diffstat (limited to 'Mustache/Exception')
-rw-r--r-- | Mustache/Exception/InvalidArgumentException.php | 18 | ||||
-rw-r--r-- | Mustache/Exception/LogicException.php | 18 | ||||
-rw-r--r-- | Mustache/Exception/RuntimeException.php | 18 | ||||
-rw-r--r-- | Mustache/Exception/SyntaxException.php | 41 | ||||
-rw-r--r-- | Mustache/Exception/UnknownFilterException.php | 38 | ||||
-rw-r--r-- | Mustache/Exception/UnknownHelperException.php | 38 | ||||
-rw-r--r-- | Mustache/Exception/UnknownTemplateException.php | 38 |
7 files changed, 209 insertions, 0 deletions
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 @@ +<?php + +/* + * This file is part of Mustache.php. + * + * (c) 2010-2017 Justin Hileman + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Invalid argument exception. + */ +class Mustache_Exception_InvalidArgumentException extends InvalidArgumentException implements Mustache_Exception +{ + // This space intentionally left blank. +} diff --git a/Mustache/Exception/LogicException.php b/Mustache/Exception/LogicException.php new file mode 100644 index 0000000..b2424d6 --- /dev/null +++ b/Mustache/Exception/LogicException.php @@ -0,0 +1,18 @@ +<?php + +/* + * This file is part of Mustache.php. + * + * (c) 2010-2017 Justin Hileman + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Logic exception. + */ +class Mustache_Exception_LogicException extends LogicException implements Mustache_Exception +{ + // This space intentionally left blank. +} diff --git a/Mustache/Exception/RuntimeException.php b/Mustache/Exception/RuntimeException.php new file mode 100644 index 0000000..b6369f4 --- /dev/null +++ b/Mustache/Exception/RuntimeException.php @@ -0,0 +1,18 @@ +<?php + +/* + * This file is part of Mustache.php. + * + * (c) 2010-2017 Justin Hileman + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Runtime exception. + */ +class Mustache_Exception_RuntimeException extends RuntimeException implements Mustache_Exception +{ + // This space intentionally left blank. +} diff --git a/Mustache/Exception/SyntaxException.php b/Mustache/Exception/SyntaxException.php new file mode 100644 index 0000000..b1879a3 --- /dev/null +++ b/Mustache/Exception/SyntaxException.php @@ -0,0 +1,41 @@ +<?php + +/* + * This file is part of Mustache.php. + * + * (c) 2010-2017 Justin Hileman + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Mustache syntax exception. + */ +class Mustache_Exception_SyntaxException extends LogicException implements Mustache_Exception +{ + protected $token; + + /** + * @param string $msg + * @param array $token + * @param Exception $previous + */ + public function __construct($msg, array $token, Exception $previous = null) + { + $this->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 @@ +<?php + +/* + * This file is part of Mustache.php. + * + * (c) 2010-2017 Justin Hileman + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Unknown filter exception. + */ +class Mustache_Exception_UnknownFilterException extends UnexpectedValueException implements Mustache_Exception +{ + protected $filterName; + + /** + * @param string $filterName + * @param Exception $previous + */ + public function __construct($filterName, Exception $previous = null) + { + $this->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 @@ +<?php + +/* + * This file is part of Mustache.php. + * + * (c) 2010-2017 Justin Hileman + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Unknown helper exception. + */ +class Mustache_Exception_UnknownHelperException extends InvalidArgumentException implements Mustache_Exception +{ + protected $helperName; + + /** + * @param string $helperName + * @param Exception $previous + */ + public function __construct($helperName, Exception $previous = null) + { + $this->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 @@ +<?php + +/* + * This file is part of Mustache.php. + * + * (c) 2010-2017 Justin Hileman + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Unknown template exception. + */ +class Mustache_Exception_UnknownTemplateException extends InvalidArgumentException implements Mustache_Exception +{ + protected $templateName; + + /** + * @param string $templateName + * @param Exception $previous + */ + public function __construct($templateName, Exception $previous = null) + { + $this->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; + } +} |