TestController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A secondAction() 0 8 1
A firstAction() 0 6 1
A thirdAction() 0 3 1
1
<?php
2
3
namespace Devmachine\Bundle\ServicesInjectorBundle\Tests\Functional;
4
5
use Devmachine\Bundle\ServicesInjectorBundle\Configuration\Service;
6
use Devmachine\Bundle\ServicesInjectorBundle\Request\Services;
7
use Symfony\Component\HttpFoundation\Response;
8
9
/**
10
 * Inject to all actions.
11
 *
12
 * @Service(twig="twig")
13
 */
14
class TestController
15
{
16
    /**
17
     * @Service("translator")
18
     *
19
     * @param Services $services
20
     *
21
     * @return Response
22
     */
23
    public function firstAction(Services $services)
24
    {
25
        $services->getTwig();
0 ignored issues
show
Bug introduced by
The method getTwig() does not exist on Devmachine\Bundle\Servic...Bundle\Request\Services. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
        $services->/** @scrutinizer ignore-call */ getTwig();
Loading history...
26
        $services->getTranslator();
0 ignored issues
show
Bug introduced by
The method getTranslator() does not exist on Devmachine\Bundle\Servic...Bundle\Request\Services. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
        $services->/** @scrutinizer ignore-call */ getTranslator();
Loading history...
27
28
        return Response::create();
29
    }
30
31
    /**
32
     * @Service({"ff"="form.factory", "url_generator"="router", "translator"})
33
     *
34
     * @param Services $services
35
     *
36
     * @return Response
37
     */
38
    public function secondAction(Services $services)
39
    {
40
        $services->get('twig');
41
        $services->get('ff');
42
        $services->getUrlGenerator();
0 ignored issues
show
Bug introduced by
The method getUrlGenerator() does not exist on Devmachine\Bundle\Servic...Bundle\Request\Services. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

42
        $services->/** @scrutinizer ignore-call */ getUrlGenerator();
Loading history...
43
        $services->getTranslator();
44
45
        return Response::create();
46
    }
47
48
    public function thirdAction(Services $services)
49
    {
50
        $services->get('translator');
51
    }
52
}
53