Total Complexity | 5 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | trait ResolveTrait |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * @var ?callable |
||
10 | */ |
||
|
|||
11 | private $_resolveFunction; |
||
12 | |||
13 | /** |
||
14 | * @param array ...$args |
||
15 | * @return mixed |
||
16 | */ |
||
17 | public function resolve(...$args) |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @return callable|null |
||
24 | */ |
||
25 | public function getResolve(): ?callable |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @return bool |
||
32 | */ |
||
33 | public function hasResolve() |
||
34 | { |
||
35 | return $this->_resolveFunction !== null; |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Because of the use of ConfigTrait, setter name must match with attribute in $config array |
||
40 | * |
||
41 | * @param callable $resolveFunction |
||
42 | * @return $this |
||
43 | */ |
||
44 | protected function setResolve(callable $resolveFunction) |
||
48 | } |
||
49 | } |
||
50 |