Skip to content

Commit 67cb7e9

Browse files
committed
Fix static issues
1 parent 1015d3f commit 67cb7e9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/Exercise/LordOfTheStrings.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,18 @@ public function getSolution(): SolutionInterface
5454

5555
public function getArgs(): array
5656
{
57+
/** @var string $word */
5758
$word = $this->faker->words(1, true);
5859

60+
/** @var string $sentence */
5961
$sentence = $this->faker->words(random_int(2, 5), true);
60-
61-
$sentence = match ($this->faker->numberBetween(0, 3)) {
62-
0 => "$word $sentence",
63-
1 => "$sentence $word",
64-
2 => $this->insertWordInSentenceRandomly($word, $sentence),
65-
3 => $sentence
62+
63+
$options = ['start', 'end', 'anywhere', 'nowhere'];
64+
$sentence = match ($options[array_rand($options)]) {
65+
'start' => "$word $sentence",
66+
'end' => "$sentence $word",
67+
'anywhere' => $this->insertWordInSentenceRandomly($word, $sentence),
68+
'nowhere' => $sentence
6669
};
6770

6871
return [

0 commit comments

Comments
 (0)