Function
validatePHPVersionInput
(version: string, source: string)
Source from the content-addressed store, hash-verified
| 474 | /^(latest|lowest|highest|nightly|master|pre|pre-installed|\d+\.x|\d+(\.\d+){0,2})$/; |
| 475 | |
| 476 | function validatePHPVersionInput(version: string, source: string): string { |
| 477 | if (!VERSION_INPUT_REGEX.test(version)) { |
| 478 | throw new Error( |
| 479 | `Invalid PHP version in ${source}: ${version.slice(0, 20)}` |
| 480 | ); |
| 481 | } |
| 482 | return version; |
| 483 | } |
| 484 | |
| 485 | /** |
| 486 | * Read php version from input or file |
Tested by
no test coverage detected