Code Duplication    Length = 35-36 lines in 5 locations

src/Renderer/Html/Data/Context.php 1 location

@@ 14-48 (lines=35) @@
11
use Ndrx\Profiler\Renderer\Html\BarInterface;
12
use Ndrx\Profiler\Renderer\Html\PageInterface;
13
14
class Context extends Collector implements BarInterface, PageInterface
15
{
16
    /**
17
     * @return string
18
     */
19
    public function getTitle()
20
    {
21
        return 'Context';
22
    }
23
24
    /**
25
     * @return string
26
     */
27
    public function getBadge()
28
    {
29
        if (empty($this->profile['value'])) {
30
            return '-';
31
        }
32
33
        return $this->profile['value']['environment'];
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getBarContent()
40
    {
41
        return false;
42
    }
43
44
    public function getIcon()
45
    {
46
        return 'fa-compass';
47
    }
48
}
49

src/Renderer/Html/Data/CpuUsage.php 1 location

@@ 13-47 (lines=35) @@
10
11
use Ndrx\Profiler\Renderer\Html\BarInterface;
12
13
class CpuUsage extends Collector implements BarInterface
14
{
15
    /**
16
     * @return string
17
     */
18
    public function getTitle()
19
    {
20
        return 'CpuUsage';
21
    }
22
23
    /**
24
     * @return string
25
     */
26
    public function getBadge()
27
    {
28
        if (empty($this->profile['value'])) {
29
            return '-';
30
        }
31
32
        return round($this->profile['value'] / 1000, 3) . 'ms';
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getBarContent()
39
    {
40
        return false;
41
    }
42
43
    public function getIcon()
44
    {
45
        return 'fa-heartbeat';
46
    }
47
}
48

src/Renderer/Html/Data/Duration.php 1 location

@@ 13-48 (lines=36) @@
10
11
use Ndrx\Profiler\Renderer\Html\BarInterface;
12
13
class Duration extends Collector implements BarInterface
14
{
15
    /**
16
     * @return string
17
     */
18
    public function getTitle()
19
    {
20
        return 'Duration';
21
    }
22
23
24
    /**
25
     * @return string
26
     */
27
    public function getBadge()
28
    {
29
        if (empty($this->profile['value'])) {
30
            return '-';
31
        }
32
33
        return round($this->profile['value'], 3) . 's';
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getBarContent()
40
    {
41
        return false;
42
    }
43
44
    public function getIcon()
45
    {
46
        return 'fa-clock-o';
47
    }
48
}
49

src/Renderer/Html/Data/Response.php 1 location

@@ 14-49 (lines=36) @@
11
use Ndrx\Profiler\Renderer\Html\BarInterface;
12
use Ndrx\Profiler\Renderer\Html\PageInterface;
13
14
class Response extends Collector implements BarInterface, PageInterface
15
{
16
    /**
17
     * @return string
18
     */
19
    public function getTitle()
20
    {
21
        return 'Response';
22
    }
23
24
25
    /**
26
     * @return string
27
     */
28
    public function getBadge()
29
    {
30
        if (empty($this->profile['value'])) {
31
            return '-';
32
        }
33
34
        return $this->profile['value']['status']['code'];
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getBarContent()
41
    {
42
        return false;
43
    }
44
45
    public function getIcon()
46
    {
47
        return 'fa-arrow-up';
48
    }
49
}
50

src/Renderer/Html/Data/User.php 1 location

@@ 14-49 (lines=36) @@
11
use Ndrx\Profiler\Renderer\Html\BarInterface;
12
use Ndrx\Profiler\Renderer\Html\PageInterface;
13
14
class User extends Collector implements BarInterface, PageInterface
15
{
16
    /**
17
     * @return string
18
     */
19
    public function getTitle()
20
    {
21
        return 'User';
22
    }
23
24
25
    /**
26
     * @return string
27
     */
28
    public function getBadge()
29
    {
30
        if (empty($this->profile['value']['id'])) {
31
            return '-';
32
        }
33
34
        return $this->profile['value']['identifier'];
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getBarContent()
41
    {
42
        return false;
43
    }
44
45
    public function getIcon()
46
    {
47
        return 'fa-user';
48
    }
49
}
50