Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of Twig. |
| 5 | * |
| 6 | * (c) Fabien Potencier |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | |
| 12 | namespace Twig\Sandbox; |
| 13 | |
| 14 | /** |
| 15 | * Exception thrown when a not allowed class method is used in a template. |
| 16 | * |
| 17 | * @author Kit Burton-Senior <mail@kitbs.com> |
| 18 | */ |
| 19 | final class SecurityNotAllowedMethodError extends SecurityError |
| 20 | { |
| 21 | private $className; |
| 22 | private $methodName; |
| 23 | |
| 24 | public function __construct(string $message, string $className, string $methodName) |
| 25 | { |
| 26 | parent::__construct($message); |
| 27 | $this->className = $className; |
| 28 | $this->methodName = $methodName; |
| 29 | } |
| 30 | |
| 31 | public function getClassName(): string |
| 32 | { |
| 33 | return $this->className; |
| 34 | } |
| 35 | |
| 36 | public function getMethodName() |
| 37 | { |
| 38 | return $this->methodName; |
| 39 | } |
| 40 | } |