Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

BaseNodeVisitor.php

Zuletzt modifiziert: 09.10.2024, 12:57 - Dateigröße: 1.75 KiB


01  <?php
02   
03  /*
04   * This file is part of Twig.
05   *
06   * (c) Fabien Potencier
07   *
08   * For the full copyright and license information, please view the LICENSE
09   * file that was distributed with this source code.
10   */
11   
12  /**
13   * Twig_BaseNodeVisitor can be used to make node visitors compatible with Twig 1.x and 2.x.
14   *
15   * @author Fabien Potencier <fabien@symfony.com>
16   */
17  abstract class Twig_BaseNodeVisitor implements Twig_NodeVisitorInterface
18  {
19      /**
20       * {@inheritdoc}
21       */
22      final public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)
23      {
24          if (!$node instanceof Twig_Node) {
25              throw new LogicException('Twig_BaseNodeVisitor only supports Twig_Node instances.');
26          }
27   
28          return $this->doEnterNode($node, $env);
29      }
30   
31      /**
32       * {@inheritdoc}
33       */
34      final public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
35      {
36          if (!$node instanceof Twig_Node) {
37              throw new LogicException('Twig_BaseNodeVisitor only supports Twig_Node instances.');
38          }
39   
40          return $this->doLeaveNode($node, $env);
41      }
42   
43      /**
44       * Called before child nodes are visited.
45       *
46       * @param Twig_Node        $node The node to visit
47       * @param Twig_Environment $env  The Twig environment instance
48       *
49       * @return Twig_Node The modified node
50       */
51      abstract protected function doEnterNode(Twig_Node $node, Twig_Environment $env);
52   
53      /**
54       * Called after child nodes are visited.
55       *
56       * @param Twig_Node        $node The node to visit
57       * @param Twig_Environment $env  The Twig environment instance
58       *
59       * @return Twig_Node|false The modified node or false if the node must be removed
60       */
61      abstract protected function doLeaveNode(Twig_Node $node, Twig_Environment $env);
62  }
63