Completed
Push — master ( f1ba55...b399ca )
by Loïc
20s queued 12s
created

AppCollector   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 36
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getVersion() 0 4 1
A collect() 0 3 1
A reset() 0 3 1
A getName() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of AppName.
5
 *
6
 * (c) Monofony
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace App\Collector;
13
14
use App\Kernel;
15
use Symfony\Component\HttpFoundation\Request;
16
use Symfony\Component\HttpFoundation\Response;
17
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
18
19
final class AppCollector extends DataCollector
20
{
21
    public function __construct()
22
    {
23
        $this->data = [
24
            'version' => Kernel::VERSION,
25
        ];
26
    }
27
28
    public function getVersion(): string
29
    {
30
        return $this->data['version'];
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function collect(Request $request, Response $response, \Exception $exception = null): void
37
    {
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function reset(): void
44
    {
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function getName(): string
51
    {
52
        return 'app';
53
    }
54
}
55