Completed
Push — master ( 29d79e...8aac64 )
by Iman
09:16
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
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 2
nc 1
nop 2
1
<?php
2
3
namespace Imanghafoori\HeyMan\Switching;
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
}
16