| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | public function __construct($itemId, $config) { |
||
| 16 | |||
| 17 | if (array_key_exists('group', $config)) { |
||
| 18 | $this->group($config['group']); |
||
|
|
|||
| 19 | unset($config['group']); |
||
| 20 | } |
||
| 21 | |||
| 22 | parent::__construct($itemId, $config); |
||
| 23 | |||
| 24 | if (array_key_exists('checked', $config)) { |
||
| 25 | $this->checked = true; |
||
| 26 | } |
||
| 27 | |||
| 28 | $this->attributes()->add('class', 'onoffswitch-checkbox'); |
||
| 29 | } |
||
| 30 | } |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: