| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function enabled(string $name, string $function = '') : bool |
||
| 31 | { |
||
| 32 | if (! is_null(static::$masterSwitch)) { |
||
| 33 | return static::$masterSwitch; |
||
| 34 | } |
||
| 35 | |||
| 36 | $feature = $this->feature($name); |
||
| 37 | |||
| 38 | if (! empty(trim($function))) { |
||
| 39 | return is_array($feature) ? value(array_get($feature, $function, false)) : (bool) value($feature); |
||
| 40 | } |
||
| 41 | |||
| 42 | return (bool) value($feature); |
||
| 43 | } |
||
| 44 | |||
| 71 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.