MCPcopy
hub / github.com/shivammathur/setup-php / validatePHPVersionInput

Function validatePHPVersionInput

src/utils.ts:476–483  ·  view source on GitHub ↗
(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
476function 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

Callers 1

readPHPVersionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected