| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public static function generateRandomBytes(int $length): string |
||
| 35 | { |
||
| 36 | Assert::positiveInteger( |
||
| 37 | $length, |
||
| 38 | 'Invalid length received to generate random bytes.', |
||
| 39 | InvalidArgumentException::class, |
||
| 40 | ); |
||
| 41 | |||
| 42 | try { |
||
| 43 | return random_bytes($length); |
||
| 44 | } catch (ValueError) { // @phpstan-ignore-line |
||
| 45 | throw new InvalidArgumentException('Invalid length received to generate random bytes.'); |
||
| 46 | } catch (RandomException) { |
||
| 47 | throw new RuntimeException( |
||
| 48 | 'Cannot generate random bytes, no cryptographically secure random generator available.', |
||
| 49 | ); |
||
| 53 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths