Skip to content

Commit

Permalink
feat(manager/composer): extractedConstraints (#19853)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Jan 16, 2023
1 parent df09a94 commit 3c98fc0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Expand Up @@ -205,6 +205,9 @@ exports[`modules/manager/composer/extract extractPackageFile() extracts dependen
"depType": "require-dev",
},
],
"extractedConstraints": {
"php": ">=5.3.2",
},
"lockFiles": [
"composer.lock",
],
Expand Down Expand Up @@ -416,5 +419,8 @@ exports[`modules/manager/composer/extract extractPackageFile() extracts dependen
"depType": "require-dev",
},
],
"extractedConstraints": {
"php": ">=5.3.2",
},
}
`;
3 changes: 3 additions & 0 deletions lib/modules/manager/composer/extract.spec.ts
Expand Up @@ -173,6 +173,9 @@ describe('modules/manager/composer/extract', () => {
registryUrls: ['https://wpackagist.org'],
},
],
extractedConstraints: {
php: '>=5.5',
},
managerData: {
composerJsonType: 'project',
},
Expand Down
5 changes: 5 additions & 0 deletions lib/modules/manager/composer/extract.ts
Expand Up @@ -197,5 +197,10 @@ export async function extractPackageFile(
};
res.managerData = managerData;
}

if (composerJson.require?.php) {
res.extractedConstraints = { php: composerJson.require.php };
}

return res;
}

0 comments on commit 3c98fc0

Please sign in to comment.