TimeStrategy   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 23
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 1
A startTimer() 0 4 1
A isStopped() 0 4 1
1
<?php
2
3
namespace whm\Smoke\Extensions\SmokeStop\Strategy;
4
5
class TimeStrategy
6
{
7
    private $duration;
8
    private $startTime;
9
10
    public function init($duration)
11
    {
12
        $this->duration = $duration;
13
    }
14
15
    /**
16
     * @Event("Scanner.Scan.Begin")
17
     */
18
    public function startTimer()
19
    {
20
        $this->startTime = time();
21
    }
22
23
    public function isStopped()
24
    {
25
        return ($this->startTime + $this->duration) < time();
26
    }
27
}
28