We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6cbe6be + f9c83c6 commit 749809bCopy full SHA for 749809b
src/config.js
@@ -37,6 +37,10 @@ function parseConfig (configFile) {
37
* @return {Object}
38
*/
39
function parseComposerJson (composerJsonFile) {
40
+ if (!fs.existsSync(composerJsonFile)) {
41
+ return {};
42
+ }
43
+
44
try {
45
return JSON.parse(fs.readFileSync(composerJsonFile));
46
} catch (error) {
@@ -49,7 +53,12 @@ function parseComposerJson (composerJsonFile) {
49
53
* @return {Array}
50
54
51
55
function gatherVersions (composerJson) {
56
+ if (JSON.stringify(composerJson) === '{}') {
57
+ return [];
58
59
52
60
let versions = [];
61
62
INSTALLABLE_VERSIONS.forEach(function (version) {
63
if (semver.satisfies(version + '.0', composerJson['require']['php'])) {
64
versions.push(version);
0 commit comments