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:
Fabien Potencier
2019-03-11 16:18:55 +01:00
6 changed files with 12 additions and 16 deletions
+2 -2
View File
@@ -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();
}