@@ -8,8 +8,8 @@ |
||
8 | 8 | class Component_toggle |
9 | 9 | extends AbstractComponent |
10 | 10 | implements ValueComponentInterface, |
11 | - FilterableComponentInterface, |
|
12 | - DisableableComponentInterface |
|
11 | + FilterableComponentInterface, |
|
12 | + DisableableComponentInterface |
|
13 | 13 | { |
14 | 14 | public $component_type = 'toggle'; |
15 | 15 |
@@ -24,13 +24,13 @@ discard block |
||
24 | 24 | 'multi' => false, |
25 | 25 | 'data' => array(), |
26 | 26 | 'default' => array(), |
27 | - 'filter' => array( $this, 'filter' ) |
|
27 | + 'filter' => array($this, 'filter') |
|
28 | 28 | ); |
29 | 29 | } |
30 | 30 | |
31 | 31 | public function required_arguments() |
32 | 32 | { |
33 | - return array('name','data'); |
|
33 | + return array('name', 'data'); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | public function get_template_path() |
@@ -49,16 +49,16 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function filter($v) |
51 | 51 | { |
52 | - if($this->multi && !\is_array($v)) |
|
52 | + if ($this->multi && !\is_array($v)) |
|
53 | 53 | { |
54 | 54 | return \explode(',', $v); |
55 | 55 | } |
56 | 56 | return $v; |
57 | 57 | } |
58 | 58 | |
59 | - protected function is_selected( $value ) |
|
59 | + protected function is_selected($value) |
|
60 | 60 | { |
61 | - if($this->multi) |
|
61 | + if ($this->multi) |
|
62 | 62 | { |
63 | 63 | return \in_array($value, $this->value); |
64 | 64 | } |