Skip to content

Commit

Permalink
Only use config.platform.php, as it's guaranteed to be the required v…
Browse files Browse the repository at this point in the history
…ersion of PHP
  • Loading branch information
jasongill committed Jul 29, 2023
1 parent a5fb328 commit 95916a7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
7 changes: 0 additions & 7 deletions __tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
4 changes: 0 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down
6 changes: 0 additions & 6 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 95916a7

Please sign in to comment.