From 7604a7bf9804d8f46e3e54e0d86e44006f80f512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 28 Nov 2022 10:59:25 +0100 Subject: [PATCH] Fix: Drop support for PHP 7.4 --- .github/settings.yml | 13 +- .github/workflows/integrate.yaml | 11 +- CHANGELOG.md | 2 + composer.json | 10 +- composer.lock | 692 +++++++++++------- phpstan-baseline.neon | 5 + psalm-baseline.xml | 6 + ...rviceLocatorInterfaceAsTypeDeclaration.php | 14 - ...rviceLocatorInterfaceAsTypeDeclaration.php | 12 - ...-locator-interface-as-type-declaration.php | 14 - ...erWithContainerTypeDeclarationRuleTest.php | 32 - 11 files changed, 455 insertions(+), 356 deletions(-) delete mode 100644 test/Fixture/Methods/NoParameterWithContainerTypeDeclarationRule/Failure/ClassWithMethodWithParameterWithServiceLocatorInterfaceAsTypeDeclaration.php delete mode 100644 test/Fixture/Methods/NoParameterWithContainerTypeDeclarationRule/Failure/InterfaceWithMethodWithParameterWithServiceLocatorInterfaceAsTypeDeclaration.php delete mode 100644 test/Fixture/Methods/NoParameterWithContainerTypeDeclarationRule/Failure/anonymous-class-with-method-with-parameter-with-service-locator-interface-as-type-declaration.php diff --git a/.github/settings.yml b/.github/settings.yml index 3bff2753..44243517 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -14,14 +14,11 @@ branches: required_approving_review_count: 1 required_status_checks: contexts: - - "Code Coverage (7.4, locked)" - - "Coding Standards (7.4, locked)" - - "Dependency Analysis (7.4, locked)" - - "Mutation Tests (7.4, locked)" - - "Static Code Analysis (7.4, locked)" - - "Tests (7.4, highest)" - - "Tests (7.4, locked)" - - "Tests (7.4, lowest)" + - "Code Coverage (8.0, locked)" + - "Coding Standards (8.0, locked)" + - "Dependency Analysis (8.0, locked)" + - "Mutation Tests (8.0, locked)" + - "Static Code Analysis (8.0, locked)" - "Tests (8.0, highest)" - "Tests (8.0, locked)" - "Tests (8.0, lowest)" diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 96cc391a..a48d1d29 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -22,7 +22,7 @@ jobs: strategy: matrix: php-version: - - "7.4" + - "8.0" dependencies: - "locked" @@ -90,7 +90,7 @@ jobs: strategy: matrix: php-version: - - "7.4" + - "8.0" dependencies: - "locked" @@ -132,7 +132,7 @@ jobs: strategy: matrix: php-version: - - "7.4" + - "8.0" dependencies: - "locked" @@ -183,7 +183,6 @@ jobs: strategy: matrix: php-version: - - "7.4" - "8.0" - "8.1" @@ -232,7 +231,7 @@ jobs: strategy: matrix: php-version: - - "7.4" + - "8.0" dependencies: - "locked" @@ -282,7 +281,7 @@ jobs: strategy: matrix: php-version: - - "7.4" + - "8.0" dependencies: - "locked" diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cf767fa..7439db6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ For a full diff see [`1.0.0...main`][1.0.0...main]. - Dropped support for PHP 7.2 ([#496]), by [@localheinz] - Dropped support for PHP 7.3 ([#498]), by [@localheinz] +- Dropped support for PHP 7.4 ([#499]), by [@localheinz] ## [`1.0.0`][1.0.0] @@ -454,6 +455,7 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0]. [#395]: https://github.com/ergebnis/phpstan-rules/pull/395 [#496]: https://github.com/ergebnis/phpstan-rules/pull/496 [#498]: https://github.com/ergebnis/phpstan-rules/pull/498 +[#499]: https://github.com/ergebnis/phpstan-rules/pull/498 [@ergebnis]: https://github.com/ergebnis [@Great-Antique]: https://github.com/Great-Antique diff --git a/composer.json b/composer.json index 00524456..595b43a9 100644 --- a/composer.json +++ b/composer.json @@ -31,15 +31,14 @@ "ergebnis/license": "^1.1.0", "ergebnis/php-cs-fixer-config": "^2.14.0", "ergebnis/test-util": "^1.5.0", - "infection/infection": "~0.15.3", + "infection/infection": "~0.22.0", "nette/di": "^3.0.13", "phpstan/phpstan-deprecation-rules": "^1.0.0", "phpstan/phpstan-strict-rules": "^1.1.0", "phpunit/phpunit": "^8.5.26", "psalm/plugin-phpunit": "~0.16.1", "psr/container": "^1.0.0", - "vimeo/psalm": "^4.22", - "zendframework/zend-servicemanager": "^2.0.0" + "vimeo/psalm": "^4.22" }, "autoload": { "psr-4": { @@ -53,10 +52,11 @@ }, "config": { "allow-plugins": { - "ergebnis/composer-normalize": true + "ergebnis/composer-normalize": true, + "infection/extension-installer": true }, "platform": { - "php": "7.4.29" + "php": "8.0.27" }, "preferred-install": "dist", "sort-packages": true diff --git a/composer.lock b/composer.lock index 7001868d..10fe4468 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": "d76d3512f58afc1b06b880e4b16a2261", + "content-hash": "84231a3bd9b723a78a17e13666508afe", "packages": [ { "name": "nikic/php-parser", @@ -512,42 +512,6 @@ ], "time": "2021-03-25T17:01:18+00:00" }, - { - "name": "container-interop/container-interop", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/container-interop/container-interop.git", - "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", - "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", - "shasum": "" - }, - "require": { - "psr/container": "^1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Interop\\Container\\": "src/Interop/Container/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "homepage": "https://github.com/container-interop/container-interop", - "support": { - "issues": "https://github.com/container-interop/container-interop/issues", - "source": "https://github.com/container-interop/container-interop/tree/master" - }, - "abandoned": "psr/container", - "time": "2017-02-14T19:40:03+00:00" - }, { "name": "dnoegel/php-xdg-base-dir", "version": "v0.1.1", @@ -2380,18 +2344,185 @@ ], "time": "2021-05-03T21:43:24+00:00" }, + { + "name": "infection/abstract-testframework-adapter", + "version": "0.3.1", + "source": { + "type": "git", + "url": "https://github.com/infection/abstract-testframework-adapter.git", + "reference": "c52539339f28d6b67625ff24496289b3e6d66025" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/infection/abstract-testframework-adapter/zipball/c52539339f28d6b67625ff24496289b3e6d66025", + "reference": "c52539339f28d6b67625ff24496289b3e6d66025", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.8", + "friendsofphp/php-cs-fixer": "^2.16", + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Infection\\AbstractTestFramework\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Maks Rafalko", + "email": "maks.rafalko@gmail.com" + } + ], + "description": "Abstract Test Framework Adapter for Infection", + "support": { + "issues": "https://github.com/infection/abstract-testframework-adapter/issues", + "source": "https://github.com/infection/abstract-testframework-adapter/tree/0.3" + }, + "time": "2020-08-30T13:50:12+00:00" + }, + { + "name": "infection/extension-installer", + "version": "0.1.2", + "source": { + "type": "git", + "url": "https://github.com/infection/extension-installer.git", + "reference": "9b351d2910b9a23ab4815542e93d541e0ca0cdcf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/infection/extension-installer/zipball/9b351d2910b9a23ab4815542e93d541e0ca0cdcf", + "reference": "9b351d2910b9a23ab4815542e93d541e0ca0cdcf", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1 || ^2.0" + }, + "require-dev": { + "composer/composer": "^1.9 || ^2.0", + "friendsofphp/php-cs-fixer": "^2.18, <2.19", + "infection/infection": "^0.15.2", + "php-coveralls/php-coveralls": "^2.4", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.10", + "phpstan/phpstan-phpunit": "^0.12.6", + "phpstan/phpstan-strict-rules": "^0.12.2", + "phpstan/phpstan-webmozart-assert": "^0.12.2", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.8" + }, + "type": "composer-plugin", + "extra": { + "class": "Infection\\ExtensionInstaller\\Plugin" + }, + "autoload": { + "psr-4": { + "Infection\\ExtensionInstaller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Maks Rafalko", + "email": "maks.rafalko@gmail.com" + } + ], + "description": "Infection Extension Installer", + "support": { + "issues": "https://github.com/infection/extension-installer/issues", + "source": "https://github.com/infection/extension-installer/tree/0.1.2" + }, + "funding": [ + { + "url": "https://github.com/infection", + "type": "github" + }, + { + "url": "https://opencollective.com/infection", + "type": "open_collective" + } + ], + "time": "2021-10-20T22:08:34+00:00" + }, + { + "name": "infection/include-interceptor", + "version": "0.2.5", + "source": { + "type": "git", + "url": "https://github.com/infection/include-interceptor.git", + "reference": "0cc76d95a79d9832d74e74492b0a30139904bdf7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/infection/include-interceptor/zipball/0cc76d95a79d9832d74e74492b0a30139904bdf7", + "reference": "0cc76d95a79d9832d74e74492b0a30139904bdf7", + "shasum": "" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16", + "infection/infection": "^0.15.0", + "phan/phan": "^2.4 || ^3", + "php-coveralls/php-coveralls": "^2.2", + "phpstan/phpstan": "^0.12.8", + "phpunit/phpunit": "^8.5", + "vimeo/psalm": "^3.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Infection\\StreamWrapper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Maks Rafalko", + "email": "maks.rafalko@gmail.com" + } + ], + "description": "Stream Wrapper: Include Interceptor. Allows to replace included (autoloaded) file with another one.", + "support": { + "issues": "https://github.com/infection/include-interceptor/issues", + "source": "https://github.com/infection/include-interceptor/tree/0.2.5" + }, + "funding": [ + { + "url": "https://github.com/infection", + "type": "github" + }, + { + "url": "https://opencollective.com/infection", + "type": "open_collective" + } + ], + "time": "2021-08-09T10:03:57+00:00" + }, { "name": "infection/infection", - "version": "0.15.3", + "version": "0.22.0", "source": { "type": "git", "url": "https://github.com/infection/infection.git", - "reference": "c3fc380317eb14d213e1e1962801ee9325129fb2" + "reference": "d72c1f0959d7302f53580d6ed0f297d88268bc5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/infection/zipball/c3fc380317eb14d213e1e1962801ee9325129fb2", - "reference": "c3fc380317eb14d213e1e1962801ee9325129fb2", + "url": "https://api.github.com/repos/infection/infection/zipball/d72c1f0959d7302f53580d6ed0f297d88268bc5c", + "reference": "d72c1f0959d7302f53580d6ed0f297d88268bc5c", "shasum": "" }, "require": { @@ -2399,29 +2530,43 @@ "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", + "infection/abstract-testframework-adapter": "^0.3.1", + "infection/extension-installer": "^0.1.0", + "infection/include-interceptor": "^0.2.4", "justinrainbow/json-schema": "^5.2", - "nikic/php-parser": "^4.2.2", - "ocramius/package-versions": "^1.2", - "php": "^7.2.9", - "pimple/pimple": "^3.2", + "nikic/php-parser": "^4.10.3", + "ocramius/package-versions": "^1.11.0 || ^2.0", + "ondram/ci-detector": "^3.3.0", + "php": "^7.4.7 || ^8.0", + "sanmai/later": "^0.1.1", + "sanmai/pipeline": "^5.1", "sebastian/diff": "^3.0.2 || ^4.0", "seld/jsonlint": "^1.7", - "symfony/console": "^3.4.29 || ^4.0 || ^5.0", - "symfony/filesystem": "^3.4.29 || ^4.0 || ^5.0", - "symfony/finder": "^3.4.29 || ^4.0 || ^5.0", - "symfony/process": "^3.4.29 || ^4.0 || ^5.0", - "symfony/yaml": "^3.4.29 || ^4.0 || ^5.0", + "symfony/console": "^3.4.29 || ^4.1.19 || ^5.0", + "symfony/filesystem": "^3.4.29 || ^4.1.19 || ^5.0", + "symfony/finder": "^3.4.29 || ^4.1.19 || ^5.0", + "symfony/process": "^3.4.29 || ^4.1.19 || ^5.0", "thecodingmachine/safe": "^1.0", "webmozart/assert": "^1.3", "webmozart/path-util": "^2.3" }, "conflict": { + "phpunit/php-code-coverage": ">9 <9.1.4", "symfony/console": "=4.1.5" }, "require-dev": { + "ext-simplexml": "*", "helmich/phpunit-json-assert": "^3.0", - "phpunit/phpunit": "^8.2.5 <8.4", - "symfony/phpunit-bridge": "^4.3.4 || ^5.0" + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.8", + "phpstan/phpstan-phpunit": "^0.12.6", + "phpstan/phpstan-strict-rules": "^0.12.5", + "phpstan/phpstan-webmozart-assert": "^0.12.2", + "phpunit/phpunit": "^9.3.11", + "symfony/phpunit-bridge": "^4.4.18 || ^5.1.10", + "symfony/yaml": "^5.0", + "thecodingmachine/phpstan-safe-rule": "^1.0" }, "bin": [ "bin/infection" @@ -2477,9 +2622,19 @@ ], "support": { "issues": "https://github.com/infection/infection/issues", - "source": "https://github.com/infection/infection/tree/0.15.3" + "source": "https://github.com/infection/infection/tree/0.22.0" }, - "time": "2020-02-16T19:33:49+00:00" + "funding": [ + { + "url": "https://github.com/infection", + "type": "github" + }, + { + "url": "https://opencollective.com/infection", + "type": "open_collective" + } + ], + "time": "2021-04-24T18:32:05+00:00" }, { "name": "justinrainbow/json-schema", @@ -3213,6 +3368,78 @@ }, "time": "2022-01-24T11:29:14+00:00" }, + { + "name": "ondram/ci-detector", + "version": "3.5.1", + "source": { + "type": "git", + "url": "https://github.com/OndraM/ci-detector.git", + "reference": "594e61252843b68998bddd48078c5058fe9028bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/OndraM/ci-detector/zipball/594e61252843b68998bddd48078c5058fe9028bd", + "reference": "594e61252843b68998bddd48078c5058fe9028bd", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.2", + "lmc/coding-standard": "^1.3 || ^2.0", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpstan/extension-installer": "^1.0.3", + "phpstan/phpstan": "^0.12.0", + "phpstan/phpstan-phpunit": "^0.12.1", + "phpunit/phpunit": "^7.1 || ^8.0 || ^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "OndraM\\CiDetector\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ondřej Machulda", + "email": "ondrej.machulda@gmail.com" + } + ], + "description": "Detect continuous integration environment and provide unified access to properties of current build", + "keywords": [ + "CircleCI", + "Codeship", + "Wercker", + "adapter", + "appveyor", + "aws", + "aws codebuild", + "bamboo", + "bitbucket", + "buddy", + "ci-info", + "codebuild", + "continuous integration", + "continuousphp", + "drone", + "github", + "gitlab", + "interface", + "jenkins", + "teamcity", + "travis" + ], + "support": { + "issues": "https://github.com/OndraM/ci-detector/issues", + "source": "https://github.com/OndraM/ci-detector/tree/main" + }, + "time": "2020-09-04T11:21:14+00:00" + }, { "name": "openlss/lib-array2xml", "version": "1.0.0", @@ -4155,60 +4382,6 @@ ], "time": "2022-04-01T12:34:39+00:00" }, - { - "name": "pimple/pimple", - "version": "v3.3.0", - "source": { - "type": "git", - "url": "https://github.com/silexphp/Pimple.git", - "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/e55d12f9d6a0e7f9c85992b73df1267f46279930", - "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "psr/container": "^1.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^3.4|^4.4|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3.x-dev" - } - }, - "autoload": { - "psr-0": { - "Pimple": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Pimple, a simple Dependency Injection Container", - "homepage": "https://pimple.symfony.com", - "keywords": [ - "container", - "dependency injection" - ], - "support": { - "issues": "https://github.com/silexphp/Pimple/issues", - "source": "https://github.com/silexphp/Pimple/tree/master" - }, - "time": "2020-03-03T09:12:48+00:00" - }, { "name": "psalm/plugin-phpunit", "version": "0.16.1", @@ -4416,6 +4589,129 @@ }, "time": "2021-05-03T11:20:27+00:00" }, + { + "name": "sanmai/later", + "version": "0.1.2", + "source": { + "type": "git", + "url": "https://github.com/sanmai/later.git", + "reference": "9b659fecef2030193fd02402955bc39629d5606f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sanmai/later/zipball/9b659fecef2030193fd02402955bc39629d5606f", + "reference": "9b659fecef2030193fd02402955bc39629d5606f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.13", + "infection/infection": ">=0.10.5", + "phan/phan": ">=2", + "php-coveralls/php-coveralls": "^2.0", + "phpstan/phpstan": ">=0.10", + "phpunit/phpunit": ">=7.4", + "vimeo/psalm": ">=2" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Later\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Alexey Kopytko", + "email": "alexey@kopytko.com" + } + ], + "description": "Later: deferred wrapper object", + "support": { + "issues": "https://github.com/sanmai/later/issues", + "source": "https://github.com/sanmai/later/tree/0.1.2" + }, + "funding": [ + { + "url": "https://github.com/sanmai", + "type": "github" + } + ], + "time": "2021-01-02T10:26:44+00:00" + }, + { + "name": "sanmai/pipeline", + "version": "v5.2.1", + "source": { + "type": "git", + "url": "https://github.com/sanmai/pipeline.git", + "reference": "2b5509a7635143165041109eb1c393c8515724f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sanmai/pipeline/zipball/2b5509a7635143165041109eb1c393c8515724f1", + "reference": "2b5509a7635143165041109eb1c393c8515724f1", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.8", + "friendsofphp/php-cs-fixer": "^3", + "infection/infection": ">=0.10.5", + "league/pipeline": "^1.0 || ^0.3", + "phan/phan": ">=1.1", + "php-coveralls/php-coveralls": "^2.4.1", + "phpstan/phpstan": ">=0.10", + "phpunit/phpunit": "^7.4 || ^8.1 || ^9.4", + "vimeo/psalm": ">=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "v5.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Pipeline\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Alexey Kopytko", + "email": "alexey@kopytko.com" + } + ], + "description": "General-purpose collections pipeline", + "support": { + "issues": "https://github.com/sanmai/pipeline/issues", + "source": "https://github.com/sanmai/pipeline/tree/v5.2.1" + }, + "funding": [ + { + "url": "https://github.com/sanmai", + "type": "github" + } + ], + "time": "2021-11-01T10:09:55+00:00" + }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.2", @@ -5147,23 +5443,24 @@ }, { "name": "seld/jsonlint", - "version": "1.8.2", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337" + "reference": "4211420d25eba80712bff236a98960ef68b866b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/590cfec960b77fd55e39b7d9246659e95dd6d337", - "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/4211420d25eba80712bff236a98960ef68b866b7", + "reference": "4211420d25eba80712bff236a98960ef68b866b7", "shasum": "" }, "require": { "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpstan/phpstan": "^1.5", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" }, "bin": [ "bin/jsonlint" @@ -5194,7 +5491,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/master" + "source": "https://github.com/Seldaek/jsonlint/tree/1.9.0" }, "funding": [ { @@ -5206,7 +5503,7 @@ "type": "tidelift" } ], - "time": "2020-08-25T06:56:57+00:00" + "time": "2022-04-01T13:37:23+00:00" }, { "name": "symfony/console", @@ -6657,98 +6954,18 @@ ], "time": "2022-01-02T09:53:40+00:00" }, - { - "name": "symfony/yaml", - "version": "v5.1.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "ea342353a3ef4f453809acc4ebc55382231d4d23" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ea342353a3ef4f453809acc4ebc55382231d4d23", - "reference": "ea342353a3ef4f453809acc4ebc55382231d4d23", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<4.4" - }, - "require-dev": { - "symfony/console": "^4.4|^5.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "bin": [ - "Resources/bin/yaml-lint" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/5.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-05-20T17:43:50+00:00" - }, { "name": "thecodingmachine/safe", - "version": "v1.1.3", + "version": "v1.3.3", "source": { "type": "git", "url": "https://github.com/thecodingmachine/safe.git", - "reference": "9f277171e296a3c8629c04ac93ec95ff0f208ccb" + "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/9f277171e296a3c8629c04ac93ec95ff0f208ccb", - "reference": "9f277171e296a3c8629c04ac93ec95ff0f208ccb", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/a8ab0876305a4cdaef31b2350fcb9811b5608dbc", + "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc", "shasum": "" }, "require": { @@ -6767,11 +6984,16 @@ }, "autoload": { "files": [ + "deprecated/apc.php", + "deprecated/libevent.php", + "deprecated/mssql.php", + "deprecated/stats.php", + "lib/special_cases.php", "generated/apache.php", - "generated/apc.php", "generated/apcu.php", "generated/array.php", "generated/bzip2.php", + "generated/calendar.php", "generated/classobj.php", "generated/com.php", "generated/cubrid.php", @@ -6800,14 +7022,12 @@ "generated/inotify.php", "generated/json.php", "generated/ldap.php", - "generated/libevent.php", "generated/libxml.php", "generated/lzf.php", "generated/mailparse.php", "generated/mbstring.php", "generated/misc.php", "generated/msql.php", - "generated/mssql.php", "generated/mysql.php", "generated/mysqli.php", "generated/mysqlndMs.php", @@ -6839,7 +7059,6 @@ "generated/sqlsrv.php", "generated/ssdeep.php", "generated/ssh2.php", - "generated/stats.php", "generated/stream.php", "generated/strings.php", "generated/swoole.php", @@ -6853,12 +7072,12 @@ "generated/yaml.php", "generated/yaz.php", "generated/zip.php", - "generated/zlib.php", - "lib/special_cases.php" + "generated/zlib.php" ], "psr-4": { "Safe\\": [ "lib/", + "deprecated/", "generated/" ] } @@ -6870,9 +7089,9 @@ "description": "PHP core functions that throw exceptions instead of returning FALSE on error", "support": { "issues": "https://github.com/thecodingmachine/safe/issues", - "source": "https://github.com/thecodingmachine/safe/tree/master" + "source": "https://github.com/thecodingmachine/safe/tree/v1.3.3" }, - "time": "2020-07-10T09:34:29+00:00" + "time": "2020-10-28T17:51:34+00:00" }, { "name": "theseer/tokenizer", @@ -7138,63 +7357,6 @@ }, "abandoned": "symfony/filesystem", "time": "2015-12-17T08:42:14+00:00" - }, - { - "name": "zendframework/zend-servicemanager", - "version": "2.7.11", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-servicemanager.git", - "reference": "99ec9ed5d0f15aed9876433c74c2709eb933d4c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/99ec9ed5d0f15aed9876433c74c2709eb933d4c7", - "reference": "99ec9ed5d0f15aed9876433c74c2709eb933d4c7", - "shasum": "" - }, - "require": { - "container-interop/container-interop": "~1.0", - "php": "^5.5 || ^7.0" - }, - "require-dev": { - "athletic/athletic": "dev-master", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-di": "~2.5", - "zendframework/zend-mvc": "~2.5" - }, - "suggest": { - "ocramius/proxy-manager": "ProxyManager 0.5.* to handle lazy initialization of services", - "zendframework/zend-di": "Zend\\Di component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\ServiceManager\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-servicemanager", - "keywords": [ - "servicemanager", - "zf2" - ], - "support": { - "issues": "https://github.com/zendframework/zend-servicemanager/issues", - "source": "https://github.com/zendframework/zend-servicemanager/tree/release-2.7.11" - }, - "abandoned": "laminas/laminas-servicemanager", - "time": "2018-06-22T14:49:54+00:00" } ], "aliases": [], @@ -7208,7 +7370,7 @@ }, "platform-dev": [], "platform-overrides": { - "php": "7.4.29" + "php": "8.0.27" }, "plugin-api-version": "2.3.0" } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f11eb45d..f0be713b 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -40,3 +40,8 @@ parameters: count: 1 path: src/Functions/NoNullableReturnTypeDeclarationRule.php + - + message: "#^Class Zend\\\\ServiceManager\\\\ServiceLocatorInterface not found\\.$#" + count: 1 + path: test/Integration/Methods/NoParameterWithContainerTypeDeclarationRuleTest.php + diff --git a/psalm-baseline.xml b/psalm-baseline.xml index befc467f..2e87e23b 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -51,4 +51,10 @@ iterable + + + + ServiceManager\ServiceLocatorInterface + + diff --git a/test/Fixture/Methods/NoParameterWithContainerTypeDeclarationRule/Failure/ClassWithMethodWithParameterWithServiceLocatorInterfaceAsTypeDeclaration.php b/test/Fixture/Methods/NoParameterWithContainerTypeDeclarationRule/Failure/ClassWithMethodWithParameterWithServiceLocatorInterfaceAsTypeDeclaration.php deleted file mode 100644 index d4c62952..00000000 --- a/test/Fixture/Methods/NoParameterWithContainerTypeDeclarationRule/Failure/ClassWithMethodWithParameterWithServiceLocatorInterfaceAsTypeDeclaration.php +++ /dev/null @@ -1,14 +0,0 @@ - [ - __DIR__ . '/../../Fixture/Methods/NoParameterWithContainerTypeDeclarationRule/Failure/anonymous-class-with-method-with-parameter-with-service-locator-interface-as-type-declaration.php', - [ - \sprintf( - 'Method __construct() in anonymous class has a parameter $container with a type declaration of %s, but containers should not be injected.', - ServiceManager\ServiceLocatorInterface::class - ), - 11, - ], - ], 'class-implementing-container-interface-with-method-with-parameter-with-self-as-type-declaration' => [ __DIR__ . '/../../Fixture/Methods/NoParameterWithContainerTypeDeclarationRule/Failure/ClassImplementingContainerInterfaceWithMethodWithParameterWithSelfAsTypeDeclaration.php', [ @@ -132,17 +122,6 @@ public function provideCasesWhereAnalysisShouldFail(): iterable 9, ], ], - 'class-with-method-with-parameter-with-service-locator-interface-as-type-declaration' => [ - __DIR__ . '/../../Fixture/Methods/NoParameterWithContainerTypeDeclarationRule/Failure/ClassWithMethodWithParameterWithServiceLocatorInterfaceAsTypeDeclaration.php', - [ - \sprintf( - 'Method %s::method() has a parameter $container with a type declaration of %s, but containers should not be injected.', - Fixture\Methods\NoParameterWithContainerTypeDeclarationRule\Failure\ClassWithMethodWithParameterWithServiceLocatorInterfaceAsTypeDeclaration::class, - ServiceManager\ServiceLocatorInterface::class - ), - 11, - ], - ], 'interface-with-method-with-parameter-with-container-interface-as-type-declaration' => [ __DIR__ . '/../../Fixture/Methods/NoParameterWithContainerTypeDeclarationRule/Failure/InterfaceWithMethodWithParameterWithContainerInterfaceAsTypeDeclaration.php', [ @@ -154,17 +133,6 @@ public function provideCasesWhereAnalysisShouldFail(): iterable 11, ], ], - 'interface-with-method-with-parameter-with-service-locator-interface-as-type-declaration' => [ - __DIR__ . '/../../Fixture/Methods/NoParameterWithContainerTypeDeclarationRule/Failure/InterfaceWithMethodWithParameterWithServiceLocatorInterfaceAsTypeDeclaration.php', - [ - \sprintf( - 'Method %s::method() has a parameter $container with a type declaration of %s, but containers should not be injected.', - Fixture\Methods\NoParameterWithContainerTypeDeclarationRule\Failure\InterfaceWithMethodWithParameterWithServiceLocatorInterfaceAsTypeDeclaration::class, - ServiceManager\ServiceLocatorInterface::class - ), - 11, - ], - ], ]; foreach ($paths as $description => [$path, $error]) {