← All changes
|
vendor/wpfluent/framework/src/WPFluent/Randomizer/Randomizer.php
+3
-2
1.91.6
→
2.1.0
View file →
| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace FluentBoards\Framework\Randomizer; |
| 4 | 4 | |
| 5 | 5 | use Exception; |
| 6 | -use InvalidArgumentException; | |
| 6 | +use FluentBoards\Framework\Support\InvalidArgumentException; | |
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * An implementation of the Randomizer class. |
| 10 | 10 | * @see https://www.php.net/manual/en/class.random-randomizer.php |
| @@ -17,8 +17,9 @@ | ||
| 17 | 17 | private $randomizer; |
| 18 | 18 | |
| 19 | 19 | public function __construct() |
| 20 | 20 | { |
| 21 | + // @phpstan-ignore-next-line | |
| 21 | 22 | $this->randomizer = new \Random\Randomizer(); |
| 22 | 23 | } |
| 23 | 24 | |
| 24 | 25 | public function getBytesFromString(string $string, int $length): string |
| @@ -56,9 +57,9 @@ | ||
| 56 | 57 | |
| 57 | 58 | public function getBytesFromString(string $string, int $length) |
| 58 | 59 | { |
| 59 | 60 | if ($length === 0) { |
| 60 | - throw new ValueError('Length cannot be zero.'); | |
| 61 | + throw new InvalidArgumentException('Length cannot be zero.'); | |
| 61 | 62 | } |
| 62 | 63 | |
| 63 | 64 | $sourceLength = strlen($string); |
| 64 | 65 | |