Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
GautierDele authored and StyleCIBot committed Sep 8, 2024
1 parent 2d40ad7 commit 6faccc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Extensions/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected function pickArrayRandomElements(array $array, int $elements = 1)
protected function pickArrayRandomElement(array $array)
{
$elements = $this->pickArrayRandomElements($array);

return reset($elements);
}
}
4 changes: 2 additions & 2 deletions tests/Unit/Extensions/ExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testExtensionPickArrayRandomElements(): void
$elements = range(1, 100);

$method = (new ReflectionClass(Extension::class))->getMethod('pickArrayRandomElements');
$result = $method->invoke(new Extension(new Randomizer), $elements, 5);
$result = $method->invoke(new Extension(new Randomizer()), $elements, 5);

$this->assertCount(
5,
Expand All @@ -53,7 +53,7 @@ public function testExtensionPickArrayRandomElement(): void
$elements = range(1, 100);

$method = (new ReflectionClass(Extension::class))->getMethod('pickArrayRandomElement');
$result = $method->invoke(new Extension(new Randomizer), $elements);
$result = $method->invoke(new Extension(new Randomizer()), $elements);

$this->assertIsNotArray($result);
$this->assertGreaterThanOrEqual(1, $result);
Expand Down

0 comments on commit 6faccc3

Please sign in to comment.