Completed
Push — develop ( 7c4ff2...984a6e )
by Peter
08:26
created

TimerPanel::getPanel()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 0
1
<?php
2
/**
3
 * Webino (http://webino.sk/)
4
 *
5
 * @link        https://github.com/webino/WebinoDebug/ for the canonical source repository
6
 * @copyright   Copyright (c) 2018 Webino, s. r. o. (http://webino.sk/)
7
 * @license     BSD-3-Clause
8
 */
9
10
namespace WebinoDebug\Debugger\Bar;
11
12
use WebinoDebug\Factory\DebuggerFactory;
13
use WebinoDebug\Options\ModuleOptions;
14
use Zend\ServiceManager\ServiceManager;
15
use Zend\Stdlib\ArrayUtils;
16
17
/**
18
 * Class TimerPanel
19
 */
20
class TimerPanel extends AbstractPanel implements PanelInterface
21
{
22
    /**
23
     * @var string
24
     */
25
    protected $title = 'Timer';
26
27
    /**
28
     * @var array
29
     */
30
    protected $timers = [];
31
32
    /**
33
     * Set timer value
34
     *
35
     * @param string $name Timer name
36
     * @param float $value value
37
     * @return $this
38
     */
39
    public function setTimer(string $name, $value)
40
    {
41
        $this->timers[$name] = (string) $value;
42
        return $this;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function getTab()
49
    {
50
        return $this->timers ? $this->createIcon('timer') : '';
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function getPanel()
57
    {
58
        return $this->timers ? $this->renderTemplate('timer') : '';
59
    }
60
}
61