shivammathur / setup-php

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
https://setup-php.com
MIT License
2.89k stars 337 forks source link

Add automatic detection of required PHP version from Composer's platform setting #754

Closed jasongill closed 1 year ago

jasongill commented 1 year ago

name: ⚙ Improvement about: Supports automatic detection of PHP version from composer.lock or composer.json file labels: enhancement


This is related to #751 and should help with #629, #713, and #639.

Description

This PR adds detection of the "config.platform.php" setting available in composer.json (which is also saved as platform-overrides.php in composer.lock), so that the required PHP version for an application using Composer will be automatically detected.

As the config.platform.php setting forces Composer to lock dependencies to a specific PHP version, it's a perfect way to detect the "required" version of PHP for a project without any risk of conflicts due to differing versions.

In case this PR introduced TypeScript/JavaScript code changes:

codecov[bot] commented 1 year ago

Codecov Report

Merging #754 (95916a7) into develop (72ae4cc) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##           develop      #754   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          577       589   +12     
  Branches        92        98    +6     
=========================================
+ Hits           577       589   +12     
Files Changed Coverage Δ
src/utils.ts 100.00% <100.00%> (ø)