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.

UserRegistrationDataFetcher   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
c 0
b 0
f 0
dl 0
loc 34
rs 10
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
declare(strict_types=1);
4
5
namespace Odiseo\SyliusReportPlugin\DataFetcher;
6
7
use Exception;
8
use Odiseo\SyliusReportPlugin\Filter\QueryFilterInterface;
9
use Odiseo\SyliusReportPlugin\Form\Type\DataFetcher\UserRegistrationType;
10
11
/**
12
 * @author Łukasz Chruściel <[email protected]>
13
 * @author Diego D'amico <[email protected]>
14
 */
15
class UserRegistrationDataFetcher extends TimePeriodDataFetcher
16
{
17
    private string $orderClass;
18
19
    public function __construct(
20
        QueryFilterInterface $queryFilter,
21
        string $orderClass
22
    ) {
23
        parent::__construct($queryFilter);
24
25
        $this->orderClass = $orderClass;
26
    }
27
28
    /**
29
     * @throws Exception
30
     */
31
    protected function setupQueryFilter(array $configuration = []): void
32
    {
33
        $qb = $this->queryFilter->getQueryBuilder();
34
35
        $from = $this->orderClass;
36
        $qb
37
            ->select('DATE(u.createdAt) as date', 'count(u.id) as users_quantity')
38
            ->from($from, 'u')
39
        ;
40
41
        $this->queryFilter->addTimePeriod($configuration, 'createdAt');
42
        $this->queryFilter->addChannel($configuration);
43
        $this->queryFilter->addUserGender($configuration);
44
    }
45
46
    public function getType(): string
47
    {
48
        return UserRegistrationType::class;
49
    }
50
}
51