HeyManSwitcher::wrapForIgnorance()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 4
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 8
ccs 4
cts 4
cp 1
crap 2
rs 10
1
<?php
2
3
namespace Imanghafoori\HeyMan\Switching;
4
5
final class HeyManSwitcher
6
{
7
    public function wrapForIgnorance(callable $callback, $key)
8
    {
9 106
        return function (...$args) use ($callback, $key) {
10 82
            if (config('heyman_ignore_'.$key, false)) {
11 12
                return true;
12
            }
13
14 72
            return $callback(...$args);
15 106
        };
16
    }
17
}
18