DictionaryDataCollectorSpec   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
c 1
b 0
f 0
dl 0
loc 40
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_collects_data_from_dictionaries() 0 25 1
A it_has_a_name() 0 3 1
A it_is_initializable() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace spec\Knp\DictionaryBundle\DataCollector;
6
7
use Knp\DictionaryBundle\DataCollector\DictionaryDataCollector;
8
use PhpSpec\ObjectBehavior;
9
10
final class DictionaryDataCollectorSpec extends ObjectBehavior
11
{
12
    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...
13
    {
14
        $this->shouldHaveType(DictionaryDataCollector::class);
15
    }
16
17
    function it_collects_data_from_dictionaries()
18
    {
19
        $this->addDictionary('foo', ['key1', 'key2'], ['value1', 'value2']);
0 ignored issues
show
Bug introduced by
The method addDictionary() does not exist on spec\Knp\DictionaryBundl...ionaryDataCollectorSpec. 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

19
        $this->/** @scrutinizer ignore-call */ 
20
               addDictionary('foo', ['key1', 'key2'], ['value1', 'value2']);
Loading history...
20
        $this->addDictionary('foo', ['key1', 'key2'], ['value1', 'value2']);
21
        $this->addDictionary('bar', ['keyA', 'keyB'], ['valueA', 'valueB']);
22
23
        $this->getDictionaries()->shouldIterateLike([
0 ignored issues
show
Bug introduced by
The method getDictionaries() does not exist on spec\Knp\DictionaryBundl...ionaryDataCollectorSpec. 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

23
        $this->/** @scrutinizer ignore-call */ 
24
               getDictionaries()->shouldIterateLike([
Loading history...
24
            'foo' => [
25
                [
26
                    'key'   => 'key1',
27
                    'value' => 'value1',
28
                ],
29
                [
30
                    'key'   => 'key2',
31
                    'value' => 'value2',
32
                ],
33
            ],
34
            'bar' => [
35
                [
36
                    'key'   => 'keyA',
37
                    'value' => 'valueA',
38
                ],
39
                [
40
                    'key'   => 'keyB',
41
                    'value' => 'valueB',
42
                ],
43
            ],
44
        ]);
45
    }
46
47
    function it_has_a_name()
48
    {
49
        $this->getName()->shouldReturn('dictionary');
0 ignored issues
show
Bug introduced by
The method getName() does not exist on spec\Knp\DictionaryBundl...ionaryDataCollectorSpec. 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

49
        $this->/** @scrutinizer ignore-call */ 
50
               getName()->shouldReturn('dictionary');
Loading history...
50
    }
51
}
52