Passed
Branch master (bb3df7)
by Theo
01:32
created

CalendarExtensionSpec::it_is_initializable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Tests\CalendarBundle\DependencyInjection;
4
5
use CalendarBundle\DependencyInjection\CalendarExtension;
6
use PhpSpec\ObjectBehavior;
7
use Prophecy\Argument;
8
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
11
12
class CalendarExtensionSpec extends ObjectBehavior
13
{
14
    public function it_is_initializable()
15
    {
16
        $this->shouldHaveType(CalendarExtension::class);
17
    }
18
19
    public function it_should_set_parameters_correctly(ContainerBuilder $container)
20
    {
21
        $container->fileExists(Argument::type('string'))->willReturn(true);
22
        $container->setParameter(Argument::type('string'), Argument::any())->will(function() {
0 ignored issues
show
Bug introduced by
Are you sure the usage of $container->setParameter...ophecy\Argument::any()) targeting Symfony\Component\Depend...ntainer::setParameter() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
23
            return;
24
        });
25
        $container->setDefinition(Argument::any(), Argument::any())->will(function() {
0 ignored issues
show
Bug introduced by
The method will() does not exist on Symfony\Component\DependencyInjection\Definition. ( Ignorable by Annotation )

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

25
        $container->setDefinition(Argument::any(), Argument::any())->/** @scrutinizer ignore-call */ will(function() {

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...
Bug introduced by
Prophecy\Argument::any() of type Prophecy\Argument\Token\AnyValueToken is incompatible with the type Symfony\Component\DependencyInjection\Definition expected by parameter $definition of Symfony\Component\Depend...uilder::setDefinition(). ( Ignorable by Annotation )

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

25
        $container->setDefinition(Argument::any(), /** @scrutinizer ignore-type */ Argument::any())->will(function() {
Loading history...
26
            return;
27
        });
28
29
        $configuration = [];
30
        $this->load($configuration, $container);
0 ignored issues
show
Bug introduced by
The method load() does not exist on Tests\CalendarBundle\Dep...n\CalendarExtensionSpec. 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

30
        $this->/** @scrutinizer ignore-call */ 
31
               load($configuration, $container);
Loading history...
31
    }
32
}
33