mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Only use config.platform.php, as it's guaranteed to be the required version of PHP
This commit is contained in:
parent
a5fb328c6a
commit
95916a72b1
@ -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
4
dist/index.js
vendored
@ -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';
|
||||
}
|
||||
|
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user