← All changes
|
assets/lib/Mustache/Exception/UnknownTemplateException.php
+12
-3
2.0.3
→
4.0.3
View file →
| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * This file is part of Mustache.php. |
| 5 | 5 | * |
| 6 | - * (c) 2013 Justin Hileman | |
| 6 | + * (c) 2010-2017 Justin Hileman | |
| 7 | 7 | * |
| 8 | 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | 9 | * file that was distributed with this source code. |
| 10 | 10 | */ |
| @@ -15,12 +15,21 @@ | ||
| 15 | 15 | class Mustache_Exception_UnknownTemplateException extends InvalidArgumentException implements Mustache_Exception |
| 16 | 16 | { |
| 17 | 17 | protected $templateName; |
| 18 | 18 | |
| 19 | - public function __construct($templateName) | |
| 19 | + /** | |
| 20 | + * @param string $templateName | |
| 21 | + * @param Exception $previous | |
| 22 | + */ | |
| 23 | + public function __construct($templateName, Exception $previous = null) | |
| 20 | 24 | { |
| 21 | 25 | $this->templateName = $templateName; |
| 22 | - parent::__construct(sprintf('Unknown template: %s', $templateName)); | |
| 26 | + $message = sprintf('Unknown template: %s', $templateName); | |
| 27 | + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { | |
| 28 | + parent::__construct($message, 0, $previous); | |
| 29 | + } else { | |
| 30 | + parent::__construct($message); // @codeCoverageIgnore | |
| 31 | + } | |
| 23 | 32 | } |
| 24 | 33 | |
| 25 | 34 | public function getTemplateName() |
| 26 | 35 | { |