ChangeCount   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 5 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Cart\CountOperation;
5
6
use Cart\Contracts\CounterItemContract;
7
8
/**
9
 * Class ChangeCount
10
 *
11
 * @package CountOperation
12
 */
13
class ChangeCount implements CounterItemContract
14
{
15
16
    /**
17
     * Operation
18
     *
19
     * @param int $before
20
     * @param int $howMuch
21
     * @return int
22
     */
23 1
    public function execute(int $before, int $howMuch): int
24
    {
25 1
        $before = $howMuch;
26 1
        $before < 0 ? $before = 0 : true;
27 1
        return $before;
28
    }
29
}