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 ( 2c7b14...3be0f5 )
by Mario
02:10
created

InformationCollectionCollector   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 2
dl 0
loc 37
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A collect() 0 14 2
A reset() 0 4 1
A getName() 0 4 1
A getCollectedItems() 0 4 1
A getCollectedItemsCount() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Netgen\Bundle\InformationCollectionBundle\DataCollector;
6
7
use Symfony\Component\HttpFoundation\Request;
8
use Symfony\Component\HttpFoundation\Response;
9
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
10
11
class InformationCollectionCollector extends DataCollector
12
{
13
    public function collect(Request $request, Response $response, \Exception $exception = null)
14
    {
15
        $collectedItemsCount = 0;
16
        $collectedItems = null;
17
        if ($request->get('ezrepoforms_information_collection') !== null) {
18
            $collectedItems = $request->get('ezrepoforms_information_collection')['fieldsData'];
19
            $collectedItemsCount = count($collectedItems);
20
        }
21
22
        $this->data = [
23
            'collected_items' => $collectedItems,
24
            'collected_items_count' => $collectedItemsCount,
25
        ];
26
    }
27
28
    public function reset()
29
    {
30
        $this->data = [];
31
    }
32
33
    public function getName()
34
    {
35
        return 'netgen_information_collection_collector';
36
    }
37
38
    public function getCollectedItems(): array
39
    {
40
        return $this->data['collected_items'];
41
    }
42
43
    public function getCollectedItemsCount(): int
44
    {
45
        return $this->data['collected_items_count'];
46
    }
47
}
48