Drop support for PHP 7.1

The maintenance burden that comes with using bamarni/composer-bin-plugin
and ensuring both PHPStan and Psalm can still analyse PHPUnit files is too high.
This commit is contained in:
Grégoire Paris
2024-05-06 20:45:06 +02:00
parent a321d114e0
commit 7574a220d6
16 changed files with 16 additions and 2544 deletions

1
.gitattributes vendored
View File

@@ -9,4 +9,3 @@
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/tests export-ignore
/vendor-bin export-ignore

View File

@@ -21,7 +21,6 @@ jobs:
strategy:
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
@@ -40,13 +39,10 @@ jobs:
tools: "cs2pr"
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"
- name: "Install phpunit with composer"
run: "composer bin phpunit install --no-interaction --no-progress --no-suggest"
- name: "Test fixes"
run: "vendor/bin/phpunit --coverage-text"
@@ -72,16 +68,10 @@ jobs:
tools: "cs2pr"
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"
- name: "Install phpunit with composer"
run: "composer bin phpunit install --no-interaction --no-progress --no-suggest"
- name: "Install phpstan with composer"
run: "composer bin phpstan install --no-interaction --no-progress --no-suggest"
- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr"
@@ -106,16 +96,10 @@ jobs:
php-version: "${{ matrix.php-version }}"
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"
- name: "Install phpunit with composer"
run: "composer bin phpunit install --no-interaction --no-progress --no-suggest"
- name: "Install psalm with composer"
run: "composer bin all install --no-interaction --no-progress --no-suggest"
- name: "Run a static analysis with vimeo/psalm"
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=4"
@@ -139,18 +123,10 @@ jobs:
php-version: "${{ matrix.php-version }}"
tools: "cs2pr"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1"
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v3"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}-${{ hashFiles('vendor-bin/*/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"
- name: "Install phpcs with composer"
run: "composer bin all install --no-interaction --no-progress --no-suggest"
dependency-versions: "highest"
# Remove -q when updating to phpcs v4
- name: "Run squizlabs/php_codesniffer"

3
.gitignore vendored
View File

@@ -1,5 +1,4 @@
/.phpunit.result.cache
/.phpcs-cache
vendor/
vendor-bin/**/vendor
vendor-bin/phpunit/composer.lock
/composer.lock

View File

@@ -8,7 +8,6 @@ Make sure you read our [contributing guide][contributing guide on the website].
```shell
composer install
composer bin all install
```
## Running checks locally

View File

@@ -6,10 +6,13 @@
"license": "MIT",
"type": "library",
"require": {
"php": "^7.1 || ^8.0"
"php": "^7.2 || ^8.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4"
"doctrine/coding-standard": "^9.0",
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.6",
"vimeo/psalm": "^4.11"
},
"authors": [
{
@@ -29,12 +32,9 @@
}
},
"config": {
"allow-plugins": {
"bamarni/composer-bin-plugin": true
},
"sort-packages": true,
"platform": {
"php": "7.1.0"
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"bin": ["bin/sql-formatter"]

View File

@@ -28,4 +28,6 @@ require_once __DIR__ . '/../vendor/autoload.php';
use Doctrine\SqlFormatter\SqlFormatter;
use Doctrine\SqlFormatter\Tokenizer;
assert($sql !== false);
echo (new SqlFormatter())->format($sql);

View File

@@ -4,5 +4,3 @@ parameters:
- %currentWorkingDirectory%/src
- %currentWorkingDirectory%/tests
- %currentWorkingDirectory%/examples
bootstrapFiles:
- %currentWorkingDirectory%/vendor-bin/phpunit/vendor/autoload.php

View File

@@ -5,7 +5,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
autoloader="tests/psalm-autoloader.php"
>
<projectFiles>
<directory name="examples" />

View File

@@ -1,5 +0,0 @@
<?php
declare(strict_types=1);
require __DIR__ . '/../vendor-bin/phpunit/vendor/autoload.php';

View File

@@ -1,11 +0,0 @@
{
"require": {
"doctrine/coding-standard": "^9.0"
},
"config": {
"sort-packages": true,
"platform": {
"php": "7.4.0"
}
}
}

View File

@@ -1,313 +0,0 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5c0c33078c6050b3a2ac0478646ea43a",
"packages": [
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
"version": "v0.7.1",
"source": {
"type": "git",
"url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
"reference": "fe390591e0241955f22eb9ba327d137e501c771c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c",
"reference": "fe390591e0241955f22eb9ba327d137e501c771c",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0",
"php": ">=5.3",
"squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0"
},
"require-dev": {
"composer/composer": "*",
"phpcompatibility/php-compatibility": "^9.0",
"sensiolabs/security-checker": "^4.1.0"
},
"type": "composer-plugin",
"extra": {
"class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
},
"autoload": {
"psr-4": {
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Franck Nijhof",
"email": "franck.nijhof@dealerdirect.com",
"homepage": "http://www.frenck.nl",
"role": "Developer / IT Manager"
}
],
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
"homepage": "http://www.dealerdirect.com",
"keywords": [
"PHPCodeSniffer",
"PHP_CodeSniffer",
"code quality",
"codesniffer",
"composer",
"installer",
"phpcs",
"plugin",
"qa",
"quality",
"standard",
"standards",
"style guide",
"stylecheck",
"tests"
],
"support": {
"issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues",
"source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer"
},
"time": "2020-12-07T18:04:37+00:00"
},
{
"name": "doctrine/coding-standard",
"version": "9.0.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/coding-standard.git",
"reference": "35a2452c6025cb739c3244b3348bcd1604df07d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/coding-standard/zipball/35a2452c6025cb739c3244b3348bcd1604df07d1",
"reference": "35a2452c6025cb739c3244b3348bcd1604df07d1",
"shasum": ""
},
"require": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7",
"php": "^7.1 || ^8.0",
"slevomat/coding-standard": "^7.0.0",
"squizlabs/php_codesniffer": "^3.6.0"
},
"type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Steve Müller",
"email": "st.mueller@dzh-online.de"
}
],
"description": "The Doctrine Coding Standard is a set of PHPCS rules applied to all Doctrine projects.",
"homepage": "https://www.doctrine-project.org/projects/coding-standard.html",
"keywords": [
"checks",
"code",
"coding",
"cs",
"doctrine",
"rules",
"sniffer",
"sniffs",
"standard",
"style"
],
"support": {
"issues": "https://github.com/doctrine/coding-standard/issues",
"source": "https://github.com/doctrine/coding-standard/tree/9.0.0"
},
"time": "2021-04-12T15:11:14+00:00"
},
{
"name": "phpstan/phpdoc-parser",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "dbc093d7af60eff5cd575d2ed761b15ed40bd08e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/dbc093d7af60eff5cd575d2ed761b15ed40bd08e",
"reference": "dbc093d7af60eff5cd575d2ed761b15ed40bd08e",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^9.5",
"symfony/process": "^5.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"PHPStan\\PhpDocParser\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.2.0"
},
"time": "2021-09-16T20:46:02+00:00"
},
{
"name": "slevomat/coding-standard",
"version": "7.0.16",
"source": {
"type": "git",
"url": "https://github.com/slevomat/coding-standard.git",
"reference": "14c324b2f2f0072933036c2f3abaeda16a56dcd3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/slevomat/coding-standard/zipball/14c324b2f2f0072933036c2f3abaeda16a56dcd3",
"reference": "14c324b2f2f0072933036c2f3abaeda16a56dcd3",
"shasum": ""
},
"require": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7",
"php": "^7.1 || ^8.0",
"phpstan/phpdoc-parser": "^1.0.0",
"squizlabs/php_codesniffer": "^3.6.1"
},
"require-dev": {
"phing/phing": "2.17.0",
"php-parallel-lint/php-parallel-lint": "1.3.1",
"phpstan/phpstan": "0.12.99",
"phpstan/phpstan-deprecation-rules": "0.12.6",
"phpstan/phpstan-phpunit": "0.12.22",
"phpstan/phpstan-strict-rules": "0.12.11",
"phpunit/phpunit": "7.5.20|8.5.5|9.5.10"
},
"type": "phpcodesniffer-standard",
"extra": {
"branch-alias": {
"dev-master": "7.x-dev"
}
},
"autoload": {
"psr-4": {
"SlevomatCodingStandard\\": "SlevomatCodingStandard"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.",
"support": {
"issues": "https://github.com/slevomat/coding-standard/issues",
"source": "https://github.com/slevomat/coding-standard/tree/7.0.16"
},
"funding": [
{
"url": "https://github.com/kukulich",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard",
"type": "tidelift"
}
],
"time": "2021-10-22T06:56:51+00:00"
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.6.1",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e",
"reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e",
"shasum": ""
},
"require": {
"ext-simplexml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"bin": [
"bin/phpcs",
"bin/phpcbf"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Greg Sherwood",
"role": "lead"
}
],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
"keywords": [
"phpcs",
"standards"
],
"support": {
"issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
"time": "2021-10-11T04:00:11+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"platform-overrides": {
"php": "7.4.0"
},
"plugin-api-version": "2.1.0"
}

View File

@@ -1,11 +0,0 @@
{
"require": {
"phpstan/phpstan": "^1.0"
},
"config": {
"sort-packages": true,
"platform": {
"php": "7.4.0"
}
}
}

View File

@@ -1,86 +0,0 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "14231285484fa4c80ce7f2f3573d9b03",
"packages": [
{
"name": "phpstan/phpstan",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "e9e2a501102ba0b126b2f63a7f0a3b151056fe91"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e9e2a501102ba0b126b2f63a7f0a3b151056fe91",
"reference": "e9e2a501102ba0b126b2f63a7f0a3b151056fe91",
"shasum": ""
},
"require": {
"php": "^7.1|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
},
"bin": [
"phpstan",
"phpstan.phar"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.0.2"
},
"funding": [
{
"url": "https://github.com/ondrejmirtes",
"type": "github"
},
{
"url": "https://github.com/phpstan",
"type": "github"
},
{
"url": "https://www.patreon.com/phpstan",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
"type": "tidelift"
}
],
"time": "2021-11-03T16:09:51+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"platform-overrides": {
"php": "7.4.0"
},
"plugin-api-version": "2.1.0"
}

View File

@@ -1,8 +0,0 @@
{
"require": {
"phpunit/phpunit": "^7.0 || 8.0 || 9.5"
},
"config": {
"sort-packages": true
}
}

View File

@@ -1,11 +0,0 @@
{
"require": {
"vimeo/psalm": "^4.11"
},
"config": {
"sort-packages": true,
"platform": {
"php": "7.4.0"
}
}
}

File diff suppressed because it is too large Load Diff