Passed
Push — master ( 03e013...bd5966 )
by Anatoly
01:18 queued 14s
created

TwigFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 15
c 1
b 0
f 0
ccs 0
cts 4
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createEnvironment() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace App\Factory;
4
5
/**
6
 * Import classes
7
 */
8
use Twig\Loader\FilesystemLoader;
9
use Twig\Environment;
10
11
/**
12
 * TwigFactory
13
 *
14
 * Don't use this factory outside the container!
15
 */
16
final class TwigFactory
17
{
18
19
    /**
20
     * Creates Twig Environment instance
21
     *
22
     * @param array $params
23
     *
24
     * @return Environment
25
     */
26
    public function createEnvironment(array $params) : Environment
27
    {
28
        $loader = new FilesystemLoader($params['loader']['paths']);
29
30
        return new Environment($loader);
31
    }
32
}
33