Completed
Push — master ( 29d79e...8aac64 )
by Iman
09:16
created

HeyManSwitcher   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 7
rs 10
c 0
b 0
f 0

1 Method

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