fixed more un-namespaced classes

This commit is contained in:
Fabien Potencier
2019-03-06 18:17:28 +01:00
parent 71e8e981c4
commit 2717a4769b
4 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -1499,7 +1499,7 @@ function twig_array_batch($items, $size, $fill = null)
* @param mixed $object The object or array from where to get the item
* @param mixed $item The item to get from the array or object
* @param array $arguments An array of arguments to pass if the item is an object method
* @param string $type The type of attribute (@see \Twig_Template constants)
* @param string $type The type of attribute (@see \Twig\Template constants)
* @param bool $isDefinedTest Whether this is only a defined check
* @param bool $ignoreStrictCheck Whether to ignore the strict attribute check or not
*
@@ -1581,7 +1581,7 @@ function twig_get_attribute(Environment $env, Source $source, $object, $item, ar
}
if ($object instanceof Template) {
throw new RuntimeError('Accessing \Twig_Template attributes is forbidden.');
throw new RuntimeError('Accessing \Twig\Template attributes is forbidden.');
}
// object property
+5 -5
View File
@@ -90,7 +90,7 @@ final class ExtensionSet
*
* @param string $class The extension class name
*
* @return ExtensionInterface A \Twig_ExtensionInterface instance
* @return ExtensionInterface
*/
public function getExtension($class)
{
@@ -195,7 +195,7 @@ final class ExtensionSet
*
* @param string $name function name
*
* @return TwigFunction|false A \Twig_Function instance or false if the function does not exist
* @return TwigFunction|false
*/
public function getFunction($name)
{
@@ -258,7 +258,7 @@ final class ExtensionSet
*
* @param string $name The filter name
*
* @return TwigFilter|false A \Twig_Filter instance or false if the filter does not exist
* @return TwigFilter|false
*/
public function getFilter($name)
{
@@ -381,7 +381,7 @@ final class ExtensionSet
*
* @param string $name The test name
*
* @return TwigTest|false A \Twig_Test instance or false if the test does not exist
* @return TwigTest|false
*/
public function getTest($name)
{
@@ -475,7 +475,7 @@ final class ExtensionSet
// token parsers
foreach ($extension->getTokenParsers() as $parser) {
if (!$parser instanceof TokenParserInterface) {
throw new \LogicException('getTokenParsers() must return an array of \Twig_TokenParserInterface.');
throw new \LogicException('getTokenParsers() must return an array of \Twig\TokenParser\TokenParserInterface.');
}
$this->parsers[] = $parser;
+1 -1
View File
@@ -40,7 +40,7 @@ abstract class CallExpression extends AbstractExpression
// For BC/FC with namespaced aliases
$class = (new \ReflectionClass(\get_class($callable[0])))->name;
if (!$compiler->getEnvironment()->hasExtension($class)) {
// Compile a non-optimized call to trigger a \Twig_Error_Runtime, which cannot be a compile-time error
// Compile a non-optimized call to trigger a \Twig\Error\RuntimeError, which cannot be a compile-time error
$compiler->raw(sprintf('$this->env->getExtension(\'%s\')', $class));
} else {
$compiler->raw(sprintf('$this->extensions[\'%s\']', ltrim($class, '\\')));
+1 -1
View File
@@ -43,7 +43,7 @@ class Node implements \Countable, \IteratorAggregate
{
foreach ($nodes as $name => $node) {
if (!$node instanceof self) {
throw new \InvalidArgumentException(sprintf('Using "%s" for the value of node "%s" of "%s" is not supported. You must pass a \Twig_Node instance.', \is_object($node) ? \get_class($node) : null === $node ? 'null' : \gettype($node), $name, \get_class($this)));
throw new \InvalidArgumentException(sprintf('Using "%s" for the value of node "%s" of "%s" is not supported. You must pass a \Twig\Node\Node instance.', \is_object($node) ? \get_class($node) : null === $node ? 'null' : \gettype($node), $name, \get_class($this)));
}
}
$this->nodes = $nodes;