Only use config.platform.php, as it's guaranteed to be the required version of PHP

This commit is contained in:
Jason Gill 2023-07-29 19:48:28 -04:00
parent a5fb328c6a
commit 95916a72b1
3 changed files with 0 additions and 17 deletions

View File

@ -300,13 +300,6 @@ describe('Utils tests', () => {
);
expect(await utils.readPHPVersion()).toBe('7.4.33');
existsSync
.mockReturnValueOnce(false)
.mockReturnValueOnce(false)
.mockReturnValueOnce(true);
readFileSync.mockReturnValue('{ "require": { "php": "^8.2" } }');
expect(await utils.readPHPVersion()).toBe('^8.2');
existsSync.mockClear();
readFileSync.mockClear();
});

4
dist/index.js vendored
View File

@ -1387,10 +1387,6 @@ async function readPHPVersion() {
composerFileContents['config']['platform']['php']) {
return composerFileContents['config']['platform']['php'];
}
if (composerFileContents['require'] &&
composerFileContents['require']['php']) {
return composerFileContents['require']['php'];
}
}
return 'latest';
}

View File

@ -464,12 +464,6 @@ export async function readPHPVersion(): Promise<string> {
) {
return composerFileContents['config']['platform']['php'];
}
if (
composerFileContents['require'] &&
composerFileContents['require']['php']
) {
return composerFileContents['require']['php'];
}
}
return 'latest';