From f90ea6afdf6c24da179331ff0918dcb2b3d66120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 28 Dec 2021 17:58:44 +0100 Subject: [PATCH] Fix: Remove phpstan/phpstan --- .gitattributes | 2 - .github/CONTRIBUTING.md | 6 +- .github/workflows/integrate.yaml | 13 - Makefile | 8 +- composer.json | 7 - composer.lock | 427 +------------------------------ phpstan-baseline.neon | 37 --- phpstan.neon | 23 -- 8 files changed, 14 insertions(+), 509 deletions(-) delete mode 100644 phpstan-baseline.neon delete mode 100644 phpstan.neon diff --git a/.gitattributes b/.gitattributes index 40b1c53f..5fa8a182 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,7 +8,5 @@ /composer-require-checker.json export-ignore /infection.json export-ignore /Makefile export-ignore -/phpstan-baseline.neon export-ignore -/phpstan.neon export-ignore /psalm-baseline.xml export-ignore /psalm.xml export-ignore diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6cc549a6..83182235 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -60,7 +60,7 @@ to run mutation tests. ## Static Code Analysis -We are using [`phpstan/phpstan`](https://github.com/phpstan/phpstan) and [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code. +We are using [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code. Run @@ -70,7 +70,7 @@ $ make static-code-analysis to run a static code analysis. -We are also using the baseline features of [`phpstan/phpstan`](https://medium.com/@ondrejmirtes/phpstans-baseline-feature-lets-you-hold-new-code-to-a-higher-standard-e77d815a5dff) and [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file). +We are also using the baseline features of [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file). Run @@ -78,7 +78,7 @@ Run $ make static-code-analysis-baseline ``` -to regenerate the baselines in [`../phpstan-baseline.neon`](../phpstan-baseline.neon) and [`../psalm-baseline.xml`](../psalm-baseline.xml). +to regenerate the baseline [`../psalm-baseline.xml`](../psalm-baseline.xml). :exclamation: Ideally, the baselines should shrink over time. diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index c1960031..728dd1fe 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -252,19 +252,6 @@ jobs: with: dependencies: "${{ matrix.dependencies }}" - - name: "Create cache directory for phpstan/phpstan" - run: "mkdir -p .build/phpstan" - - - name: "Cache cache directory for phpstan/phpstan" - uses: "actions/cache@v2.1.7" - with: - path: ".build/phpstan" - key: "php-${{ matrix.php-version }}-phpstan-${{ github.sha }}" - restore-keys: "php-${{ matrix.php-version }}-phpstan-" - - - name: "Run phpstan/phpstan" - run: "vendor/bin/phpstan analyse --configuration=phpstan.neon --memory-limit=-1" - - name: "Create cache directory for vimeo/psalm" run: "mkdir -p .build/psalm" diff --git a/Makefile b/Makefile index 3406092e..ad8771ec 100644 --- a/Makefile +++ b/Makefile @@ -30,16 +30,12 @@ mutation-tests: vendor ## Runs mutation tests with infection/infection vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=${MIN_COVERED_MSI} --min-msi=${MIN_MSI} .PHONY: static-code-analysis -static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan and vimeo/psalm - mkdir -p .build/phpstan - vendor/bin/phpstan analyse --configuration=phpstan.neon --memory-limit=-1 +static-code-analysis: vendor ## Runs a static code analysis with vimeo/psalm mkdir -p .build/psalm vendor/bin/psalm --config=psalm.xml --diff --show-info=false --stats --threads=4 .PHONY: static-code-analysis-baseline -static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with phpstan/phpstan and vimeo/psalm - mkdir -p .build/phpstan - vendor/bin/phpstan analyze --configuration=phpstan.neon --generate-baseline=phpstan-baseline.neon +static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with vimeo/psalm mkdir -p .build/psalm vendor/bin/psalm --config=psalm.xml --set-baseline=psalm-baseline.xml diff --git a/composer.json b/composer.json index cf6eee2e..0353fe77 100644 --- a/composer.json +++ b/composer.json @@ -27,15 +27,8 @@ "require-dev": { "ergebnis/license": "^1.1.0", "ergebnis/php-cs-fixer-config": "^2.14.0", - "ergebnis/phpstan-rules": "~0.15.3", "ergebnis/test-util": "^1.5.0", "infection/infection": "~0.15.3", - "jangregor/phpstan-prophecy": "~0.8.1", - "phpstan/extension-installer": "^1.1.0", - "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": "^8.5.22", "psalm/plugin-phpunit": "~0.16.1", "vimeo/psalm": "^4.16.1" diff --git a/composer.lock b/composer.lock index 3e1fd7b7..c42ed4d2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bac4460d4ee3c74e187ea3bb9ae6ac53", + "content-hash": "55e55121675781663d9ef2c58ab60bf9", "packages": [ { "name": "ergebnis/json-printer", @@ -1005,83 +1005,6 @@ ], "time": "2021-05-04T14:04:50+00:00" }, - { - "name": "ergebnis/phpstan-rules", - "version": "0.15.3", - "source": { - "type": "git", - "url": "https://github.com/ergebnis/phpstan-rules.git", - "reference": "78a3dd88893cf3250ba339843503dcea7e9bee64" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/78a3dd88893cf3250ba339843503dcea7e9bee64", - "reference": "78a3dd88893cf3250ba339843503dcea7e9bee64", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "nikic/php-parser": "^4.2.3", - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "~0.11.15 || ~0.12.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.9.0", - "ergebnis/license": "^1.1.0", - "ergebnis/php-cs-fixer-config": "^2.5.1", - "ergebnis/test-util": "^1.3.0", - "infection/infection": "~0.15.3", - "nette/di": "^3.0.1", - "phpstan/phpstan-deprecation-rules": "~0.11.2", - "phpstan/phpstan-strict-rules": "~0.11.1", - "phpunit/phpunit": "^8.5.8", - "psalm/plugin-phpunit": "~0.12.2", - "psr/container": "^1.0.0", - "vimeo/psalm": "^3.18", - "zendframework/zend-servicemanager": "^2.0.0" - }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "rules.neon" - ] - } - }, - "autoload": { - "psr-4": { - "Ergebnis\\PHPStan\\Rules\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Andreas Möller", - "email": "am@localheinz.com" - } - ], - "description": "Provides additional rules for phpstan/phpstan.", - "homepage": "https://github.com/ergebnis/phpstan-rules", - "keywords": [ - "PHPStan", - "phpstan-extreme-rules", - "phpstan-rules" - ], - "support": { - "issues": "https://github.com/ergebnis/phpstan-rules/issues", - "source": "https://github.com/ergebnis/phpstan-rules" - }, - "funding": [ - { - "url": "https://github.com/localheinz", - "type": "github" - } - ], - "time": "2020-10-30T09:50:34+00:00" - }, { "name": "ergebnis/test-util", "version": "1.5.0", @@ -1534,75 +1457,6 @@ }, "time": "2020-02-16T19:33:49+00:00" }, - { - "name": "jangregor/phpstan-prophecy", - "version": "0.8.1", - "source": { - "type": "git", - "url": "https://github.com/Jan0707/phpstan-prophecy.git", - "reference": "f01ca476840c370bbf9c224aed25fca60eecca9d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Jan0707/phpstan-prophecy/zipball/f01ca476840c370bbf9c224aed25fca60eecca9d", - "reference": "f01ca476840c370bbf9c224aed25fca60eecca9d", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^0.12.6" - }, - "conflict": { - "phpspec/prophecy": "<1.7.0,>=2.0.0", - "phpunit/phpunit": "<6.0.0,>=10.0.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.1.1", - "ergebnis/license": "^1.0.0", - "ergebnis/php-cs-fixer-config": "~2.2.0", - "phpspec/prophecy": "^1.7.0", - "phpunit/phpunit": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" - }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "autoload": { - "psr-4": { - "JanGregor\\Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Gregor Emge-Triebel", - "email": "jan@jangregor.me" - } - ], - "description": "Provides a phpstan/phpstan extension for phpspec/prophecy", - "support": { - "issues": "https://github.com/Jan0707/phpstan-prophecy/issues", - "source": "https://github.com/Jan0707/phpstan-prophecy/tree/0.8.1" - }, - "funding": [ - { - "url": "https://www.buymeacoffee.com/localheinz", - "type": "custom" - }, - { - "url": "https://github.com/localheinz", - "type": "github" - } - ], - "time": "2020-10-24T15:04:14+00:00" - }, { "name": "myclabs/deep-copy", "version": "1.10.2", @@ -2214,270 +2068,6 @@ }, "time": "2021-12-08T12:19:24+00:00" }, - { - "name": "phpstan/extension-installer", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/phpstan/extension-installer.git", - "reference": "66c7adc9dfa38b6b5838a9fb728b68a7d8348051" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/66c7adc9dfa38b6b5838a9fb728b68a7d8348051", - "reference": "66c7adc9dfa38b6b5838a9fb728b68a7d8348051", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1 || ^2.0", - "php": "^7.1 || ^8.0", - "phpstan/phpstan": ">=0.11.6" - }, - "require-dev": { - "composer/composer": "^1.8", - "phing/phing": "^2.16.3", - "php-parallel-lint/php-parallel-lint": "^1.2.0", - "phpstan/phpstan-strict-rules": "^0.11 || ^0.12" - }, - "type": "composer-plugin", - "extra": { - "class": "PHPStan\\ExtensionInstaller\\Plugin" - }, - "autoload": { - "psr-4": { - "PHPStan\\ExtensionInstaller\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Composer plugin for automatic installation of PHPStan extensions", - "support": { - "issues": "https://github.com/phpstan/extension-installer/issues", - "source": "https://github.com/phpstan/extension-installer/tree/1.1.0" - }, - "time": "2020-12-13T13:06:13+00:00" - }, - { - "name": "phpstan/phpstan", - "version": "0.12.99", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b4d40f1d759942f523be267a1bab6884f46ca3f7", - "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7", - "shasum": "" - }, - "require": { - "php": "^7.1|^8.0" - }, - "conflict": { - "phpstan/phpstan-shim": "*" - }, - "bin": [ - "phpstan", - "phpstan.phar" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.12-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/0.12.99" - }, - "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-09-12T20:09:55+00:00" - }, - { - "name": "phpstan/phpstan-deprecation-rules", - "version": "0.12.6", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "46dbd43c2db973d2876d6653e53f5c2cc3a01fbb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/46dbd43c2db973d2876d6653e53f5c2cc3a01fbb", - "reference": "46dbd43c2db973d2876d6653e53f5c2cc3a01fbb", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^0.12.60" - }, - "require-dev": { - "phing/phing": "^2.16.3", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.5.20" - }, - "type": "phpstan-extension", - "extra": { - "branch-alias": { - "dev-master": "0.12-dev" - }, - "phpstan": { - "includes": [ - "rules.neon" - ] - } - }, - "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", - "support": { - "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", - "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/0.12.6" - }, - "time": "2020-12-13T10:20:54+00:00" - }, - { - "name": "phpstan/phpstan-phpunit", - "version": "0.12.22", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "7c01ef93bf128b4ac8bdad38c54b2a4fd6b0b3cc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/7c01ef93bf128b4ac8bdad38c54b2a4fd6b0b3cc", - "reference": "7c01ef93bf128b4ac8bdad38c54b2a4fd6b0b3cc", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^0.12.92" - }, - "conflict": { - "phpunit/phpunit": "<7.0" - }, - "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-strict-rules": "^0.12.6", - "phpunit/phpunit": "^9.5" - }, - "type": "phpstan-extension", - "extra": { - "branch-alias": { - "dev-master": "0.12-dev" - }, - "phpstan": { - "includes": [ - "extension.neon", - "rules.neon" - ] - } - }, - "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPUnit extensions and rules for PHPStan", - "support": { - "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/0.12.22" - }, - "time": "2021-08-12T10:53:43+00:00" - }, - { - "name": "phpstan/phpstan-strict-rules", - "version": "0.12.11", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "2b72e8e17d2034145f239126e876e5fb659675e2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/2b72e8e17d2034145f239126e876e5fb659675e2", - "reference": "2b72e8e17d2034145f239126e876e5fb659675e2", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^0.12.96" - }, - "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^0.12.16", - "phpunit/phpunit": "^9.5" - }, - "type": "phpstan-extension", - "extra": { - "branch-alias": { - "dev-master": "0.12-dev" - }, - "phpstan": { - "includes": [ - "rules.neon" - ] - } - }, - "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Extra strict and opinionated rules for PHPStan", - "support": { - "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/0.12.11" - }, - "time": "2021-08-21T11:36:27+00:00" - }, { "name": "phpunit/php-code-coverage", "version": "7.0.15", @@ -4370,20 +3960,21 @@ }, { "name": "symfony/finder", - "version": "v5.3.4", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "17f50e06018baec41551a71a15731287dbaab186" + "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/17f50e06018baec41551a71a15731287dbaab186", - "reference": "17f50e06018baec41551a71a15731287dbaab186", + "url": "https://api.github.com/repos/symfony/finder/zipball/d2f29dac98e96a98be467627bd49c2efb1bc2590", + "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php80": "^1.16" }, "type": "library", @@ -4412,7 +4003,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.3.4" + "source": "https://github.com/symfony/finder/tree/v5.4.0" }, "funding": [ { @@ -4428,7 +4019,7 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:54:19+00:00" + "time": "2021-11-28T15:25:38+00:00" }, { "name": "symfony/options-resolver", @@ -5918,5 +5509,5 @@ "platform-overrides": { "php": "7.2.33" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.2.0" } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon deleted file mode 100644 index 2d768562..00000000 --- a/phpstan-baseline.neon +++ /dev/null @@ -1,37 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Method Ergebnis\\\\Json\\\\Normalizer\\\\Json\\:\\:__construct\\(\\) has parameter \\$decoded with no typehint specified\\.$#" - count: 1 - path: src/Json.php - - - - message: "#^Method Ergebnis\\\\Json\\\\Normalizer\\\\SchemaNormalizer\\:\\:resolveSchema\\(\\) has parameter \\$data with no typehint specified\\.$#" - count: 1 - path: src/SchemaNormalizer.php - - - - message: "#^Anonymous function should return string but returns string\\|null\\.$#" - count: 1 - path: src/Vendor/Composer/PackageHashNormalizer.php - - - - message: "#^Parameter \\#2 \\$className of static method Ergebnis\\\\Json\\\\Normalizer\\\\Test\\\\Unit\\\\AbstractNormalizerTestCase\\:\\:assertClassImplementsInterface\\(\\) expects class\\-string, string given\\.$#" - count: 1 - path: test/Unit/AbstractNormalizerTestCase.php - - - - message: "#^Parameter \\#2 \\$className of static method Ergebnis\\\\Json\\\\Normalizer\\\\Test\\\\Unit\\\\Exception\\\\AbstractExceptionTestCase\\:\\:assertClassImplementsInterface\\(\\) expects class\\-string, string given\\.$#" - count: 1 - path: test/Unit/Exception/AbstractExceptionTestCase.php - - - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Ergebnis\\\\\\\\Json\\\\\\\\Normalizer\\\\\\\\Json' and Ergebnis\\\\Json\\\\Normalizer\\\\Json will always evaluate to true\\.$#" - count: 1 - path: test/Unit/Format/FormatterTest.php - - - - message: "#^Parameter \\#2 \\$className of static method Ergebnis\\\\Json\\\\Normalizer\\\\Test\\\\Unit\\\\AbstractNormalizerTestCase\\:\\:assertClassImplementsInterface\\(\\) expects class\\-string, string given\\.$#" - count: 1 - path: test/Unit/Vendor/Composer/ComposerJsonNormalizerTest.php - diff --git a/phpstan.neon b/phpstan.neon deleted file mode 100644 index 1c193659..00000000 --- a/phpstan.neon +++ /dev/null @@ -1,23 +0,0 @@ -includes: - - phpstan-baseline.neon - -parameters: - checkMissingIterableValueType: false - - ergebnis: - classesAllowedToBeExtended: - - Ergebnis\Json\Normalizer\Test\Unit\AbstractNormalizerTestCase - - Ergebnis\Json\Normalizer\Test\Unit\Exception\AbstractExceptionTestCase - - Ergebnis\Json\Normalizer\Test\Unit\Vendor\Composer\AbstractComposerTestCase - - InvalidArgumentException - - RuntimeException - - inferPrivatePropertyTypeFromConstructor: true - - level: max - - paths: - - src/ - - test/ - - tmpDir: .build/phpstan/