Passed
Pull Request — master (#156)
by
unknown
06:14
created

AttributeBuilderSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A it_implements_property_builder_interface() 0 3 1
A let() 0 9 1
A it_is_initializable() 0 4 1
A it_consumes_event() 0 3 1
1
<?php
2
3
/*
4
 * This file has been created by developers from BitBag.
5
 * Feel free to contact us once you face any issues or want to start
6
 * another great project.
7
 * You can find more information about us on https://bitbag.shop and write us
8
 * an email on [email protected].
9
 */
10
11
declare(strict_types=1);
12
13
namespace spec\BitBag\SyliusElasticsearchPlugin\PropertyBuilder;
14
15
use BitBag\SyliusElasticsearchPlugin\Formatter\StringFormatterInterface;
16
use BitBag\SyliusElasticsearchPlugin\PropertyBuilder\AbstractBuilder;
17
use BitBag\SyliusElasticsearchPlugin\PropertyBuilder\AttributeBuilder;
18
use BitBag\SyliusElasticsearchPlugin\PropertyBuilder\PropertyBuilderInterface;
19
use BitBag\SyliusElasticsearchPlugin\PropertyNameResolver\ConcatedNameResolverInterface;
20
use FOS\ElasticaBundle\Event\TransformEvent;
21
use PhpSpec\ObjectBehavior;
22
use Sylius\Component\Locale\Context\LocaleContextInterface;
23
24
final class AttributeBuilderSpec extends ObjectBehavior
25
{
26
    function let(
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...
27
        ConcatedNameResolverInterface $attributeNameResolver,
28
        StringFormatterInterface $stringFormatter,
29
        LocaleContextInterface $localeContext
30
    ): void {
31
        $this->beConstructedWith(
32
            $attributeNameResolver,
33
            $stringFormatter,
34
            $localeContext
35
        );
36
    }
37
38
    function it_is_initializable(): void
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...
39
    {
40
        $this->shouldHaveType(AttributeBuilder::class);
41
        $this->shouldHaveType(AbstractBuilder::class);
42
    }
43
44
    function it_implements_property_builder_interface(): void
45
    {
46
        $this->shouldHaveType(PropertyBuilderInterface::class);
47
    }
48
49
    function it_consumes_event(TransformEvent $event): void
50
    {
51
        $this->consumeEvent($event);
0 ignored issues
show
Bug introduced by
The method consumeEvent() does not exist on spec\BitBag\SyliusElasti...er\AttributeBuilderSpec. 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

51
        $this->/** @scrutinizer ignore-call */ 
52
               consumeEvent($event);
Loading history...
52
    }
53
}
54