Skip to content

Commit

Permalink
Fix: Avoid ternary statement (#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz authored Feb 2, 2023
1 parent 3ad004b commit abc97b5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Faker/Provider/Lorem.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,15 @@ public static function text($maxNbChars = 200)
throw new \InvalidArgumentException('text() can only generate text of at least 5 characters');
}

$type = ($maxNbChars < 25) ? 'word' : (($maxNbChars < 100) ? 'sentence' : 'paragraph');
$type = 'paragraph';

if ($maxNbChars < 100) {
$type = 'sentence';
}

if ($maxNbChars < 25) {
$type = 'word';
}

$text = [];

Expand Down

0 comments on commit abc97b5

Please sign in to comment.