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

CallbackSettingHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
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 15
rs 10

2 Methods

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