Skip to content

Commit 389443e

Browse files
authored
Make sure we do not bind to specific twig version before the TwigVisi… (#99)
* Make sure we do not bind to specific twig version before the TwigVisitorFactory has been executed * cs
1 parent 5b5fb76 commit 389443e

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Resources/config/extractors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ services:
5353

5454
# Twig Visitors:
5555
php_translation.extractor.twig.visitor.twig:
56-
class: Translation\Extractor\Visitor\Twig\Twig2Visitor
56+
class: Translation\Bundle\Twig\DummyTwigVisitor
5757
factory: [Translation\Extractor\Visitor\Twig\TwigVisitor, create]
5858
tags:
5959
- { name: 'php_translation.visitor', type: 'twig' }

Twig/DummyTwigVisitor.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the PHP Translation package.
5+
*
6+
* (c) PHP Translation team <tobias.nyholm@gmail.com>
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 Translation\Bundle\Twig;
13+
14+
/**
15+
* This dummy extractor is used to be compatible with both Twig1 and Twig2. It is only used in dependency injection
16+
* container.
17+
*
18+
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
19+
*/
20+
class DummyTwigVisitor
21+
{
22+
}

0 commit comments

Comments
 (0)