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.

DelegatingRendererSpec   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 11
c 1
b 0
f 1
dl 0
loc 31
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A it_should_implement_delegating_renderer_interface() 0 3 1
A let() 0 3 1
A it_is_initializable() 0 3 1
A it_get_the_renderer_with_given_report() 0 5 1
A it_render_with_given_report_configuration_and_data() 0 7 1
1
<?php
2
3
namespace spec\Odiseo\SyliusReportPlugin\Renderer;
4
5
use Odiseo\SyliusReportPlugin\DataFetcher\Data;
6
use Odiseo\SyliusReportPlugin\Model\ReportInterface;
7
use Odiseo\SyliusReportPlugin\Renderer\DefaultRenderers;
8
use Odiseo\SyliusReportPlugin\Renderer\DelegatingRenderer;
9
use Odiseo\SyliusReportPlugin\Renderer\DelegatingRendererInterface;
10
use Odiseo\SyliusReportPlugin\Renderer\RendererInterface;
11
use Odiseo\SyliusReportPlugin\Renderer\TableRenderer;
12
use PhpSpec\ObjectBehavior;
13
use Sylius\Component\Registry\ServiceRegistryInterface;
14
15
/**
16
 * @author Diego D'amico <[email protected]>
17
 */
18
class DelegatingRendererSpec extends ObjectBehavior
19
{
20
    function let(ServiceRegistryInterface $registry)
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->beConstructedWith($registry);
23
    }
24
25
    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...
26
    {
27
        $this->shouldHaveType(DelegatingRenderer::class);
28
    }
29
30
    function it_should_implement_delegating_renderer_interface()
31
    {
32
        $this->shouldImplement(DelegatingRendererInterface::class);
33
    }
34
35
    function it_get_the_renderer_with_given_report(ReportInterface $report, ServiceRegistryInterface $registry, TableRenderer $tableRenderer)
36
    {
37
        $report->getRenderer()->willReturn(DefaultRenderers::TABLE);
38
        $registry->get(DefaultRenderers::TABLE)->willReturn($tableRenderer);
39
        $this->getRenderer($report)->shouldReturn($tableRenderer);
0 ignored issues
show
Bug introduced by
The method getRenderer() does not exist on spec\Odiseo\SyliusReport...\DelegatingRendererSpec. 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

39
        $this->/** @scrutinizer ignore-call */ 
40
               getRenderer($report)->shouldReturn($tableRenderer);
Loading history...
40
    }
41
42
    function it_render_with_given_report_configuration_and_data(ReportInterface $report, RendererInterface $renderer, Data $data, ServiceRegistryInterface $registry)
43
    {
44
        $report->getRenderer()->willReturn(DefaultRenderers::TABLE);
45
        $registry->get(DefaultRenderers::TABLE)->willReturn($renderer);
46
        $renderer->render($report, $data)->willReturn('<div>Table render</div>');
47
48
        $this->render($report, $data)->shouldReturn('<div>Table render</div>');
0 ignored issues
show
Bug introduced by
The method render() does not exist on spec\Odiseo\SyliusReport...\DelegatingRendererSpec. 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

48
        $this->/** @scrutinizer ignore-call */ 
49
               render($report, $data)->shouldReturn('<div>Table render</div>');
Loading history...
49
    }
50
}
51