Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#275)
by Hugo
15:12
created

DebugListener   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 22
ccs 9
cts 9
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A onPreExecutor() 0 5 1
A onPostExecutor() 0 7 1
1
<?php
2
3
namespace Overblog\GraphQLBundle\EventListener;
4
5
use Overblog\GraphQLBundle\Event\ExecutorResultEvent;
6
7
final class DebugListener
8
{
9
    /** @var float */
10
    private $startTime;
11
12
    /** @var int */
13
    private $startMemoryUsage;
14
15 1
    public function onPreExecutor()
16
    {
17 1
        $this->startTime = microtime(true);
18 1
        $this->startMemoryUsage = memory_get_usage(true);
19 1
    }
20
21 1
    public function onPostExecutor(ExecutorResultEvent $executorResultEvent)
22
    {
23 1
        $executorResultEvent->getResult()->extensions['debug'] = [
24 1
            'executionTime' => sprintf('%d ms', round(microtime(true) - $this->startTime, 3) * 1000),
25 1
            'memoryUsage' => sprintf('%.2F MiB', (memory_get_usage(true) - $this->startMemoryUsage) / 1024 / 1024),
26
        ];
27 1
    }
28
}
29