Completed
Pull Request — master (#9)
by Tomáš
06:36
created

SculpinTwigExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 38
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A loadConfiguration() 0 7 1
A getConfiguration() 0 4 1
1
<?php
2
3
/*
4
 * This file is a part of Sculpin.
5
 *
6
 * (c) Dragonfly Development Inc.
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 Symplify\PHP7_Sculpin\Bundle\TwigBundle\DI;
13
14
use Nette\DI\Compiler;
15
use Nette\DI\CompilerExtension;
16
use Symplify\PHP7_Sculpin\Bundle\TwigBundle\DependencyInjection\Configuration;
17
use Symfony\Component\Config\Definition\ConfigurationInterface;
18
19
final class SculpinTwigExtension extends CompilerExtension
20
{
21
    //    /**
0 ignored issues
show
Unused Code Comprehensibility introduced by
46% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
22
//     * {@inheritdoc}
23
//     */
24
//    public function build(ContainerBuilder $container)
25
//    {
26
//        $container->addCompilerPass(new TwigEnvironmentPass());
27
//        $container->addCompilerPass(new TwigLoaderPass());
28
//    }
29
30
    public function loadConfiguration()
31
    {
32
        Compiler::loadDefinitions(
33
            $this->getContainerBuilder(),
34
            $this->loadFromFile(__DIR__.'/../Resources/config/services.yml')
0 ignored issues
show
Bug introduced by
It seems like $this->loadFromFile(__DI...s/config/services.yml') targeting Nette\DI\CompilerExtension::loadFromFile() can also be of type string; however, Nette\DI\Compiler::loadDefinitions() does only seem to accept array, maybe add an additional type check?

This check looks at variables that are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
35
        );
36
    }
37
38
//    protected function getServicesFile() : string
0 ignored issues
show
Unused Code Comprehensibility introduced by
47% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
39
//    {
40
//        return __DIR__.'/Resources/config/services.yml';
41
//    }
42
43
    protected function getConfiguration() : ConfigurationInterface
44
    {
45
        return new Configuration();
46
    }
47
48
//    protected function getParametersAliases() : array
0 ignored issues
show
Unused Code Comprehensibility introduced by
48% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
49
//    {
50
//        return [
51
//            'source_view_paths' => 'sculpin_twig.source_view_paths',
52
//            'view_paths' => 'sculpin_twig.view_paths',
53
//            'extensions' => 'sculpin_twig.extensions',
54
//        ];
55
//    }
56
}
57