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.

Issues (149)

spec/Renderer/TableRendererSpec.php (4 issues)

1
<?php
2
3
namespace spec\Odiseo\SyliusReportPlugin\Renderer;
4
5
use Odiseo\SyliusReportPlugin\DataFetcher\Data;
6
use Odiseo\SyliusReportPlugin\Form\Type\Renderer\TableConfigurationType;
7
use Odiseo\SyliusReportPlugin\Model\ReportInterface;
8
use Odiseo\SyliusReportPlugin\Renderer\RendererInterface;
9
use Odiseo\SyliusReportPlugin\Renderer\TableRenderer;
10
use PhpSpec\ObjectBehavior;
11
use Symfony\Component\Templating\EngineInterface;
12
use Twig\Environment;
13
14
/**
15
 * @author Mateusz Zalewski <[email protected]>
16
 * @author Łukasz Chruściel <[email protected]>
17
 * @author Diego D'amico <[email protected]>
18
 */
19
final class TableRendererSpec extends ObjectBehavior
20
{
21
    function let(Environment $templating)
0 ignored issues
show
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->beConstructedWith($templating);
24
    }
25
26
    function it_is_initializable()
0 ignored issues
show
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
    {
28
        $this->shouldHaveType(TableRenderer::class);
29
    }
30
31
    function it_should_implement_renderer_interface()
32
    {
33
        $this->shouldImplement(RendererInterface::class);
34
    }
35
36
    function it_renders_data_with_given_configuration(ReportInterface $report, Data $reportData, EngineInterface $templating)
37
    {
38
        $reportData->getLabels()->willReturn(['month', 'user_total']);
39
        $reportData->getData()->willReturn(['month1' => '50', 'month2' => '40']);
40
41
        $renderData = [
42
            'report' => $report,
43
            'values' => ['month1' => '50', 'month2' => '40'],
44
            'labels' => ['month', 'user_total'],
45
        ];
46
47
        $report->getRendererConfiguration()->willReturn(['template' => '@OdiseoSyliusReportPlugin/Table/default.html.twig']);
48
49
        $templating->render('@OdiseoSyliusReportPlugin/Table/default.html.twig', [
50
            'data' => $renderData,
51
            'configuration' => ['template' => '@OdiseoSyliusReportPlugin/Table/default.html.twig'],
52
        ])->willReturn('<div>Table Report</div>');
53
54
        $this->render($report, $reportData)->shouldReturn('<div>Table Report</div>');
0 ignored issues
show
The method render() does not exist on spec\Odiseo\SyliusReport...derer\TableRendererSpec. 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

54
        $this->/** @scrutinizer ignore-call */ 
55
               render($report, $reportData)->shouldReturn('<div>Table Report</div>');
Loading history...
55
    }
56
57
    function it_renders_a_no_data_with_given_configuration(ReportInterface $report, Data $reportData, EngineInterface $templating)
58
    {
59
        $reportData->getLabels()->willReturn(['month', 'user_total']);
60
        $reportData->getData()->willReturn([]);
61
62
        $report->getRendererConfiguration()->willReturn(['template' => '@OdiseoSyliusReportPlugin/noDataTemplate.html.twig']);
63
64
        $templating->render('@OdiseoSyliusReportPlugin/noDataTemplate.html.twig', [
65
            'report' => $report,
66
        ])->willReturn('<div>No Data</div>');
67
68
        $this->render($report, $reportData)->shouldReturn('<div>No Data</div>');
69
    }
70
71
    function it_is_a_table_type()
72
    {
73
        $this->getType()->shouldReturn(TableConfigurationType::class);
0 ignored issues
show
The method getType() does not exist on spec\Odiseo\SyliusReport...derer\TableRendererSpec. 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

73
        $this->/** @scrutinizer ignore-call */ 
74
               getType()->shouldReturn(TableConfigurationType::class);
Loading history...
74
    }
75
}
76