[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/vendor/twig/twig/src/TokenParser/ -> DeprecatedTokenParser.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of Twig.
   5   *
   6   * (c) Fabien Potencier
   7   *
   8   * For the full copyright and license information, please view the LICENSE
   9   * file that was distributed with this source code.
  10   */
  11  
  12  namespace Twig\TokenParser;
  13  
  14  use Twig\Node\DeprecatedNode;
  15  use Twig\Token;
  16  
  17  /**
  18   * Deprecates a section of a template.
  19   *
  20   *    {% deprecated 'The "base.twig" template is deprecated, use "layout.twig" instead.' %}
  21   *    {% extends 'layout.html.twig' %}
  22   *
  23   * @author Yonel Ceruto <yonelceruto@gmail.com>
  24   *
  25   * @final
  26   */
  27  class DeprecatedTokenParser extends AbstractTokenParser
  28  {
  29      public function parse(Token $token)
  30      {
  31          $expr = $this->parser->getExpressionParser()->parseExpression();
  32  
  33          $this->parser->getStream()->expect(Token::BLOCK_END_TYPE);
  34  
  35          return new DeprecatedNode($expr, $token->getLine(), $this->getTag());
  36      }
  37  
  38      public function getTag()
  39      {
  40          return 'deprecated';
  41      }
  42  }
  43  
  44  class_alias('Twig\TokenParser\DeprecatedTokenParser', 'Twig_TokenParser_Deprecated');


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1