CountStrategy::isStopped()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace whm\Smoke\Extensions\SmokeStop\Strategy;
4
5
use phmLabs\Components\Annovent\Event\Event;
6
7
class CountStrategy
8
{
9
    private $count = 0;
10
    private $maxCount;
11
12
    public function init($maxCount = 20)
13
    {
14
        $this->maxCount = $maxCount;
15
    }
16
17
    /**
18
     * @Event("Scanner.Scan.Validate")
19
     */
20
    public function afterValidation()
21
    {
22
        ++$this->count;
23
    }
24
25
    public function isStopped()
26
    {
27
        return $this->count >= $this->maxCount;
28
    }
29
}
30