Completed
Push — master ( f143c1...aed006 )
by Tobias
04:03 queued 02:03
created

TwigEnvironmentFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 5
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
1
<?php
2
3
/*
4
 * This file is part of the PHP Translation package.
5
 *
6
 * (c) PHP Translation team <[email protected]>
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\Extractor\Tests\Functional\Visitor\Twig;
13
14
use Symfony\Component\Translation\MessageSelector;
15
use Symfony\Component\Translation\IdentityTranslator;
16
use Symfony\Bridge\Twig\Extension\TranslationExtension;
17
18
class TwigEnvironmentFactory
19
{
20 4
    public static function create()
21
    {
22 4
        $env = new \Twig_Environment();
23 4
        $env->addExtension(new TranslationExtension($translator = new IdentityTranslator(new MessageSelector())));
24 4
        $env->setLoader(new \Twig_Loader_String());
0 ignored issues
show
Deprecated Code introduced by
The class Twig_Loader_String has been deprecated with message: since 1.18.1 (to be removed in 2.0)

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
25
26 4
        return $env;
27
    }
28
}
29