Passed
Pull Request — master (#149)
by Pierre
03:06
created

KnpDictionaryBundleSpec   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 3 1
A it_registers_compiler_passes() 0 23 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace spec\Knp\DictionaryBundle;
6
7
use Knp\DictionaryBundle\DependencyInjection\Compiler\DictionaryBuildingPass;
8
use Knp\DictionaryBundle\DependencyInjection\Compiler\DictionaryFactoryBuildingPass;
9
use Knp\DictionaryBundle\DependencyInjection\Compiler\DictionaryRegistrationPass;
10
use Knp\DictionaryBundle\DependencyInjection\Compiler\DictionaryTracePass;
11
use Knp\DictionaryBundle\KnpDictionaryBundle;
12
use PhpSpec\ObjectBehavior;
13
use Prophecy\Argument;
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
16
final class KnpDictionaryBundleSpec extends ObjectBehavior
17
{
18
    function it_is_initializable()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
19
    {
20
        $this->shouldHaveType(KnpDictionaryBundle::class);
21
    }
22
23
    function it_registers_compiler_passes(ContainerBuilder $container)
24
    {
25
        $container
26
            ->addCompilerPass(Argument::type(DictionaryFactoryBuildingPass::class))
0 ignored issues
show
Bug introduced by
Prophecy\Argument::type(...oryBuildingPass::class) of type Prophecy\Argument\Token\TypeToken is incompatible with the type Symfony\Component\Depend...r\CompilerPassInterface expected by parameter $pass of Symfony\Component\Depend...lder::addCompilerPass(). ( Ignorable by Annotation )

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

26
            ->addCompilerPass(/** @scrutinizer ignore-type */ Argument::type(DictionaryFactoryBuildingPass::class))
Loading history...
27
            ->shouldBeCalled()
0 ignored issues
show
Bug introduced by
The method shouldBeCalled() does not exist on Symfony\Component\Depend...ection\ContainerBuilder. ( Ignorable by Annotation )

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

27
            ->/** @scrutinizer ignore-call */ shouldBeCalled()

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
        ;
29
30
        $container
31
            ->addCompilerPass(Argument::type(DictionaryBuildingPass::class))
32
            ->shouldBeCalled()
33
        ;
34
35
        $container
36
            ->addCompilerPass(Argument::type(DictionaryRegistrationPass::class))
37
            ->shouldBeCalled()
38
        ;
39
40
        $container
41
            ->addCompilerPass(Argument::type(DictionaryTracePass::class))
42
            ->shouldBeCalled()
43
        ;
44
45
        $this->build($container);
0 ignored issues
show
Bug introduced by
The method build() does not exist on spec\Knp\DictionaryBundle\KnpDictionaryBundleSpec. 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

45
        $this->/** @scrutinizer ignore-call */ 
46
               build($container);
Loading history...
46
    }
47
}
48