Test Failed
Push — master ( 2c2c87...ed1c51 )
by Chris
25:05 queued 37s
created

LazyLoadedSettingHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 12
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handleInput() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace Leonidas\Library\Admin\Setting;
4
5
use Closure;
6
use Leonidas\Contracts\Admin\Setting\SettingHandlerInterface;
7
8
class LazyLoadedSettingHandler implements SettingHandlerInterface
9
{
10
    protected Closure $callback;
11
12
    public function __construct(Closure $callback)
13
    {
14
        $this->callback = $callback;
15
    }
16
17
    public function handleInput($input)
18
    {
19
        return ($this->callback)($input);
20
    }
21
}
22