|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace SymfonyCodeBlockChecker\Twig; |
| 4 | + |
| 5 | +use Twig\Extension\AbstractExtension; |
| 6 | +use Twig\TwigFilter; |
| 7 | +use Twig\TwigFunction; |
| 8 | + |
| 9 | +/** |
| 10 | + * This extension will contain filters and functions that exists in Symfony. This |
| 11 | + * will help the parser to verify the correctness. |
| 12 | + * |
| 13 | + * @author Tobias Nyholm <tobias.nyholm@gmail.com> |
| 14 | + */ |
| 15 | +class DummyExtension extends AbstractExtension |
| 16 | +{ |
| 17 | + public function getFunctions() |
| 18 | + { |
| 19 | + return [ |
| 20 | + new TwigFunction('asset'), |
| 21 | + new TwigFunction('asset_version'), |
| 22 | + new TwigFunction('csrf_token'), |
| 23 | + new TwigFunction('dump'), |
| 24 | + new TwigFunction('expression'), |
| 25 | + new TwigFunction('form_widget'), |
| 26 | + new TwigFunction('form_errors'), |
| 27 | + new TwigFunction('form_label'), |
| 28 | + new TwigFunction('form_help'), |
| 29 | + new TwigFunction('form_row'), |
| 30 | + new TwigFunction('form_rest'), |
| 31 | + new TwigFunction('form'), |
| 32 | + new TwigFunction('form_start'), |
| 33 | + new TwigFunction('form_end'), |
| 34 | + new TwigFunction('csrf_token'), |
| 35 | + new TwigFunction('form_parent'), |
| 36 | + new TwigFunction('absolute_url'), |
| 37 | + new TwigFunction('relative_path'), |
| 38 | + new TwigFunction('render'), |
| 39 | + new TwigFunction('render_*'), |
| 40 | + new TwigFunction('controller'), |
| 41 | + new TwigFunction('logout_url'), |
| 42 | + new TwigFunction('logout_path'), |
| 43 | + new TwigFunction('url'), |
| 44 | + new TwigFunction('path'), |
| 45 | + new TwigFunction('is_granted'), |
| 46 | + new TwigFunction('link'), |
| 47 | + new TwigFunction('preload'), |
| 48 | + new TwigFunction('dns_prefetch'), |
| 49 | + new TwigFunction('preconnect'), |
| 50 | + new TwigFunction('prefetch'), |
| 51 | + new TwigFunction('prerender'), |
| 52 | + new TwigFunction('workflow_can'), |
| 53 | + new TwigFunction('workflow_transitions'), |
| 54 | + new TwigFunction('workflow_has_marked_place'), |
| 55 | + new TwigFunction('workflow_marked_places'), |
| 56 | + new TwigFunction('workflow_metadata'), |
| 57 | + new TwigFunction('workflow_transition_blockers'), |
| 58 | + ]; |
| 59 | + } |
| 60 | + |
| 61 | + public function getFilters() |
| 62 | + { |
| 63 | + return [ |
| 64 | + new TwigFilter('abbr_class'), |
| 65 | + new TwigFilter('abbr_method'), |
| 66 | + new TwigFilter('format_args'), |
| 67 | + new TwigFilter('format_args_as_text'), |
| 68 | + new TwigFilter('file_excerpt'), |
| 69 | + new TwigFilter('format_file'), |
| 70 | + new TwigFilter('format_file_from_text'), |
| 71 | + new TwigFilter('format_log_message'), |
| 72 | + new TwigFilter('file_link'), |
| 73 | + new TwigFilter('file_relative'), |
| 74 | + new TwigFilter('humanize'), |
| 75 | + new TwigFilter('form_encode_currency'), |
| 76 | + new TwigFilter('yaml_encode'), |
| 77 | + new TwigFilter('yaml_dump'), |
| 78 | + new TwigFilter('trans'), |
| 79 | + new TwigFilter('transchoice'), |
| 80 | + ]; |
| 81 | + } |
| 82 | +} |
0 commit comments