Completed
Push — master ( 0a5a8d...9acf59 )
by Vasily
06:59 queued 02:58
created

ExtFunc::humanToPlain()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 5
rs 9.4285
1
<?php
2
namespace PHPDaemon\Config\Entry;
3
4
use PHPDaemon\Config\Entry\Generic;
5
6
/**
7
 * External function config entry
8
 *
9
 * @package    Core
10
 * @subpackage Config
11
 *
12
 * @author     Vasily Zorin <[email protected]>
13
 */
14
class ExtFunc extends Generic
15
{
16
    /**
17
     * Converts human-readable value to plain
18
     * @param $value
19
     * @return callable|null
20
     */
21
    public static function humanToPlain($value)
22
    {
23
        $cb = include($value);
24
        return is_callable($cb) ? $cb : null;
25
    }
26
}
27