@@ -43,7 +43,7 @@ |
||
| 43 | 43 | * handle this. |
| 44 | 44 | * |
| 45 | 45 | * @param [string] $v |
| 46 | - * @return void |
|
| 46 | + * @return string |
|
| 47 | 47 | */ |
| 48 | 48 | public function filter($v) |
| 49 | 49 | { |
@@ -8,8 +8,8 @@ |
||
| 8 | 8 | class Component_switch |
| 9 | 9 | extends AbstractComponent |
| 10 | 10 | implements ValueComponentInterface, |
| 11 | - DisableableComponentInterface, |
|
| 12 | - FilterableComponentInterface |
|
| 11 | + DisableableComponentInterface, |
|
| 12 | + FilterableComponentInterface |
|
| 13 | 13 | { |
| 14 | 14 | public $component_type = 'switch'; |
| 15 | 15 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | 'required' => false, |
| 23 | 23 | 'readonly' => false, |
| 24 | 24 | 'default' => null, |
| 25 | - 'filter' => array( $this, 'filter' ) |
|
| 25 | + 'filter' => array($this, 'filter') |
|
| 26 | 26 | ); |
| 27 | 27 | } |
| 28 | 28 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function filter($v) |
| 49 | 49 | { |
| 50 | - if($v !== 'on') return 'off'; |
|
| 50 | + if ($v !== 'on') return 'off'; |
|
| 51 | 51 | return 'on'; |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | \ No newline at end of file |
@@ -47,7 +47,9 @@ |
||
| 47 | 47 | */ |
| 48 | 48 | public function filter($v) |
| 49 | 49 | { |
| 50 | - if($v !== 'on') return 'off'; |
|
| 50 | + if($v !== 'on') { |
|
| 51 | + return 'off'; |
|
| 52 | + } |
|
| 51 | 53 | return 'on'; |
| 52 | 54 | } |
| 53 | 55 | } |
| 54 | 56 | \ No newline at end of file |