Skip to content

Commit abc97b5

Browse files
authored
Fix: Avoid ternary statement (#600)
1 parent 3ad004b commit abc97b5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Faker/Provider/Lorem.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,15 @@ public static function text($maxNbChars = 200)
184184
throw new \InvalidArgumentException('text() can only generate text of at least 5 characters');
185185
}
186186

187-
$type = ($maxNbChars < 25) ? 'word' : (($maxNbChars < 100) ? 'sentence' : 'paragraph');
187+
$type = 'paragraph';
188+
189+
if ($maxNbChars < 100) {
190+
$type = 'sentence';
191+
}
192+
193+
if ($maxNbChars < 25) {
194+
$type = 'word';
195+
}
188196

189197
$text = [];
190198

0 commit comments

Comments
 (0)