mirror of
https://github.com/twigphp/Twig.git
synced 2026-11-11 04:36:47 +00:00
Merge branch '1.x' into 2.x
* 1.x: removed -2 magic number tried to avoid guessing template info on errors
This commit is contained in:
+2
-2
@@ -61,7 +61,7 @@ class Error extends \Exception
|
||||
* @param Source|string|null $source The source context where the error occurred
|
||||
* @param \Exception $previous The previous exception
|
||||
*/
|
||||
public function __construct($message, $lineno = -1, $source = null, \Exception $previous = null)
|
||||
public function __construct($message, $lineno = -1, $source = null, \Exception $previous = null, $autoGuess = true)
|
||||
{
|
||||
parent::__construct('', 0, $previous);
|
||||
|
||||
@@ -79,7 +79,7 @@ class Error extends \Exception
|
||||
$this->lineno = $lineno;
|
||||
$this->name = $name;
|
||||
|
||||
if (-1 === $lineno || null === $name || null === $this->sourcePath) {
|
||||
if ($autoGuess && (-1 === $lineno || null === $name || null === $this->sourcePath)) {
|
||||
$this->guessTemplateInfo();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user