Skip to content

Commit 2ec09c3

Browse files
committed
Replace repeated comparisons with in_array
1 parent 397f888 commit 2ec09c3

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/OptionData.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,7 @@ public static function fromUserInput(
186186
$value = '1';
187187
break;
188188
case 'boolean':
189-
$value = $user_input === ''
190-
|| $user_input === '0'
191-
|| $user_input === 'false' ? '0' : '1';
189+
$value = in_array( $user_input, [ '', '0', 'false' ], true ) ? '0' : '1';
192190
break;
193191
case 'integer':
194192
$value = (string) intval( $user_input );

0 commit comments

Comments
 (0)