Total Complexity | 5 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | class InterfaceModel extends Model |
||
17 | { |
||
18 | const STATUS_UNKNOWN = -1; |
||
19 | const STATUS_METHOD_NOT_FOUND = 1; |
||
20 | public static $statuses = [ |
||
21 | self::STATUS_METHOD_NOT_FOUND => 'Метод не найден' |
||
22 | ]; |
||
23 | public $function; |
||
24 | public $interface; |
||
25 | public $class; |
||
26 | |||
27 | public function getStatus_id() |
||
28 | { |
||
29 | if (!$this->functionExists()) { |
||
30 | return self::STATUS_METHOD_NOT_FOUND; |
||
31 | } |
||
32 | return self::STATUS_UNKNOWN; |
||
33 | } |
||
34 | |||
35 | public function getStatus_name() |
||
36 | { |
||
37 | return ArrayHelper::getValue(self::$statuses, $this->status_id, $this->status_id); |
||
38 | } |
||
39 | |||
40 | public function functionExists() |
||
41 | { |
||
42 | return array_search($this->function, ClassHelper::getMethods($this->class)) !== false; |
||
43 | } |
||
44 | |||
45 | public function getDescription() |
||
49 | } |
||
50 | } |