GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

VendorSpec::it_is_initializable()   A
last analyzed

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
declare(strict_types=1);
4
5
namespace spec\Odiseo\SyliusVendorPlugin\Entity;
6
7
use Odiseo\SyliusVendorPlugin\Entity\Vendor;
8
use Odiseo\SyliusVendorPlugin\Entity\VendorInterface;
9
use PhpSpec\ObjectBehavior;
10
use Sylius\Component\Core\Model\ChannelInterface;
11
use Sylius\Component\Core\Model\ProductInterface;
12
use Sylius\Component\Resource\Model\ResourceInterface;
13
use Sylius\Component\Resource\Model\SlugAwareInterface;
14
use Sylius\Component\Resource\Model\TimestampableInterface;
15
use Sylius\Component\Resource\Model\ToggleableInterface;
16
use Sylius\Component\Resource\Model\TranslatableInterface;
17
use Symfony\Component\HttpFoundation\File\File;
18
19
final class VendorSpec extends ObjectBehavior
20
{
21
    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...
22
    {
23
        $this->shouldHaveType(Vendor::class);
24
    }
25
26
    function it_implements_vendor_interface(): void
27
    {
28
        $this->shouldImplement(VendorInterface::class);
29
    }
30
31
    function it_implements_translatable_interface(): void
32
    {
33
        $this->shouldImplement(TranslatableInterface::class);
34
    }
35
36
    function it_implements_toggleable_interface(): void
37
    {
38
        $this->shouldImplement(ToggleableInterface::class);
39
    }
40
41
    function it_implements_resource_interface(): void
42
    {
43
        $this->shouldImplement(ResourceInterface::class);
44
    }
45
46
    function it_implements_slug_aware_interface(): void
47
    {
48
        $this->shouldImplement(SlugAwareInterface::class);
49
    }
50
51
    function it_implements_timestamplable_interface(): void
52
    {
53
        $this->shouldImplement(TimestampableInterface::class);
54
    }
55
56
    function it_has_no_id_by_default(): void
57
    {
58
        $this->getId()->shouldReturn(null);
0 ignored issues
show
Bug introduced by
The method getId() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

58
        $this->/** @scrutinizer ignore-call */ 
59
               getId()->shouldReturn(null);
Loading history...
59
    }
60
61
    function it_has_no_name_by_default(): void
62
    {
63
        $this->getName()->shouldReturn(null);
0 ignored issues
show
Bug introduced by
The method getName() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

63
        $this->/** @scrutinizer ignore-call */ 
64
               getName()->shouldReturn(null);
Loading history...
64
    }
65
66
    function it_is_timestampable(): void
67
    {
68
        $dateTime = new \DateTime();
69
        $this->setCreatedAt($dateTime);
0 ignored issues
show
Bug introduced by
The method setCreatedAt() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

69
        $this->/** @scrutinizer ignore-call */ 
70
               setCreatedAt($dateTime);
Loading history...
70
        $this->getCreatedAt()->shouldReturn($dateTime);
0 ignored issues
show
Bug introduced by
The method getCreatedAt() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

70
        $this->/** @scrutinizer ignore-call */ 
71
               getCreatedAt()->shouldReturn($dateTime);
Loading history...
71
        $this->setUpdatedAt($dateTime);
0 ignored issues
show
Bug introduced by
The method setUpdatedAt() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

71
        $this->/** @scrutinizer ignore-call */ 
72
               setUpdatedAt($dateTime);
Loading history...
72
        $this->getUpdatedAt()->shouldReturn($dateTime);
0 ignored issues
show
Bug introduced by
The method getUpdatedAt() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

72
        $this->/** @scrutinizer ignore-call */ 
73
               getUpdatedAt()->shouldReturn($dateTime);
Loading history...
73
    }
74
75
    function it_toggles(): void
76
    {
77
        $this->enable();
0 ignored issues
show
Bug introduced by
The method enable() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

77
        $this->/** @scrutinizer ignore-call */ 
78
               enable();
Loading history...
78
        $this->isEnabled()->shouldReturn(true);
0 ignored issues
show
Bug introduced by
The method isEnabled() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

78
        $this->/** @scrutinizer ignore-call */ 
79
               isEnabled()->shouldReturn(true);
Loading history...
79
        $this->disable();
0 ignored issues
show
Bug introduced by
The method disable() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

79
        $this->/** @scrutinizer ignore-call */ 
80
               disable();
Loading history...
80
        $this->isEnabled()->shouldReturn(false);
81
    }
82
83
    function it_allows_access_via_properties(): void
84
    {
85
        $this->setName('Vendor');
0 ignored issues
show
Bug introduced by
The method setName() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

85
        $this->/** @scrutinizer ignore-call */ 
86
               setName('Vendor');
Loading history...
86
        $this->getName()->shouldReturn('Vendor');
87
        $this->setSlug('vendor');
0 ignored issues
show
Bug introduced by
The method setSlug() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

87
        $this->/** @scrutinizer ignore-call */ 
88
               setSlug('vendor');
Loading history...
88
        $this->getSlug()->shouldReturn('vendor');
0 ignored issues
show
Bug introduced by
The method getSlug() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

88
        $this->/** @scrutinizer ignore-call */ 
89
               getSlug()->shouldReturn('vendor');
Loading history...
89
        $this->setEmail('[email protected]');
0 ignored issues
show
Bug introduced by
The method setEmail() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

89
        $this->/** @scrutinizer ignore-call */ 
90
               setEmail('[email protected]');
Loading history...
90
        $this->getEmail()->shouldReturn('[email protected]');
0 ignored issues
show
Bug introduced by
The method getEmail() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

90
        $this->/** @scrutinizer ignore-call */ 
91
               getEmail()->shouldReturn('[email protected]');
Loading history...
91
92
        $file = new File(__DIR__ . '/VendorSpec.php');
93
        $this->setLogoFile($file);
0 ignored issues
show
Bug introduced by
The method setLogoFile() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

93
        $this->/** @scrutinizer ignore-call */ 
94
               setLogoFile($file);
Loading history...
94
        $this->getLogoFile()->shouldReturn($file);
0 ignored issues
show
Bug introduced by
The method getLogoFile() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

94
        $this->/** @scrutinizer ignore-call */ 
95
               getLogoFile()->shouldReturn($file);
Loading history...
95
96
        $this->setLogoName('Odiseo logo');
0 ignored issues
show
Bug introduced by
The method setLogoName() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

96
        $this->/** @scrutinizer ignore-call */ 
97
               setLogoName('Odiseo logo');
Loading history...
97
        $this->getLogoName()->shouldReturn('Odiseo logo');
0 ignored issues
show
Bug introduced by
The method getLogoName() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

97
        $this->/** @scrutinizer ignore-call */ 
98
               getLogoName()->shouldReturn('Odiseo logo');
Loading history...
98
    }
99
100
    function it_associates_channels(ChannelInterface $channel): void
101
    {
102
        $this->getChannels()->shouldHaveCount(0);
0 ignored issues
show
Bug introduced by
The method getChannels() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

102
        $this->/** @scrutinizer ignore-call */ 
103
               getChannels()->shouldHaveCount(0);
Loading history...
103
        $this->addChannel($channel);
0 ignored issues
show
Bug introduced by
The method addChannel() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

103
        $this->/** @scrutinizer ignore-call */ 
104
               addChannel($channel);
Loading history...
104
        $this->getChannels()->shouldHaveCount(1);
105
        $this->removeChannel($channel);
0 ignored issues
show
Bug introduced by
The method removeChannel() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

105
        $this->/** @scrutinizer ignore-call */ 
106
               removeChannel($channel);
Loading history...
106
        $this->getChannels()->shouldHaveCount(0);
107
    }
108
109
    function it_associates_products(ProductInterface $product): void
110
    {
111
        $this->getProducts()->shouldHaveCount(0);
0 ignored issues
show
Bug introduced by
The method getProducts() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

111
        $this->/** @scrutinizer ignore-call */ 
112
               getProducts()->shouldHaveCount(0);
Loading history...
112
        $this->addProduct($product);
0 ignored issues
show
Bug introduced by
The method addProduct() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

112
        $this->/** @scrutinizer ignore-call */ 
113
               addProduct($product);
Loading history...
113
        $this->getProducts()->shouldHaveCount(1);
114
        $this->removeProduct($product);
0 ignored issues
show
Bug introduced by
The method removeProduct() does not exist on spec\Odiseo\SyliusVendorPlugin\Entity\VendorSpec. 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

114
        $this->/** @scrutinizer ignore-call */ 
115
               removeProduct($product);
Loading history...
115
        $this->getProducts()->shouldHaveCount(0);
116
    }
117
}
118