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.
Completed
Push — master ( 0b01a7...3b0906 )
by Odiseo
08:33
created

BaseDataFetcher   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 5 1
A __construct() 0 3 1
1
<?php
2
3
namespace Odiseo\SyliusReportPlugin\DataFetcher;
4
5
use Odiseo\SyliusReportPlugin\Filter\QueryFilter;
6
7
abstract class BaseDataFetcher implements DataFetcherInterface
8
{
9
    /**
10
     * @var QueryFilter
11
     */
12
    protected $queryFilter;
13
14
    /**
15
     * @param QueryFilter $queryFilter
16
     */
17
    public function __construct(QueryFilter $queryFilter)
18
    {
19
        $this->queryFilter = $queryFilter;
20
    }
21
22
    /**
23
     * Responsible for setup and add filters to the base QueryFilter's Query builder
24
     *
25
     * @param array $configuration
26
     */
27
    abstract protected function setupQueryFilter(array $configuration = []): void;
28
29
    /**
30
     * Responsible for providing raw data to fetch, from the configuration (ie: start date, end date, time period,
31
     * empty records flag, interval, period format, presentation format, group by).
32
     *
33
     * @param array $configuration
34
     *
35
     * @return array
36
     */
37
    protected function getData(array $configuration = []): array
38
    {
39
        $this->setupQueryFilter($configuration);
40
41
        return $this->queryFilter->getQueryBuilder()->getQuery()->getResult();
42
    }
43
}