| Total Complexity | 8 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class ApiDataCollector extends DataCollector |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var \Nixilla\Api\LoggerBundle\Logger\ApiInterface |
||
| 14 | */ |
||
| 15 | protected $logger; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * {@inheritDoc} |
||
| 19 | */ |
||
| 20 | 3 | public function __construct(ApiInterface $logger) |
|
| 21 | { |
||
| 22 | 3 | $this->logger = $logger; |
|
| 23 | 3 | } |
|
| 24 | |||
| 25 | /** |
||
| 26 | * {@inheritDoc} |
||
| 27 | */ |
||
| 28 | 1 | public function collect(Request $request, Response $response, \Exception $exception = null) |
|
| 32 | 1 | } |
|
| 33 | |||
| 34 | /** |
||
| 35 | * {@inheritDoc} |
||
| 36 | */ |
||
| 37 | 1 | public function getName() |
|
| 38 | { |
||
| 39 | 1 | return 'api'; |
|
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * {@inheritDoc} |
||
| 44 | */ |
||
| 45 | 1 | public function getCalls() |
|
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * {@inheritDoc} |
||
| 52 | */ |
||
| 53 | 1 | public function getCallsCount() |
|
| 56 | } |
||
| 57 | |||
| 58 | 1 | public function getTime() |
|
| 59 | { |
||
| 60 | 1 | $total = 0; |
|
| 61 | 1 | foreach($this->data['calls'] as $call) |
|
| 62 | 1 | $total += $call['time']; |
|
| 63 | |||
| 64 | 1 | return $total; |
|
| 65 | } |
||
| 66 | |||
| 67 | 1 | public function reset() |
|
| 70 | 1 | } |
|
| 71 | |||
| 72 | } |