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.
Passed
Push — master ( 9a9dbd...ba2850 )
by
unknown
04:30
created

UserRegistrationDataFetcher   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setupQueryFilter() 0 13 1
A getType() 0 3 1
A __construct() 0 7 1
1
<?php
2
3
namespace Odiseo\SyliusReportPlugin\DataFetcher;
4
5
use Exception;
6
use Odiseo\SyliusReportPlugin\Filter\QueryFilter;
7
use Odiseo\SyliusReportPlugin\Form\Type\DataFetcher\UserRegistrationType;
8
9
/**
10
 * @author Łukasz Chruściel <[email protected]>
11
 * @author Diego D'amico <[email protected]>
12
 */
13
class UserRegistrationDataFetcher extends TimePeriodDataFetcher
14
{
15
    /**
16
     * @var string
17
     */
18
    private $orderClass;
19
20
    /**
21
     * @param QueryFilter $queryFilter
22
     * @param string $orderClass
23
     */
24
    public function __construct(
25
        QueryFilter $queryFilter,
26
        string $orderClass
27
    ) {
28
        parent::__construct($queryFilter);
29
30
        $this->orderClass = $orderClass;
31
    }
32
    
33
    /**
34
     * @inheritdoc
35
     * @throws Exception
36
     */
37
    protected function setupQueryFilter(array $configuration = []): void
38
    {
39
        $qb = $this->queryFilter->getQueryBuilder();
40
41
        $from = $this->orderClass;
42
        $qb
43
            ->select('DATE(u.createdAt) as date', 'count(u.id) as user_total')
44
            ->from($from, 'u')
45
        ;
46
47
        $this->queryFilter->addTimePeriod($configuration, 'createdAt');
48
        $this->queryFilter->addChannel($configuration);
49
        $this->queryFilter->addUserGender($configuration);
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function getType(): string
56
    {
57
        return UserRegistrationType::class;
58
    }
59
}
60