HeyManSwitcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A wrapForIgnorance() 0 8 2
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