Passed
Pull Request — master (#3)
by Vincent
08:42
created

PrimeDataCollector::collect()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 14
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 18
ccs 5
cts 5
cp 1
crap 1
rs 9.7998
1
<?php
2
3
namespace Bdf\PrimeBundle\Collector;
4
5
use Doctrine\Bundle\DoctrineBundle\DataCollector\DoctrineDataCollector;
6
use Symfony\Component\HttpFoundation\Request;
7
use Symfony\Component\HttpFoundation\Response;
8
9
/**
10
 * Adapt the doctrine data collector to prime
11
 */
12
class PrimeDataCollector extends DoctrineDataCollector
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17 1
    public function collect(Request $request, Response $response, \Throwable $exception = null)
18
    {
19 1
        \Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector::collect($request, $response, $exception);
20
21 1
        $this->data['entities'] = [];
22 1
        $this->data['errors'] = [];
23 1
        $this->data['caches'] = [
24
            'enabled' => false,
25
            'log_enabled' => false,
26
            'counts' => [
27
                'puts' => 0,
28
                'hits' => 0,
29
                'misses' => 0,
30
            ],
31
            'regions' => [
32
                'puts' => [],
33
                'hits' => [],
34
                'misses' => [],
35
            ],
36
        ];
37 1
    }
38
}
39