minor #2295 Cleanups (nicolas-grekas)

This PR was merged into the 2.x branch.

Discussion
----------

Cleanups

Minor cleanup (getTemplateName is deprecated in 1.x)

Commits
-------

b8dabf6 Cleanups
This commit is contained in:
Fabien Potencier
2016-12-13 15:09:35 +01:00
2 changed files with 3 additions and 14 deletions
-11
View File
@@ -36,7 +36,6 @@ class Twig_Error extends Exception
private $lineno;
private $name;
private $rawMessage;
private $sourcePath;
private $sourceCode;
@@ -94,16 +93,6 @@ class Twig_Error extends Exception
return $this->rawMessage;
}
/**
* Gets the logical name where the error occurred.
*
* @return string The name
*/
public function getTemplateName()
{
return $this->name;
}
/**
* Gets the template line where the error occurred.
*
+3 -3
View File
@@ -634,7 +634,7 @@ class Twig_ExpressionParser
$message .= sprintf('. Use "%s" instead', $test->getAlternative());
}
$src = $stream->getSourceContext();
$message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $stream->getCurrent()->getLine());
$message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $stream->getCurrent()->getLine());
@trigger_error($message, E_USER_DEPRECATED);
}
@@ -660,7 +660,7 @@ class Twig_ExpressionParser
$message .= sprintf('. Use "%s" instead', $function->getAlternative());
}
$src = $this->parser->getStream()->getSourceContext();
$message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $line);
$message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $line);
@trigger_error($message, E_USER_DEPRECATED);
}
@@ -686,7 +686,7 @@ class Twig_ExpressionParser
$message .= sprintf('. Use "%s" instead', $filter->getAlternative());
}
$src = $this->parser->getStream()->getSourceContext();
$message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $line);
$message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $line);
@trigger_error($message, E_USER_DEPRECATED);
}