DataCollector::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * @author Dolgov_M <[email protected]>
4
 * @date   11.11.2016 15:26
5
 */
6
7
namespace SilexDoctrineHydrationProfile\Fix;
8
9
use Debesha\DoctrineProfileExtraBundle\DataCollector\HydrationDataCollector;
10
use Debesha\DoctrineProfileExtraBundle\ORM\HydrationLogger;
11
use Symfony\Component\HttpFoundation\Request;
12
use Symfony\Component\HttpFoundation\Response;
13
14
15
class DataCollector extends HydrationDataCollector
16
{
17
18
    /**
19
     * @var HydrationLogger
20
     */
21
    private $hydrationLogger = array ();
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
22
23
    public function __construct(HydrationLogger $logger)
24
    {
25
        $this->hydrationLogger = $logger;
26
    }
27
28
    /**
29
     * @inheritdoc
30
     */
31
    public function collect(Request $request, Response $response, \Exception $exception = null)
32
    {
33
34
        $this->data['hydrations'] = $this->hydrationLogger->hydrations;
35
    }
36
}