Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame^] | 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\Extension; |
| 13 | |
| 14 | use Twig\NodeVisitor\NodeVisitorInterface; |
| 15 | use Twig\TokenParser\TokenParserInterface; |
| 16 | use Twig\TwigFilter; |
| 17 | use Twig\TwigFunction; |
| 18 | use Twig\TwigTest; |
| 19 | |
| 20 | /** |
| 21 | * Interface implemented by extension classes. |
| 22 | * |
| 23 | * @author Fabien Potencier <fabien@symfony.com> |
| 24 | */ |
| 25 | interface ExtensionInterface |
| 26 | { |
| 27 | /** |
| 28 | * Returns the token parser instances to add to the existing list. |
| 29 | * |
| 30 | * @return TokenParserInterface[] |
| 31 | */ |
| 32 | public function getTokenParsers(); |
| 33 | |
| 34 | /** |
| 35 | * Returns the node visitor instances to add to the existing list. |
| 36 | * |
| 37 | * @return NodeVisitorInterface[] |
| 38 | */ |
| 39 | public function getNodeVisitors(); |
| 40 | |
| 41 | /** |
| 42 | * Returns a list of filters to add to the existing list. |
| 43 | * |
| 44 | * @return TwigFilter[] |
| 45 | */ |
| 46 | public function getFilters(); |
| 47 | |
| 48 | /** |
| 49 | * Returns a list of tests to add to the existing list. |
| 50 | * |
| 51 | * @return TwigTest[] |
| 52 | */ |
| 53 | public function getTests(); |
| 54 | |
| 55 | /** |
| 56 | * Returns a list of functions to add to the existing list. |
| 57 | * |
| 58 | * @return TwigFunction[] |
| 59 | */ |
| 60 | public function getFunctions(); |
| 61 | |
| 62 | /** |
| 63 | * Returns a list of operators to add to the existing list. |
| 64 | * |
| 65 | * @return array<array> First array of unary operators, second array of binary operators |
| 66 | */ |
| 67 | public function getOperators(); |
| 68 | } |