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.

ReportSpec   A
last analyzed

Complexity

Total Complexity 15

Size/Duplication

Total Lines 98
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 33
c 1
b 0
f 1
dl 0
loc 98
rs 10
wmc 15

15 Methods

Rating   Name   Duplication   Size   Complexity  
A it_allows_access_via_properties() 0 22 1
A it_implements_timestamplable_interface() 0 3 1
A it_has_a_default_renderer() 0 3 1
A it_has_no_code_by_default() 0 3 1
A it_has_a_default_data_fetcher_configuration() 0 3 1
A it_is_timestampable() 0 7 1
A it_implements_code_aware_interface() 0 3 1
A it_has_no_id_by_default() 0 3 1
A it_implements_report_interface() 0 3 1
A it_has_no_name_by_default() 0 3 1
A it_has_a_default_data_fetcher() 0 3 1
A it_has_a_default_renderer_configuration() 0 3 1
A it_is_initializable() 0 3 1
A it_has_no_description_by_default() 0 3 1
A it_implements_resource_interface() 0 3 1
1
<?php
2
3
namespace spec\Odiseo\SyliusReportPlugin\Model;
4
5
use Odiseo\SyliusReportPlugin\DataFetcher\DefaultDataFetchers;
6
use Odiseo\SyliusReportPlugin\Model\Report;
7
use Odiseo\SyliusReportPlugin\Model\ReportInterface;
8
use Odiseo\SyliusReportPlugin\Renderer\DefaultRenderers;
9
use PhpSpec\ObjectBehavior;
10
use Prophecy\Argument;
11
use Sylius\Component\Resource\Model\CodeAwareInterface;
12
use Sylius\Component\Resource\Model\ResourceInterface;
13
use Sylius\Component\Resource\Model\TimestampableInterface;
14
15
/**
16
 * @author Diego D'amico <[email protected]>
17
 */
18
class ReportSpec extends ObjectBehavior
19
{
20
    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...
21
    {
22
        $this->shouldHaveType(Report::class);
23
    }
24
25
    function it_implements_report_interface(): void
26
    {
27
        $this->shouldImplement(ReportInterface::class);
28
    }
29
30
    function it_implements_resource_interface(): void
31
    {
32
        $this->shouldImplement(ResourceInterface::class);
33
    }
34
35
    function it_implements_code_aware_interface(): void
36
    {
37
        $this->shouldImplement(CodeAwareInterface::class);
38
    }
39
40
    function it_implements_timestamplable_interface(): void
41
    {
42
        $this->shouldImplement(TimestampableInterface::class);
43
    }
44
45
    function it_has_no_id_by_default(): void
46
    {
47
        $this->getId()->shouldReturn(null);
0 ignored issues
show
Bug introduced by
The method getId() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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

47
        $this->/** @scrutinizer ignore-call */ 
48
               getId()->shouldReturn(null);
Loading history...
48
    }
49
50
    function it_has_no_name_by_default(): void
51
    {
52
        $this->getName()->shouldReturn(null);
0 ignored issues
show
Bug introduced by
The method getName() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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

52
        $this->/** @scrutinizer ignore-call */ 
53
               getName()->shouldReturn(null);
Loading history...
53
    }
54
55
    function it_has_no_code_by_default(): void
56
    {
57
        $this->getCode()->shouldReturn(null);
0 ignored issues
show
Bug introduced by
The method getCode() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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

57
        $this->/** @scrutinizer ignore-call */ 
58
               getCode()->shouldReturn(null);
Loading history...
58
    }
59
60
    function it_has_no_description_by_default(): void
61
    {
62
        $this->getDescription()->shouldReturn(null);
0 ignored issues
show
Bug introduced by
The method getDescription() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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

62
        $this->/** @scrutinizer ignore-call */ 
63
               getDescription()->shouldReturn(null);
Loading history...
63
    }
64
65
    function it_has_a_default_renderer(): void
66
    {
67
        $this->getRenderer()->shouldReturn(DefaultRenderers::TABLE);
0 ignored issues
show
Bug introduced by
The method getRenderer() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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

67
        $this->/** @scrutinizer ignore-call */ 
68
               getRenderer()->shouldReturn(DefaultRenderers::TABLE);
Loading history...
68
    }
69
70
    function it_has_a_default_data_fetcher(): void
71
    {
72
        $this->getDataFetcher()->shouldReturn(DefaultDataFetchers::USER_REGISTRATION);
0 ignored issues
show
Bug introduced by
The method getDataFetcher() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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
               getDataFetcher()->shouldReturn(DefaultDataFetchers::USER_REGISTRATION);
Loading history...
73
    }
74
75
    function it_has_a_default_renderer_configuration(): void
76
    {
77
        $this->getRendererConfiguration()->shouldHaveCount(0);
0 ignored issues
show
Bug introduced by
The method getRendererConfiguration() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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
               getRendererConfiguration()->shouldHaveCount(0);
Loading history...
78
    }
79
80
    function it_has_a_default_data_fetcher_configuration(): void
81
    {
82
        $this->getDataFetcherConfiguration()->shouldHaveCount(1);
0 ignored issues
show
Bug introduced by
The method getDataFetcherConfiguration() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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

82
        $this->/** @scrutinizer ignore-call */ 
83
               getDataFetcherConfiguration()->shouldHaveCount(1);
Loading history...
83
    }
84
85
    function it_is_timestampable(): void
86
    {
87
        $dateTime = new \DateTime();
88
        $this->setCreatedAt($dateTime);
0 ignored issues
show
Bug introduced by
The method setCreatedAt() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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
               setCreatedAt($dateTime);
Loading history...
89
        $this->getCreatedAt()->shouldReturn($dateTime);
0 ignored issues
show
Bug introduced by
The method getCreatedAt() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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
               getCreatedAt()->shouldReturn($dateTime);
Loading history...
90
        $this->setUpdatedAt($dateTime);
0 ignored issues
show
Bug introduced by
The method setUpdatedAt() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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
               setUpdatedAt($dateTime);
Loading history...
91
        $this->getUpdatedAt()->shouldReturn($dateTime);
0 ignored issues
show
Bug introduced by
The method getUpdatedAt() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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

91
        $this->/** @scrutinizer ignore-call */ 
92
               getUpdatedAt()->shouldReturn($dateTime);
Loading history...
92
    }
93
94
    function it_allows_access_via_properties(): void
95
    {
96
        $this->setCode('report');
0 ignored issues
show
Bug introduced by
The method setCode() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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
               setCode('report');
Loading history...
97
        $this->getCode()->shouldReturn('report');
98
99
        $this->setName('Report');
0 ignored issues
show
Bug introduced by
The method setName() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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

99
        $this->/** @scrutinizer ignore-call */ 
100
               setName('Report');
Loading history...
100
        $this->getName()->shouldReturn('Report');
101
102
        $this->setDescription('Report description');
0 ignored issues
show
Bug introduced by
The method setDescription() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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
               setDescription('Report description');
Loading history...
103
        $this->getDescription()->shouldReturn('Report description');
104
105
        $this->setDataFetcher(DefaultDataFetchers::NUMBER_OF_ORDERS);
0 ignored issues
show
Bug introduced by
The method setDataFetcher() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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
               setDataFetcher(DefaultDataFetchers::NUMBER_OF_ORDERS);
Loading history...
106
        $this->getDataFetcher()->shouldReturn(DefaultDataFetchers::NUMBER_OF_ORDERS);
107
108
        $this->setDataFetcherConfiguration(['test' => 'yes']);
0 ignored issues
show
Bug introduced by
The method setDataFetcherConfiguration() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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

108
        $this->/** @scrutinizer ignore-call */ 
109
               setDataFetcherConfiguration(['test' => 'yes']);
Loading history...
109
        $this->getDataFetcherConfiguration()->shouldReturn(['test' => 'yes']);
110
111
        $this->setRenderer(DefaultRenderers::CHART);
0 ignored issues
show
Bug introduced by
The method setRenderer() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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
               setRenderer(DefaultRenderers::CHART);
Loading history...
112
        $this->getRenderer()->shouldReturn(DefaultRenderers::CHART);
113
114
        $this->setRendererConfiguration(['test' => 'yes']);
0 ignored issues
show
Bug introduced by
The method setRendererConfiguration() does not exist on spec\Odiseo\SyliusReportPlugin\Model\ReportSpec. 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
               setRendererConfiguration(['test' => 'yes']);
Loading history...
115
        $this->getRendererConfiguration()->shouldReturn(['test' => 'yes']);
116
    }
117
}
118