Completed
Pull Request — master (#14)
by Tobias
20:59 queued 19:01
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
namespace Translation\Extractor\Tests\Functional\Visitor\Twig;
4
5
use Symfony\Component\Translation\MessageSelector;
6
use Symfony\Component\Translation\IdentityTranslator;
7
use Symfony\Bridge\Twig\Extension\TranslationExtension;
8
9
class TwigEnvironmentFactory
10
{
11 4
    public static function create()
12
    {
13 4
        $env = new \Twig_Environment();
14 4
        $env->addExtension(new TranslationExtension($translator = new IdentityTranslator(new MessageSelector())));
15 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...
16
17 4
        return $env;
18
    }
19
}
20