From 394d45215a4fc909803f23022983bf1f1cf49b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=9D=E3=82=89?= Date: Tue, 5 Sep 2023 20:22:41 +0800 Subject: [PATCH] feat: supports php 5.6 --- .github/workflows/ci.yml | 2 +- README.md | 2 +- src/PHPFmt.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 224e48d..f0a8bdb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [macos-latest, windows-latest] - php-version: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] name: Test on ${{ matrix.os }} & PHP ${{ matrix.php-version }} steps: - name: Checkout diff --git a/README.md b/README.md index 640b493..c356f71 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The missing phpfmt extension for Visual Studio Code. Open command palette `F1` and select `Extensions: Install Extension`, then search for phpfmt. -**Note**: PHP 7.x or newer is required in the machine to run this plugin. +**Note**: PHP 5.6 or newer is required in the machine to run this plugin. ## Usage diff --git a/src/PHPFmt.ts b/src/PHPFmt.ts index a55b0cf..fa829d8 100644 --- a/src/PHPFmt.ts +++ b/src/PHPFmt.ts @@ -217,8 +217,8 @@ export class PHPFmt { throw new PHPFmtError('PHP version < 5.6 or > 8.0'); } } else { - if (semver.lt(phpVersion, '7.0.0')) { - throw new PHPFmtError('PHP version < 7 is not supported'); + if (semver.lt(phpVersion, '5.6.0') || semver.gt(phpVersion, '8.3.0')) { + throw new PHPFmtError('PHP version < 5.6 or > 8.3'); } } } catch (err) {