its_load_should_use_bundle_to_build_container()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 9
rs 9.6666
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 5
1
<?php
2
3
namespace spec\Knp\RadBundle\AppBundle;
4
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
8
class ContainerExtensionSpec extends ObjectBehavior
9
{
10
    /**
11
     * @param Knp\RadBundle\AppBundle\ConfigurableBundleInterface    $bundle
12
     * @param Knp\RadBundle\AppBundle\ConfigurationFactory           $configFactory
13
     * @param Knp\RadBundle\AppBundle\Configuration                  $config
0 ignored issues
show
Documentation introduced by
There is no parameter named $config. Did you maybe mean $configFactory?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
14
     * @param Symfony\Component\Config\Definition\Processor          $configProcessor
15
     * @param Symfony\Component\DependencyInjection\ContainerBuilder $container
16
     */
17
    function let($bundle, $configFactory, $configProcessor, $container)
18
    {
19
        $this->beConstructedWith($bundle, $configFactory, $configProcessor);
20
    
21
        $bundle->getPath()->willReturn('/path/to/the/src/App');
22
23
        $container->getParameter('kernel.environment')->willReturn('some_env');
24
    }
25
26
    function its_getConfiguration_should_return_rad_configuration($container, $bundle, $configFactory, $config)
0 ignored issues
show
Coding Style introduced by
Method name "ContainerExtensionSpec::its_getConfiguration_should_return_rad_configuration" is not in camel caps format
Loading history...
27
    {
28
        $configFactory->createConfiguration($bundle, array('some', 'options'), $container)->willReturn($config);
29
30
        $this->getConfiguration(array('some', 'options'), $container)->shouldReturn($config);
31
    }
32
33
    function its_load_should_use_bundle_to_build_container($container, $bundle, $configFactory, $config, $configProcessor)
0 ignored issues
show
Coding Style introduced by
Method name "ContainerExtensionSpec::its_load_should_use_bundle_to_build_container" is not in camel caps format
Loading history...
34
    {
35
        $configFactory->createConfiguration(Argument::cetera())->willReturn($config);
36
        $configProcessor->processConfiguration(Argument::cetera())->willReturn(array('processed', 'options'));
37
38
        $bundle->buildContainer(array('processed', 'options'), $container)->shouldBeCalled();
39
40
        $this->load(array('not', 'processed', 'options'), $container);
41
    }
42
43
}
44