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

CallbackSettingHandler::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 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