Skip to content

Commit

Permalink
fixed more un-namespaced classes
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Mar 6, 2019
1 parent 71e8e98 commit 2717a47
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Extension/CoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/ExtensionSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function hasExtension($class)
*
* @param string $class The extension class name
*
* @return ExtensionInterface A \Twig_ExtensionInterface instance
* @return ExtensionInterface
*/
public function getExtension($class)
{
Expand Down Expand Up @@ -195,7 +195,7 @@ public function getFunctions()
*
* @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)
{
Expand Down Expand Up @@ -258,7 +258,7 @@ public function getFilters()
*
* @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)
{
Expand Down Expand Up @@ -381,7 +381,7 @@ public function getTests()
*
* @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)
{
Expand Down Expand Up @@ -475,7 +475,7 @@ private function initExtension(ExtensionInterface $extension)
// 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;
Expand Down
2 changes: 1 addition & 1 deletion src/Node/Expression/CallExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function compileCallable(Compiler $compiler)
// 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, '\\')));
Expand Down
2 changes: 1 addition & 1 deletion src/Node/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(array $nodes = [], array $attributes = [], $lineno =
{
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;
Expand Down

0 comments on commit 2717a47

Please sign in to comment.