Passed
Pull Request — master (#59)
by
unknown
13:30
created

PerformanceMetrics   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 1
eloc 6
c 2
b 1
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 6 1
1
<?php
2
3
4
namespace App\Widget;
5
6
use App\Timer;
7
use Yiisoft\Widget\Widget;
8
9
class PerformanceMetrics extends Widget
10
{
11
    private Timer $timer;
0 ignored issues
show
introduced by
The private property $timer is not used, and could be removed.
Loading history...
12
13
    protected function run(): string
14
    {
15
        return sprintf(
16
            "Time: %.6f s. Memory: %.3f mb.",
17
            Timer::get('overall'),
18
            memory_get_peak_usage() / (1024 * 1024)
19
        );
20
    }
21
}
22