Files
smarty/libs/sysplugins/smartycompilerexception.php
Jonathan Lelievre bf87aee3f0 Add PHP 8.4 support to Smarty (#1084)
* Add nullable types

* Removing deprecated E_STRICT constant from test suite.

* Added PHP 8.4 RC1 as test image

* PHP version bump in the README.md.

* Added PHP 8.4 to CI

* Add running tests for PHP 8.4
2024-11-21 23:04:22 +01:00

74 lines
1.7 KiB
PHP

<?php
/**
* Smarty compiler exception class
*
* @package Smarty
*/
class SmartyCompilerException extends SmartyException
{
/**
* The constructor of the exception
*
* @param string $message The Exception message to throw.
* @param int $code The Exception code.
* @param string|null $filename The filename where the exception is thrown.
* @param int|null $line The line number where the exception is thrown.
* @param Throwable|null $previous The previous exception used for the exception chaining.
*/
public function __construct(
string $message = "",
int $code = 0,
?string $filename = null,
?int $line = null,
?Throwable $previous = null
) {
parent::__construct($message, $code, $previous);
// These are optional parameters, should be be overridden only when present!
if ($filename) {
$this->file = $filename;
}
if ($line) {
$this->line = $line;
}
}
/**
* @return string
*/
public function __toString()
{
return ' --> Smarty Compiler: ' . $this->message . ' <-- ';
}
/**
* @param int $line
*/
public function setLine($line)
{
$this->line = $line;
}
/**
* The template source snippet relating to the error
*
* @type string|null
*/
public $source = null;
/**
* The raw text of the error message
*
* @type string|null
*/
public $desc = null;
/**
* The resource identifier or template name
*
* @type string|null
*/
public $template = null;
}