Passed
Push — master ( 21c01c...bba7c4 )
by Iman
08:34
created

HeyManSwitcher::wrapForIgnorance()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 1
nop 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Imanghafoori\HeyMan;
4
5
class HeyManSwitcher
6
{
7
    public function wrapForIgnorance(callable $callback, $key): \Closure
8
    {
9
        return function (...$args) use ($callback, $key) {
10
            if (!config('heyman_ignore_'.$key, false)) {
11
                $callback(...$args);
12
            }
13
        };
14
    }
15
}