From f31d416e6e865c8c85eca84acacfcc30f11a0042 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 1 Aug 2021 19:13:11 +0200 Subject: [PATCH] Update Phive configuration Phive has released version `0.15.0` which ups the minimum supported PHP version to PHP 7.3. This adds the switch statement for Phive to take this into account. Ref: https://github.com/phar-io/phive/releases --- __tests__/tools.test.ts | 1 + dist/index.js | 3 +++ src/tools.ts | 3 +++ 3 files changed, 7 insertions(+) diff --git a/__tests__/tools.test.ts b/__tests__/tools.test.ts index 0b838d8b..388ce164 100644 --- a/__tests__/tools.test.ts +++ b/__tests__/tools.test.ts @@ -201,6 +201,7 @@ describe('Tools tests', () => { version | php_version | os_version | script ${'latest'} | ${'7.4'} | ${'linux'} | ${'add_tool https://phar.io/releases/phive.phar phive'} ${'1.2.3'} | ${'7.4'} | ${'darwin'} | ${'add_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive'} + ${'1.2.3'} | ${'7.2'} | ${'win32'} | ${'Add-Tool https://github.com/phar-io/phive/releases/download/0.14.5/phive-0.14.5.phar phive'} ${'1.2.3'} | ${'7.1'} | ${'win32'} | ${'Add-Tool https://github.com/phar-io/phive/releases/download/0.13.5/phive-0.13.5.phar phive'} ${'latest'} | ${'5.6'} | ${'win32'} | ${'Add-Tool https://github.com/phar-io/phive/releases/download/0.12.1/phive-0.12.1.phar phive'} ${'latest'} | ${'5.5'} | ${'win32'} | ${'Phive is not supported on PHP 5.5'} diff --git a/dist/index.js b/dist/index.js index a8716c48..b2057701 100644 --- a/dist/index.js +++ b/dist/index.js @@ -685,6 +685,9 @@ async function addPhive(data) { case /7\.1/.test(data['php_version']): data['version'] = data['version'].replace('latest', '0.13.5'); break; + case /7\.2/.test(data['php_version']): + data['version'] = data['version'].replace('latest', '0.14.5'); + break; } if (data['version'] === 'latest') { data['domain'] = data['domain'] + '/releases'; diff --git a/src/tools.ts b/src/tools.ts index b60d3cc6..94b1c1b9 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -298,6 +298,9 @@ export async function addPhive(data: RS): Promise { case /7\.1/.test(data['php_version']): data['version'] = data['version'].replace('latest', '0.13.5'); break; + case /7\.2/.test(data['php_version']): + data['version'] = data['version'].replace('latest', '0.14.5'); + break; } if (data['version'] === 'latest') { data['domain'] = data['domain'] + '/releases';