diff --git a/composer.json b/composer.json index 3bac617..cd2d480 100644 --- a/composer.json +++ b/composer.json @@ -20,10 +20,10 @@ "phpstan/phpstan-phpunit": "^2.0.4", "phpstan/phpstan-strict-rules": "^2.0.3", "phpunit/phpunit": "^9.6.22", + "shipmonk/coding-standard": "^0.1.3", "shipmonk/composer-dependency-analyser": "^1.8.1", "shipmonk/dead-code-detector": "^0.9.0", - "shipmonk/name-collision-detector": "^2.1.1", - "slevomat/coding-standard": "^8.16.0" + "shipmonk/name-collision-detector": "^2.1.1" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 854c6a9..5b2228d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2002bdec715c06ab19202f9e94f04849", + "content-hash": "c7e2df2cf10e92a7163b989c71ac0396", "packages": [ { "name": "phpstan/phpstan", - "version": "2.1.12", + "version": "2.1.17", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "96dde49e967c0c22812bcfa7bda4ff82c09f3b0c" + "reference": "89b5ef665716fa2a52ecd2633f21007a6a349053" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/96dde49e967c0c22812bcfa7bda4ff82c09f3b0c", - "reference": "96dde49e967c0c22812bcfa7bda4ff82c09f3b0c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/89b5ef665716fa2a52ecd2633f21007a6a349053", + "reference": "89b5ef665716fa2a52ecd2633f21007a6a349053", "shasum": "" }, "require": { @@ -62,7 +62,7 @@ "type": "github" } ], - "time": "2025-04-16T13:19:18+00:00" + "time": "2025-05-21T20:55:28+00:00" } ], "packages-dev": [ @@ -216,16 +216,16 @@ }, { "name": "editorconfig-checker/editorconfig-checker", - "version": "10.6.0", + "version": "10.7.0", "source": { "type": "git", "url": "https://github.com/editorconfig-checker/editorconfig-checker.php.git", - "reference": "c51272f825bf0aa02421d47825a8d5f1f2c15049" + "reference": "eb2581bee39d10e776e69048a88fb10a76a0cc9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/editorconfig-checker/editorconfig-checker.php/zipball/c51272f825bf0aa02421d47825a8d5f1f2c15049", - "reference": "c51272f825bf0aa02421d47825a8d5f1f2c15049", + "url": "https://api.github.com/repos/editorconfig-checker/editorconfig-checker.php/zipball/eb2581bee39d10e776e69048a88fb10a76a0cc9f", + "reference": "eb2581bee39d10e776e69048a88fb10a76a0cc9f", "shasum": "" }, "require": { @@ -264,26 +264,26 @@ "issues": "https://github.com/editorconfig-checker/editorconfig-checker.php/issues", "source": "https://github.com/editorconfig-checker/editorconfig-checker.php" }, - "time": "2024-03-04T12:55:53+00:00" + "time": "2025-03-17T14:59:08+00:00" }, { "name": "ergebnis/composer-normalize", - "version": "2.45.0", + "version": "2.47.0", "source": { "type": "git", "url": "https://github.com/ergebnis/composer-normalize.git", - "reference": "bb82b484bed2556da6311b9eff779fa7e73ce937" + "reference": "ed24b9f8901f8fbafeca98f662eaca39427f0544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/bb82b484bed2556da6311b9eff779fa7e73ce937", - "reference": "bb82b484bed2556da6311b9eff779fa7e73ce937", + "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/ed24b9f8901f8fbafeca98f662eaca39427f0544", + "reference": "ed24b9f8901f8fbafeca98f662eaca39427f0544", "shasum": "" }, "require": { "composer-plugin-api": "^2.0.0", "ergebnis/json": "^1.4.0", - "ergebnis/json-normalizer": "^4.8.0", + "ergebnis/json-normalizer": "^4.9.0", "ergebnis/json-printer": "^3.7.0", "ext-json": "*", "justinrainbow/json-schema": "^5.2.12 || ^6.0.0", @@ -293,17 +293,17 @@ "require-dev": { "composer/composer": "^2.8.3", "ergebnis/license": "^2.6.0", - "ergebnis/php-cs-fixer-config": "^6.39.0", - "ergebnis/phpunit-slow-test-detector": "^2.17.0", + "ergebnis/php-cs-fixer-config": "^6.46.0", + "ergebnis/phpunit-slow-test-detector": "^2.19.1", "fakerphp/faker": "^1.24.1", "infection/infection": "~0.26.6", "phpstan/extension-installer": "^1.4.3", - "phpstan/phpstan": "^1.12.12", - "phpstan/phpstan-deprecation-rules": "^1.2.1", - "phpstan/phpstan-phpunit": "^1.4.1", - "phpstan/phpstan-strict-rules": "^1.6.1", + "phpstan/phpstan": "^2.1.11", + "phpstan/phpstan-deprecation-rules": "^2.0.1", + "phpstan/phpstan-phpunit": "^2.0.6", + "phpstan/phpstan-strict-rules": "^2.0.4", "phpunit/phpunit": "^9.6.20", - "rector/rector": "^1.2.10", + "rector/rector": "^2.0.11", "symfony/filesystem": "^5.4.41" }, "type": "composer-plugin", @@ -347,7 +347,7 @@ "security": "https://github.com/ergebnis/composer-normalize/blob/main/.github/SECURITY.md", "source": "https://github.com/ergebnis/composer-normalize" }, - "time": "2024-12-04T18:36:37+00:00" + "time": "2025-04-15T11:09:27+00:00" }, { "name": "ergebnis/json", @@ -419,16 +419,16 @@ }, { "name": "ergebnis/json-normalizer", - "version": "4.8.0", + "version": "4.9.0", "source": { "type": "git", "url": "https://github.com/ergebnis/json-normalizer.git", - "reference": "e3a477b62808f377f4fc69a50f9eb66ec102747b" + "reference": "cc4dcf3890448572a2d9bea97133c4d860e59fb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/e3a477b62808f377f4fc69a50f9eb66ec102747b", - "reference": "e3a477b62808f377f4fc69a50f9eb66ec102747b", + "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/cc4dcf3890448572a2d9bea97133c4d860e59fb1", + "reference": "cc4dcf3890448572a2d9bea97133c4d860e59fb1", "shasum": "" }, "require": { @@ -497,7 +497,7 @@ "security": "https://github.com/ergebnis/json-normalizer/blob/main/.github/SECURITY.md", "source": "https://github.com/ergebnis/json-normalizer" }, - "time": "2024-12-04T16:48:55+00:00" + "time": "2025-04-10T13:13:04+00:00" }, { "name": "ergebnis/json-pointer", @@ -714,137 +714,22 @@ }, "time": "2024-11-18T06:32:28+00:00" }, - { - "name": "icecave/parity", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/icecave/parity.git", - "reference": "4fe835483e0f89f0f96763c47cb9fdca26c24bdc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/icecave/parity/zipball/4fe835483e0f89f0f96763c47cb9fdca26c24bdc", - "reference": "4fe835483e0f89f0f96763c47cb9fdca26c24bdc", - "shasum": "" - }, - "require": { - "icecave/repr": "^4", - "php": ">=7.3" - }, - "require-dev": { - "eloquent/liberator": "^2", - "eloquent/phony": "^5", - "eloquent/phony-phpunit": "^7", - "friendsofphp/php-cs-fixer": "^2", - "phpunit/phpunit": "^9" - }, - "type": "library", - "autoload": { - "psr-4": { - "Icecave\\Parity\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "James Harris", - "email": "mailjamesharris@gmail.com", - "homepage": "https://github.com/jmalloc" - } - ], - "description": "A customizable deep comparison library.", - "homepage": "https://github.com/icecave/parity", - "keywords": [ - "compare", - "comparison", - "equal", - "equality", - "greater", - "less", - "sort", - "sorting" - ], - "support": { - "issues": "https://github.com/icecave/parity/issues", - "source": "https://github.com/icecave/parity/tree/3.0.1" - }, - "time": "2021-02-04T05:51:24+00:00" - }, - { - "name": "icecave/repr", - "version": "4.0.0", - "source": { - "type": "git", - "url": "https://github.com/icecave/repr.git", - "reference": "3dad35ee43394404ae0f1926d754e7b7820da8e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/icecave/repr/zipball/3dad35ee43394404ae0f1926d754e7b7820da8e4", - "reference": "3dad35ee43394404ae0f1926d754e7b7820da8e4", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "eloquent/phony-phpunit": "^6", - "friendsofphp/php-cs-fixer": "^2", - "phpunit/phpunit": "^8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Icecave\\Repr\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "James Harris", - "email": "mailjamesharris@gmail.com", - "homepage": "https://github.com/jmalloc" - } - ], - "description": "A library for generating string representations of any value, inspired by Python's reprlib library.", - "homepage": "https://github.com/icecave/repr", - "keywords": [ - "human", - "readable", - "repr", - "representation", - "string" - ], - "support": { - "issues": "https://github.com/icecave/repr/issues", - "source": "https://github.com/icecave/repr/tree/4.0.0" - }, - "time": "2020-08-25T02:05:11+00:00" - }, { "name": "justinrainbow/json-schema", - "version": "6.2.0", + "version": "6.4.2", "source": { "type": "git", "url": "https://github.com/jsonrainbow/json-schema.git", - "reference": "460c0a09407f4d0d47679476745c4185ff0f1961" + "reference": "ce1fd2d47799bb60668643bc6220f6278a4c1d02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/460c0a09407f4d0d47679476745c4185ff0f1961", - "reference": "460c0a09407f4d0d47679476745c4185ff0f1961", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/ce1fd2d47799bb60668643bc6220f6278a4c1d02", + "reference": "ce1fd2d47799bb60668643bc6220f6278a4c1d02", "shasum": "" }, "require": { "ext-json": "*", - "icecave/parity": "^3.0", "marc-mabe/php-enum": "^4.0", "php": "^7.2 || ^8.0" }, @@ -900,9 +785,9 @@ ], "support": { "issues": "https://github.com/jsonrainbow/json-schema/issues", - "source": "https://github.com/jsonrainbow/json-schema/tree/6.2.0" + "source": "https://github.com/jsonrainbow/json-schema/tree/6.4.2" }, - "time": "2025-02-26T20:58:15+00:00" + "time": "2025-06-03T18:27:04+00:00" }, { "name": "localheinz/diff", @@ -1034,16 +919,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.0", + "version": "1.13.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414" + "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c", + "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c", "shasum": "" }, "require": { @@ -1082,7 +967,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1" }, "funding": [ { @@ -1090,7 +975,7 @@ "type": "tidelift" } ], - "time": "2025-02-12T12:17:51+00:00" + "time": "2025-04-29T12:36:36+00:00" }, { "name": "nette/schema", @@ -1156,16 +1041,16 @@ }, { "name": "nette/utils", - "version": "v4.0.5", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96" + "reference": "e67c4061eb40b9c113b218214e42cb5a0dda28f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", - "reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", + "url": "https://api.github.com/repos/nette/utils/zipball/e67c4061eb40b9c113b218214e42cb5a0dda28f2", + "reference": "e67c4061eb40b9c113b218214e42cb5a0dda28f2", "shasum": "" }, "require": { @@ -1236,22 +1121,22 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.5" + "source": "https://github.com/nette/utils/tree/v4.0.7" }, - "time": "2024-08-07T15:39:19+00:00" + "time": "2025-06-03T04:55:08+00:00" }, { "name": "nikic/php-parser", - "version": "v5.4.0", + "version": "v5.5.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494" + "reference": "ae59794362fe85e051a58ad36b289443f57be7a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ae59794362fe85e051a58ad36b289443f57be7a9", + "reference": "ae59794362fe85e051a58ad36b289443f57be7a9", "shasum": "" }, "require": { @@ -1294,9 +1179,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.5.0" }, - "time": "2024-12-30T11:07:19+00:00" + "time": "2025-05-31T08:24:38+00:00" }, { "name": "phar-io/manifest", @@ -1465,21 +1350,21 @@ }, { "name": "phpstan/phpstan-deprecation-rules", - "version": "2.0.1", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "1cc1259cb91ee4cfbb5c39bca9f635f067c910b4" + "reference": "468e02c9176891cc901143da118f09dc9505fc2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/1cc1259cb91ee4cfbb5c39bca9f635f067c910b4", - "reference": "1cc1259cb91ee4cfbb5c39bca9f635f067c910b4", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/468e02c9176891cc901143da118f09dc9505fc2f", + "reference": "468e02c9176891cc901143da118f09dc9505fc2f", "shasum": "" }, "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.0" + "phpstan/phpstan": "^2.1.15" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", @@ -1506,22 +1391,22 @@ "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/2.0.1" + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/2.0.3" }, - "time": "2024-11-28T21:56:36+00:00" + "time": "2025-05-14T10:56:57+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "2.0.4", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "d09e152f403c843998d7a52b5d87040c937525dd" + "reference": "6b92469f8a7995e626da3aa487099617b8dfa260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/d09e152f403c843998d7a52b5d87040c937525dd", - "reference": "d09e152f403c843998d7a52b5d87040c937525dd", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/6b92469f8a7995e626da3aa487099617b8dfa260", + "reference": "6b92469f8a7995e626da3aa487099617b8dfa260", "shasum": "" }, "require": { @@ -1532,7 +1417,9 @@ "phpunit/phpunit": "<7.0" }, "require-dev": { + "nikic/php-parser": "^5", "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^2.0", "phpstan/phpstan-strict-rules": "^2.0", "phpunit/phpunit": "^9.6" }, @@ -1557,22 +1444,22 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.4" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.6" }, - "time": "2025-01-22T13:07:38+00:00" + "time": "2025-03-26T12:47:06+00:00" }, { "name": "phpstan/phpstan-strict-rules", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "8b88b5f818bfa301e0c99154ab622dace071c3ba" + "reference": "3e139cbe67fafa3588e1dbe27ca50f31fdb6236a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/8b88b5f818bfa301e0c99154ab622dace071c3ba", - "reference": "8b88b5f818bfa301e0c99154ab622dace071c3ba", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/3e139cbe67fafa3588e1dbe27ca50f31fdb6236a", + "reference": "3e139cbe67fafa3588e1dbe27ca50f31fdb6236a", "shasum": "" }, "require": { @@ -1605,9 +1492,9 @@ "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/2.0.3" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.4" }, - "time": "2025-01-21T10:52:14+00:00" + "time": "2025-03-18T11:42:40+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1930,16 +1817,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.22", + "version": "9.6.23", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" + "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", + "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", "shasum": "" }, "require": { @@ -1950,7 +1837,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.1", + "myclabs/deep-copy": "^1.13.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -2013,7 +1900,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.23" }, "funding": [ { @@ -2024,12 +1911,20 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2024-12-05T13:48:26+00:00" + "time": "2025-05-02T06:40:34+00:00" }, { "name": "sebastian/cli-parser", @@ -2994,18 +2889,66 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "shipmonk/coding-standard", + "version": "0.1.3", + "source": { + "type": "git", + "url": "https://github.com/shipmonk-rnd/coding-standard.git", + "reference": "72ebaaf06383f4bf5189a8076f05343d634ba943" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/shipmonk-rnd/coding-standard/zipball/72ebaaf06383f4bf5189a8076f05343d634ba943", + "reference": "72ebaaf06383f4bf5189a8076f05343d634ba943", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "slevomat/coding-standard": "^8.19.1" + }, + "require-dev": { + "editorconfig-checker/editorconfig-checker": "^10.6", + "ergebnis/composer-normalize": "^2.45", + "ext-simplexml": "*", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", + "shipmonk/composer-dependency-analyser": "^1.8", + "shipmonk/dead-code-detector": "^0.12", + "shipmonk/name-collision-detector": "^2.1", + "shipmonk/phpstan-rules": "^4.1" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "ShipMonk\\CodingStandard\\": "ShipMonkCodingStandard/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP Coding Standard used in ShipMonk", + "support": { + "issues": "https://github.com/shipmonk-rnd/coding-standard/issues", + "source": "https://github.com/shipmonk-rnd/coding-standard/tree/0.1.3" + }, + "time": "2025-06-16T11:43:35+00:00" + }, { "name": "shipmonk/composer-dependency-analyser", - "version": "1.8.2", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/shipmonk-rnd/composer-dependency-analyser.git", - "reference": "f374f5366028fd7ece8aeaffa76895d73dc0a05a" + "reference": "ca6b2725cd4854d97c1ce08e6954a74fbdd25372" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/shipmonk-rnd/composer-dependency-analyser/zipball/f374f5366028fd7ece8aeaffa76895d73dc0a05a", - "reference": "f374f5366028fd7ece8aeaffa76895d73dc0a05a", + "url": "https://api.github.com/repos/shipmonk-rnd/composer-dependency-analyser/zipball/ca6b2725cd4854d97c1ce08e6954a74fbdd25372", + "reference": "ca6b2725cd4854d97c1ce08e6954a74fbdd25372", "shasum": "" }, "require": { @@ -3056,22 +2999,22 @@ ], "support": { "issues": "https://github.com/shipmonk-rnd/composer-dependency-analyser/issues", - "source": "https://github.com/shipmonk-rnd/composer-dependency-analyser/tree/1.8.2" + "source": "https://github.com/shipmonk-rnd/composer-dependency-analyser/tree/1.8.3" }, - "time": "2024-12-30T12:31:04+00:00" + "time": "2025-02-10T13:31:57+00:00" }, { "name": "shipmonk/dead-code-detector", - "version": "0.9.0", + "version": "0.9.2", "source": { "type": "git", "url": "https://github.com/shipmonk-rnd/dead-code-detector.git", - "reference": "c218837a440e69f6ac231fd2f3d0c514d02a241f" + "reference": "a4fef66901d2e282ccf4ff1e60ea2c922046059a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/shipmonk-rnd/dead-code-detector/zipball/c218837a440e69f6ac231fd2f3d0c514d02a241f", - "reference": "c218837a440e69f6ac231fd2f3d0c514d02a241f", + "url": "https://api.github.com/repos/shipmonk-rnd/dead-code-detector/zipball/a4fef66901d2e282ccf4ff1e60ea2c922046059a", + "reference": "a4fef66901d2e282ccf4ff1e60ea2c922046059a", "shasum": "" }, "require": { @@ -3125,9 +3068,9 @@ ], "support": { "issues": "https://github.com/shipmonk-rnd/dead-code-detector/issues", - "source": "https://github.com/shipmonk-rnd/dead-code-detector/tree/0.9.0" + "source": "https://github.com/shipmonk-rnd/dead-code-detector/tree/0.9.2" }, - "time": "2025-03-04T10:44:07+00:00" + "time": "2025-03-07T09:23:22+00:00" }, { "name": "shipmonk/name-collision-detector", @@ -3189,32 +3132,32 @@ }, { "name": "slevomat/coding-standard", - "version": "8.16.0", + "version": "8.19.1", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "7748a4282df19daf966fda1d8c60a8aec803c83a" + "reference": "458d665acd49009efebd7e0cb385d71ae9ac3220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/7748a4282df19daf966fda1d8c60a8aec803c83a", - "reference": "7748a4282df19daf966fda1d8c60a8aec803c83a", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/458d665acd49009efebd7e0cb385d71ae9ac3220", + "reference": "458d665acd49009efebd7e0cb385d71ae9ac3220", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", "php": "^7.4 || ^8.0", "phpstan/phpdoc-parser": "^2.1.0", - "squizlabs/php_codesniffer": "^3.11.3" + "squizlabs/php_codesniffer": "^3.13.0" }, "require-dev": { "phing/phing": "3.0.1", "php-parallel-lint/php-parallel-lint": "1.4.0", - "phpstan/phpstan": "2.1.6", - "phpstan/phpstan-deprecation-rules": "2.0.1", - "phpstan/phpstan-phpunit": "2.0.4", - "phpstan/phpstan-strict-rules": "2.0.3", - "phpunit/phpunit": "9.6.8|10.5.45|11.4.4|11.5.9|12.0.4" + "phpstan/phpstan": "2.1.17", + "phpstan/phpstan-deprecation-rules": "2.0.3", + "phpstan/phpstan-phpunit": "2.0.6", + "phpstan/phpstan-strict-rules": "2.0.4", + "phpunit/phpunit": "9.6.8|10.5.45|11.4.4|11.5.21|12.1.3" }, "type": "phpcodesniffer-standard", "extra": { @@ -3238,7 +3181,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.16.0" + "source": "https://github.com/slevomat/coding-standard/tree/8.19.1" }, "funding": [ { @@ -3250,20 +3193,20 @@ "type": "tidelift" } ], - "time": "2025-02-23T18:12:49+00:00" + "time": "2025-06-09T17:53:57+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.11.3", + "version": "3.13.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10" + "reference": "1b71b4dd7e7ef651ac749cea67e513c0c832f4bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", - "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1b71b4dd7e7ef651ac749cea67e513c0c832f4bd", + "reference": "1b71b4dd7e7ef651ac749cea67e513c0c832f4bd", "shasum": "" }, "require": { @@ -3330,11 +3273,11 @@ "type": "open_collective" }, { - "url": "https://thanks.dev/phpcsstandards", + "url": "https://thanks.dev/u/gh/phpcsstandards", "type": "thanks_dev" } ], - "time": "2025-01-23T17:04:15+00:00" + "time": "2025-06-12T15:04:34+00:00" }, { "name": "theseer/tokenizer", diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 1a5dc97..a3bfedc 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -2,431 +2,25 @@ - - - - - - - - src/ tests/ tests/*/data/* - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Exception type missing for @throws annotation - - - Only 1 @return annotation is allowed in a function comment - - - Extra @param annotation - - - @param annotation for parameter "%s" missing - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Rule/AllowComparingOnlyComparableTypesRule.php b/src/Rule/AllowComparingOnlyComparableTypesRule.php index e2d8c42..49eaaa4 100644 --- a/src/Rule/AllowComparingOnlyComparableTypesRule.php +++ b/src/Rule/AllowComparingOnlyComparableTypesRule.php @@ -38,7 +38,10 @@ public function getNodeType(): string * @param BinaryOp $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if ( !$node instanceof Greater @@ -99,7 +102,10 @@ private function isComparable(Type $type): bool return true; } - private function isComparableTogether(Type $leftType, Type $rightType): bool + private function isComparableTogether( + Type $leftType, + Type $rightType + ): bool { $intType = new IntegerType(); $floatType = new FloatType(); @@ -149,7 +155,10 @@ private function isComparableTogether(Type $leftType, Type $rightType): bool /** * @param Type[] $allowedTypes */ - private function containsOnlyTypes(Type $checkedType, array $allowedTypes): bool + private function containsOnlyTypes( + Type $checkedType, + array $allowedTypes + ): bool { $allowedType = TypeCombinator::union(...$allowedTypes); return $allowedType->isSuperTypeOf($checkedType)->yes(); diff --git a/src/Rule/BackedEnumGenericsRule.php b/src/Rule/BackedEnumGenericsRule.php index 9af8ce6..2890f32 100644 --- a/src/Rule/BackedEnumGenericsRule.php +++ b/src/Rule/BackedEnumGenericsRule.php @@ -27,7 +27,10 @@ public function getNodeType(): string * @param InClassNode $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { $classReflection = $node->getClassReflection(); $backedEnumType = $classReflection->getBackedEnumType(); @@ -55,7 +58,10 @@ public function processNode(Node $node, Scope $scope): array return [$error]; } - private function hasGenericsTag(ClassReflection $classReflection, string $expectedTag): bool + private function hasGenericsTag( + ClassReflection $classReflection, + string $expectedTag + ): bool { if ($classReflection->isBackedEnum()) { $tags = $classReflection->getImplementsTags(); diff --git a/src/Rule/ClassSuffixNamingRule.php b/src/Rule/ClassSuffixNamingRule.php index 94730d0..6d1a057 100644 --- a/src/Rule/ClassSuffixNamingRule.php +++ b/src/Rule/ClassSuffixNamingRule.php @@ -29,7 +29,10 @@ class ClassSuffixNamingRule implements Rule /** * @param array $superclassToSuffixMapping */ - public function __construct(ReflectionProvider $reflectionProvider, array $superclassToSuffixMapping = []) + public function __construct( + ReflectionProvider $reflectionProvider, + array $superclassToSuffixMapping = [] + ) { foreach ($superclassToSuffixMapping as $className => $suffix) { if (!$reflectionProvider->hasClass($className)) { diff --git a/src/Rule/EnforceEnumMatchRule.php b/src/Rule/EnforceEnumMatchRule.php index 7b757a8..29043c4 100644 --- a/src/Rule/EnforceEnumMatchRule.php +++ b/src/Rule/EnforceEnumMatchRule.php @@ -32,7 +32,10 @@ public function getNodeType(): string * @param BinaryOp $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if (!$node instanceof Identical && !$node instanceof NotIdentical) { return []; diff --git a/src/Rule/EnforceIteratorToArrayPreserveKeysRule.php b/src/Rule/EnforceIteratorToArrayPreserveKeysRule.php index 8a022da..b5d9962 100644 --- a/src/Rule/EnforceIteratorToArrayPreserveKeysRule.php +++ b/src/Rule/EnforceIteratorToArrayPreserveKeysRule.php @@ -27,7 +27,10 @@ public function getNodeType(): string * @param FuncCall $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if (!$node->name instanceof Name) { return []; diff --git a/src/Rule/EnforceListReturnRule.php b/src/Rule/EnforceListReturnRule.php index 32f66b2..8b07c0e 100644 --- a/src/Rule/EnforceListReturnRule.php +++ b/src/Rule/EnforceListReturnRule.php @@ -28,7 +28,10 @@ public function getNodeType(): string * @param ReturnStatementsNode $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { $methodReflection = $scope->getFunction(); diff --git a/src/Rule/EnforceNativeReturnTypehintRule.php b/src/Rule/EnforceNativeReturnTypehintRule.php index 7900372..c573b60 100644 --- a/src/Rule/EnforceNativeReturnTypehintRule.php +++ b/src/Rule/EnforceNativeReturnTypehintRule.php @@ -67,7 +67,10 @@ public function getNodeType(): string * @param ReturnStatementsNode $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if ($this->treatPhpDocTypesAsCertain === false) { return []; @@ -202,7 +205,10 @@ private function getTypeOfReturnStatements(ReturnStatementsNode $node): Type return TypeCombinator::union(...$types); } - private function getPhpDocReturnType(Node $node, Scope $scope): ?Type + private function getPhpDocReturnType( + Node $node, + Scope $scope + ): ?Type { $docComment = $node->getDocComment(); diff --git a/src/Rule/EnforceReadonlyPublicPropertyRule.php b/src/Rule/EnforceReadonlyPublicPropertyRule.php index 7d74463..a42ad50 100644 --- a/src/Rule/EnforceReadonlyPublicPropertyRule.php +++ b/src/Rule/EnforceReadonlyPublicPropertyRule.php @@ -32,7 +32,10 @@ public function getNodeType(): string * @param ClassPropertyNode $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if (!$this->phpVersion->supportsReadOnlyProperties()) { return []; diff --git a/src/Rule/ForbidArithmeticOperationOnNonNumberRule.php b/src/Rule/ForbidArithmeticOperationOnNonNumberRule.php index ce40ea8..f95f947 100644 --- a/src/Rule/ForbidArithmeticOperationOnNonNumberRule.php +++ b/src/Rule/ForbidArithmeticOperationOnNonNumberRule.php @@ -44,7 +44,10 @@ public function getNodeType(): string /** * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if ( $node instanceof UnaryPlus @@ -70,7 +73,11 @@ public function processNode(Node $node, Scope $scope): array /** * @return list */ - private function processUnary(Expr $expr, Scope $scope, string $operator): array + private function processUnary( + Expr $expr, + Scope $scope, + string $operator + ): array { $exprType = $scope->getType($expr); @@ -92,7 +99,12 @@ private function processUnary(Expr $expr, Scope $scope, string $operator): array /** * @return list */ - private function processBinary(Expr $left, Expr $right, Scope $scope, string $operator): array + private function processBinary( + Expr $left, + Expr $right, + Scope $scope, + string $operator + ): array { $leftType = $scope->getType($left); $rightType = $scope->getType($right); @@ -130,7 +142,12 @@ private function isNumeric(Type $type): bool /** * @return list */ - private function buildBinaryErrors(string $operator, string $type, Type $leftType, Type $rightType): array + private function buildBinaryErrors( + string $operator, + string $type, + Type $leftType, + Type $rightType + ): array { $errorMessage = sprintf( 'Using %s over %s (%s %s %s)', diff --git a/src/Rule/ForbidCastRule.php b/src/Rule/ForbidCastRule.php index 5a83602..e5cdaed 100644 --- a/src/Rule/ForbidCastRule.php +++ b/src/Rule/ForbidCastRule.php @@ -49,7 +49,10 @@ public function getNodeType(): string * @param Cast $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { $castString = $this->getCastString($node); diff --git a/src/Rule/ForbidCheckedExceptionInCallableRule.php b/src/Rule/ForbidCheckedExceptionInCallableRule.php index 620c1b3..2bec969 100644 --- a/src/Rule/ForbidCheckedExceptionInCallableRule.php +++ b/src/Rule/ForbidCheckedExceptionInCallableRule.php @@ -352,7 +352,10 @@ private function checkClassExistence( * * @param FunctionReflection|MethodReflection $reflection */ - private function isImmediatelyInvokedCallable(object $reflection, ?ParameterReflection $parameter): bool + private function isImmediatelyInvokedCallable( + object $reflection, + ?ParameterReflection $parameter + ): bool { if ($parameter instanceof ExtendedParameterReflection) { $parameterCallImmediately = $parameter->isImmediatelyInvokedCallable(); @@ -411,7 +414,10 @@ private function isAllowedCheckedExceptionCallable( return false; } - private function whitelistAllowedCallables(CallLike $node, Scope $scope): void + private function whitelistAllowedCallables( + CallLike $node, + Scope $scope + ): void { if ($node instanceof MethodCall && $node->name instanceof Identifier) { $callerType = $scope->getType($node->var); @@ -491,7 +497,11 @@ private function whitelistAllowedCallables(CallLike $node, Scope $scope): void /** * @param array $parameters */ - private function getParameterIndex(Arg $arg, int $argumentIndex, array $parameters): ?int + private function getParameterIndex( + Arg $arg, + int $argumentIndex, + array $parameters + ): ?int { if ($arg->name === null) { return $argumentIndex; @@ -534,7 +544,10 @@ private function buildError( return $builder->build(); } - private function getFunctionReflection(Name $functionName, Scope $scope): ?FunctionReflection + private function getFunctionReflection( + Name $functionName, + Scope $scope + ): ?FunctionReflection { return $this->reflectionProvider->hasFunction($functionName, $scope) ? $this->reflectionProvider->getFunction($functionName, $scope) diff --git a/src/Rule/ForbidCustomFunctionsRule.php b/src/Rule/ForbidCustomFunctionsRule.php index 42ffa5f..5cf2487 100644 --- a/src/Rule/ForbidCustomFunctionsRule.php +++ b/src/Rule/ForbidCustomFunctionsRule.php @@ -57,7 +57,10 @@ class ForbidCustomFunctionsRule implements Rule /** * @param array $forbiddenFunctions */ - public function __construct(array $forbiddenFunctions, ReflectionProvider $reflectionProvider) + public function __construct( + array $forbiddenFunctions, + ReflectionProvider $reflectionProvider + ) { $this->reflectionProvider = $reflectionProvider; @@ -98,7 +101,10 @@ public function getNodeType(): string /** * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if ($this->isFirstClassCallableNode($node)) { $node = $node->getOriginalNode(); // @phpstan-ignore shipmonk.variableTypeOverwritten @@ -141,7 +147,10 @@ public function processNode(Node $node, Scope $scope): array /** * @return list */ - private function validateFunctionCall(FuncCall $node, Scope $scope): array + private function validateFunctionCall( + FuncCall $node, + Scope $scope + ): array { $functionNames = $this->getFunctionNames($node->name, $scope); @@ -161,7 +170,10 @@ private function validateFunctionCall(FuncCall $node, Scope $scope): array /** * @return list */ - private function validateCallOverExpr(string $methodName, Type $caller): array + private function validateCallOverExpr( + string $methodName, + Type $caller + ): array { $classNames = $caller->getObjectTypeOrClassStringObjectType()->getObjectClassNames(); $errors = []; @@ -179,7 +191,10 @@ private function validateCallOverExpr(string $methodName, Type $caller): array /** * @return list */ - private function validateMethod(string $methodName, string $className): array + private function validateMethod( + string $methodName, + string $className + ): array { if (!$this->reflectionProvider->hasClass($className)) { return []; @@ -229,7 +244,10 @@ private function validateFunction(string $functionName): array * @param Name|Expr $name * @return list */ - private function getFunctionNames(Node $name, Scope $scope): array + private function getFunctionNames( + Node $name, + Scope $scope + ): array { if ($name instanceof Name) { $functionName = $this->reflectionProvider->resolveFunctionName($name, $scope); @@ -248,7 +266,10 @@ private function getFunctionNames(Node $name, Scope $scope): array * @param Name|Expr|Identifier $name * @return list */ - private function getMethodNames(Node $name, Scope $scope): array + private function getMethodNames( + Node $name, + Scope $scope + ): array { if ($name instanceof Name) { return [$name->toString()]; @@ -315,7 +336,12 @@ private function validateCallable( /** * @return list */ - private function validateCallLikeArguments(Type $caller, string $methodName, CallLike $node, Scope $scope): array + private function validateCallLikeArguments( + Type $caller, + string $methodName, + CallLike $node, + Scope $scope + ): array { if ($node->isFirstClassCallable()) { return []; @@ -369,7 +395,11 @@ private function validateCallableArguments( /** * @return list */ - private function validateFunctionArguments(string $functionName, FuncCall $node, Scope $scope): array + private function validateFunctionArguments( + string $functionName, + FuncCall $node, + Scope $scope + ): array { if ($node->isFirstClassCallable()) { return []; @@ -393,7 +423,11 @@ private function validateFunctionArguments(string $functionName, FuncCall $node, return $this->validateCallableArguments($orderedArgs, $parametersAcceptor, $scope); } - private function getMethodReflection(string $className, string $methodName, Scope $scope): ?ExtendedMethodReflection + private function getMethodReflection( + string $className, + string $methodName, + Scope $scope + ): ?ExtendedMethodReflection { if (!$this->reflectionProvider->hasClass($className)) { return null; @@ -408,14 +442,20 @@ private function getMethodReflection(string $className, string $methodName, Scop return $classReflection->getMethod($methodName, $scope); } - private function getFunctionReflection(Name $functionName, Scope $scope): ?FunctionReflection + private function getFunctionReflection( + Name $functionName, + Scope $scope + ): ?FunctionReflection { return $this->reflectionProvider->hasFunction($functionName, $scope) ? $this->reflectionProvider->getFunction($functionName, $scope) : null; } - private function getNewCaller(New_ $new, Scope $scope): Type + private function getNewCaller( + New_ $new, + Scope $scope + ): Type { if ($new->class instanceof Class_) { $anonymousClassReflection = $this->reflectionProvider->getAnonymousClassReflection($new->class, $scope); diff --git a/src/Rule/ForbidEnumInFunctionArgumentsRule.php b/src/Rule/ForbidEnumInFunctionArgumentsRule.php index 3c471c1..bec3c2e 100644 --- a/src/Rule/ForbidEnumInFunctionArgumentsRule.php +++ b/src/Rule/ForbidEnumInFunctionArgumentsRule.php @@ -56,7 +56,10 @@ public function getNodeType(): string * @param FuncCall $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if (!$node->name instanceof Name) { return []; @@ -109,7 +112,10 @@ public function processNode(Node $node, Scope $scope): array return []; } - private function matchesPosition(int $position, int $forbiddenArgumentPosition): bool + private function matchesPosition( + int $position, + int $forbiddenArgumentPosition + ): bool { return $position === $forbiddenArgumentPosition; } @@ -133,7 +139,10 @@ private function containsEnum(Type $type): bool return $type->isEnum()->yes(); } - private function getFunctionReflection(Name $functionName, Scope $scope): ?FunctionReflection + private function getFunctionReflection( + Name $functionName, + Scope $scope + ): ?FunctionReflection { return $this->reflectionProvider->hasFunction($functionName, $scope) ? $this->reflectionProvider->getFunction($functionName, $scope) diff --git a/src/Rule/ForbidFetchOnMixedRule.php b/src/Rule/ForbidFetchOnMixedRule.php index 1518c32..95fdeb4 100644 --- a/src/Rule/ForbidFetchOnMixedRule.php +++ b/src/Rule/ForbidFetchOnMixedRule.php @@ -29,7 +29,10 @@ class ForbidFetchOnMixedRule implements Rule private bool $checkExplicitMixed; - public function __construct(Printer $printer, bool $checkExplicitMixed) + public function __construct( + Printer $printer, + bool $checkExplicitMixed + ) { $this->printer = $printer; $this->checkExplicitMixed = $checkExplicitMixed; @@ -43,7 +46,10 @@ public function getNodeType(): string /** * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if ($this->checkExplicitMixed) { return []; // already checked by native PHPStan @@ -60,7 +66,10 @@ public function processNode(Node $node, Scope $scope): array * @param PropertyFetch|StaticPropertyFetch|ClassConstFetch $node * @return list */ - private function processFetch(Node $node, Scope $scope): array + private function processFetch( + Node $node, + Scope $scope + ): array { $caller = $node instanceof PropertyFetch ? $node->var @@ -123,7 +132,10 @@ private function getFetchToken(Node $node): string * * @param PropertyFetch|StaticPropertyFetch|ClassConstFetch $node */ - private function isObjectClassFetch(Type $callerType, Node $node): bool + private function isObjectClassFetch( + Type $callerType, + Node $node + ): bool { $isObjectWithoutClassName = $callerType->isObject()->yes() && $callerType->getObjectClassNames() === []; diff --git a/src/Rule/ForbidIdenticalClassComparisonRule.php b/src/Rule/ForbidIdenticalClassComparisonRule.php index 556d2ba..f962de7 100644 --- a/src/Rule/ForbidIdenticalClassComparisonRule.php +++ b/src/Rule/ForbidIdenticalClassComparisonRule.php @@ -58,7 +58,10 @@ public function getNodeType(): string * @param BinaryOp $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if (count($this->blacklist) === 0) { return []; @@ -95,7 +98,10 @@ public function processNode(Node $node, Scope $scope): array return $errors; } - private function containsClass(Type $type, string $className): bool + private function containsClass( + Type $type, + string $className + ): bool { $benevolentType = TypeUtils::toBenevolentUnion($type); diff --git a/src/Rule/ForbidIncrementDecrementOnNonIntegerRule.php b/src/Rule/ForbidIncrementDecrementOnNonIntegerRule.php index 5fb9971..5b73a35 100644 --- a/src/Rule/ForbidIncrementDecrementOnNonIntegerRule.php +++ b/src/Rule/ForbidIncrementDecrementOnNonIntegerRule.php @@ -30,7 +30,10 @@ public function getNodeType(): string /** * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if ( $node instanceof PostInc @@ -48,7 +51,10 @@ public function processNode(Node $node, Scope $scope): array * @param PostInc|PostDec|PreInc|PreDec $node * @return list */ - private function process(Node $node, Scope $scope): array + private function process( + Node $node, + Scope $scope + ): array { $exprType = $scope->getType($node->var); diff --git a/src/Rule/ForbidMatchDefaultArmForEnumsRule.php b/src/Rule/ForbidMatchDefaultArmForEnumsRule.php index d941918..24d9951 100644 --- a/src/Rule/ForbidMatchDefaultArmForEnumsRule.php +++ b/src/Rule/ForbidMatchDefaultArmForEnumsRule.php @@ -25,7 +25,10 @@ public function getNodeType(): string * @param MatchExpressionNode $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { $matchCondition = $node->getCondition(); $matchArgument = $scope->getType($matchCondition); diff --git a/src/Rule/ForbidMethodCallOnMixedRule.php b/src/Rule/ForbidMethodCallOnMixedRule.php index fdc1576..0afa81a 100644 --- a/src/Rule/ForbidMethodCallOnMixedRule.php +++ b/src/Rule/ForbidMethodCallOnMixedRule.php @@ -28,7 +28,10 @@ class ForbidMethodCallOnMixedRule implements Rule private bool $checkExplicitMixed; - public function __construct(Printer $printer, bool $checkExplicitMixed) + public function __construct( + Printer $printer, + bool $checkExplicitMixed + ) { $this->printer = $printer; $this->checkExplicitMixed = $checkExplicitMixed; @@ -43,7 +46,10 @@ public function getNodeType(): string * @param CallLike $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if ($this->checkExplicitMixed) { return []; // already checked by native PHPStan @@ -61,7 +67,10 @@ public function processNode(Node $node, Scope $scope): array * @param MethodCall|StaticCall $node * @return list */ - private function checkCall(CallLike $node, Scope $scope): array + private function checkCall( + CallLike $node, + Scope $scope + ): array { $caller = $node instanceof StaticCall ? $node->class : $node->var; diff --git a/src/Rule/ForbidNotNormalizedTypeRule.php b/src/Rule/ForbidNotNormalizedTypeRule.php index 5caeb1a..250c5ee 100644 --- a/src/Rule/ForbidNotNormalizedTypeRule.php +++ b/src/Rule/ForbidNotNormalizedTypeRule.php @@ -116,7 +116,10 @@ public function processNode( /** * @return list */ - private function checkCatchNativeType(Catch_ $node, Scope $scope): array + private function checkCatchNativeType( + Catch_ $node, + Scope $scope + ): array { $multiTypeNode = new UnionType($node->types, $node->getAttributes()); return $this->processMultiTypePhpParserNode($multiTypeNode, $scope, 'catch statement'); @@ -159,7 +162,10 @@ private function checkParamAndReturnAndThrowsPhpDoc( /** * @return list */ - private function checkPropertyNativeType(Property $node, Scope $scope): array + private function checkPropertyNativeType( + Property $node, + Scope $scope + ): array { $errors = []; @@ -178,7 +184,10 @@ private function checkPropertyNativeType(Property $node, Scope $scope): array /** * @return list */ - private function checkParamAndReturnNativeType(FunctionLike $node, Scope $scope): array + private function checkParamAndReturnNativeType( + FunctionLike $node, + Scope $scope + ): array { $errors = []; @@ -239,7 +248,10 @@ private function checkPropertyPhpDoc( /** * @return list */ - private function checkInlineVarDoc(PhpParserNode $node, Scope $scope): array + private function checkInlineVarDoc( + PhpParserNode $node, + Scope $scope + ): array { $docComment = $node->getDocComment(); @@ -426,7 +438,10 @@ public function processThrowsTags( /** * @return list */ - private function extractUnionAndIntersectionPhpDocTypeNodes(TypeNode $typeNode, int $line): array + private function extractUnionAndIntersectionPhpDocTypeNodes( + TypeNode $typeNode, + int $line + ): array { /** @var list $nodes */ $nodes = []; @@ -638,7 +653,10 @@ private function getPropertyNameFromNativeNode(Property $node): string return implode(',', $propertyNames); } - private function getPhpDocLine(PhpParserNode $node, PhpDocRootNode $phpDocNode): int + private function getPhpDocLine( + PhpParserNode $node, + PhpDocRootNode $phpDocNode + ): int { /** @var int|null $phpDocTagLine */ $phpDocTagLine = $phpDocNode->getAttribute('startLine'); diff --git a/src/Rule/ForbidNullInAssignOperationsRule.php b/src/Rule/ForbidNullInAssignOperationsRule.php index 496e818..6d4d800 100644 --- a/src/Rule/ForbidNullInAssignOperationsRule.php +++ b/src/Rule/ForbidNullInAssignOperationsRule.php @@ -56,7 +56,10 @@ public function getNodeType(): string * @param AssignOp $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { $exprType = $scope->getType($node->expr); $operator = $this->getOperatorString($node); diff --git a/src/Rule/ForbidNullInBinaryOperationsRule.php b/src/Rule/ForbidNullInBinaryOperationsRule.php index 340f8b7..8494c9a 100644 --- a/src/Rule/ForbidNullInBinaryOperationsRule.php +++ b/src/Rule/ForbidNullInBinaryOperationsRule.php @@ -42,7 +42,10 @@ public function getNodeType(): string * @param BinaryOp $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if (in_array($node->getOperatorSigil(), $this->blacklist, true)) { return []; diff --git a/src/Rule/ForbidNullInInterpolatedStringRule.php b/src/Rule/ForbidNullInInterpolatedStringRule.php index 9d9a17e..066a3c2 100644 --- a/src/Rule/ForbidNullInInterpolatedStringRule.php +++ b/src/Rule/ForbidNullInInterpolatedStringRule.php @@ -34,7 +34,10 @@ public function getNodeType(): string * @param InterpolatedString $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { $errors = []; diff --git a/src/Rule/ForbidPhpDocNullabilityMismatchWithNativeTypehintRule.php b/src/Rule/ForbidPhpDocNullabilityMismatchWithNativeTypehintRule.php index 472a909..4e30b5c 100644 --- a/src/Rule/ForbidPhpDocNullabilityMismatchWithNativeTypehintRule.php +++ b/src/Rule/ForbidPhpDocNullabilityMismatchWithNativeTypehintRule.php @@ -44,7 +44,10 @@ public function getNodeType(): string /** * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if ($node instanceof FunctionLike) { return [ @@ -63,7 +66,10 @@ public function processNode(Node $node, Scope $scope): array /** * @return list */ - private function checkReturnTypes(FunctionLike $node, Scope $scope): array + private function checkReturnTypes( + FunctionLike $node, + Scope $scope + ): array { $phpDocReturnType = $this->getFunctionPhpDocReturnType($node, $scope); $nativeReturnType = $this->getFunctionNativeReturnType($node, $scope); @@ -74,7 +80,10 @@ private function checkReturnTypes(FunctionLike $node, Scope $scope): array /** * @return list */ - private function checkPropertyTypes(Property $node, Scope $scope): array + private function checkPropertyTypes( + Property $node, + Scope $scope + ): array { $phpDocReturnType = $this->getPropertyPhpDocType($node, $scope); $nativeReturnType = $this->getParamOrPropertyNativeType($node, $scope); @@ -85,7 +94,10 @@ private function checkPropertyTypes(Property $node, Scope $scope): array /** * @return list */ - private function checkParamTypes(FunctionLike $node, Scope $scope): array + private function checkParamTypes( + FunctionLike $node, + Scope $scope + ): array { $errors = []; @@ -111,7 +123,10 @@ private function checkParamTypes(FunctionLike $node, Scope $scope): array /** * @param Param|Property $node */ - private function getParamOrPropertyNativeType(Node $node, Scope $scope): ?Type + private function getParamOrPropertyNativeType( + Node $node, + Scope $scope + ): ?Type { if ($node->type === null) { return null; @@ -120,7 +135,10 @@ private function getParamOrPropertyNativeType(Node $node, Scope $scope): ?Type return $scope->getFunctionType($node->type, false, false); } - private function getFunctionNativeReturnType(FunctionLike $node, Scope $scope): ?Type + private function getFunctionNativeReturnType( + FunctionLike $node, + Scope $scope + ): ?Type { if ($node->getReturnType() === null) { return null; @@ -129,7 +147,10 @@ private function getFunctionNativeReturnType(FunctionLike $node, Scope $scope): return $scope->getFunctionType($node->getReturnType(), false, false); } - private function getPropertyPhpDocType(Property $node, Scope $scope): ?Type + private function getPropertyPhpDocType( + Property $node, + Scope $scope + ): ?Type { $resolvedPhpDoc = $this->resolvePhpDoc($node, $scope); @@ -146,7 +167,10 @@ private function getPropertyPhpDocType(Property $node, Scope $scope): ?Type return null; } - private function getFunctionPhpDocReturnType(FunctionLike $node, Scope $scope): ?Type + private function getFunctionPhpDocReturnType( + FunctionLike $node, + Scope $scope + ): ?Type { $resolvedPhpDoc = $this->resolvePhpDoc($node, $scope); @@ -163,7 +187,10 @@ private function getFunctionPhpDocReturnType(FunctionLike $node, Scope $scope): return $returnTag->getType(); } - private function resolvePhpDoc(Node $node, Scope $scope): ?ResolvedPhpDocBlock + private function resolvePhpDoc( + Node $node, + Scope $scope + ): ?ResolvedPhpDocBlock { $docComment = $node->getDocComment(); @@ -180,7 +207,11 @@ private function resolvePhpDoc(Node $node, Scope $scope): ?ResolvedPhpDocBlock ); } - private function getPhpDocParamType(FunctionLike $node, Scope $scope, string $parameterName): ?Type + private function getPhpDocParamType( + FunctionLike $node, + Scope $scope, + string $parameterName + ): ?Type { $resolvedPhpDoc = $this->resolvePhpDoc($node, $scope); diff --git a/src/Rule/ForbidProtectedEnumMethodRule.php b/src/Rule/ForbidProtectedEnumMethodRule.php index d1855d0..6c84509 100644 --- a/src/Rule/ForbidProtectedEnumMethodRule.php +++ b/src/Rule/ForbidProtectedEnumMethodRule.php @@ -24,7 +24,10 @@ public function getNodeType(): string * @param ClassMethodsNode $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if ($scope->getClassReflection() === null || !$scope->getClassReflection()->isEnum()) { return []; diff --git a/src/Rule/ForbidReturnInConstructorRule.php b/src/Rule/ForbidReturnInConstructorRule.php index aa140cb..f7b3dff 100644 --- a/src/Rule/ForbidReturnInConstructorRule.php +++ b/src/Rule/ForbidReturnInConstructorRule.php @@ -25,7 +25,10 @@ public function getNodeType(): string * @param Return_ $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if ($scope->isInAnonymousFunction()) { return []; diff --git a/src/Rule/ForbidReturnValueInYieldingMethodRule.php b/src/Rule/ForbidReturnValueInYieldingMethodRule.php index f0c8d55..e491aaf 100644 --- a/src/Rule/ForbidReturnValueInYieldingMethodRule.php +++ b/src/Rule/ForbidReturnValueInYieldingMethodRule.php @@ -80,7 +80,10 @@ public function processNode( return $errors; } - private function getReturnType(ReturnStatementsNode $node, Scope $scope): Type + private function getReturnType( + ReturnStatementsNode $node, + Scope $scope + ): Type { $methodReflection = $scope->getFunction(); diff --git a/src/Rule/ForbidUnsetClassFieldRule.php b/src/Rule/ForbidUnsetClassFieldRule.php index 3c5d793..54d830c 100644 --- a/src/Rule/ForbidUnsetClassFieldRule.php +++ b/src/Rule/ForbidUnsetClassFieldRule.php @@ -25,7 +25,10 @@ public function getNodeType(): string * @param Unset_ $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { foreach ($node->vars as $item) { if ($item instanceof PropertyFetch) { diff --git a/src/Rule/ForbidUnusedExceptionRule.php b/src/Rule/ForbidUnusedExceptionRule.php index 9e8d5e2..008af4b 100644 --- a/src/Rule/ForbidUnusedExceptionRule.php +++ b/src/Rule/ForbidUnusedExceptionRule.php @@ -38,7 +38,10 @@ public function getNodeType(): string * @param Expr $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if ($node instanceof MethodCall || $node instanceof StaticCall) { return $this->processCall($node, $scope); @@ -55,7 +58,10 @@ public function processNode(Node $node, Scope $scope): array * @param MethodCall|StaticCall $node * @return list */ - private function processCall(CallLike $node, Scope $scope): array + private function processCall( + CallLike $node, + Scope $scope + ): array { if (!$this->isException($node, $scope)) { return []; @@ -74,7 +80,10 @@ private function processCall(CallLike $node, Scope $scope): array /** * @return list */ - private function processNew(New_ $node, Scope $scope): array + private function processNew( + New_ $node, + Scope $scope + ): array { if (!$this->isException($node, $scope)) { return []; @@ -90,7 +99,10 @@ private function processNew(New_ $node, Scope $scope): array return []; } - private function isException(Expr $node, Scope $scope): bool + private function isException( + Expr $node, + Scope $scope + ): bool { $type = $scope->getType($node); diff --git a/src/Rule/ForbidUnusedMatchResultRule.php b/src/Rule/ForbidUnusedMatchResultRule.php index efe4404..6d3b69d 100644 --- a/src/Rule/ForbidUnusedMatchResultRule.php +++ b/src/Rule/ForbidUnusedMatchResultRule.php @@ -29,7 +29,10 @@ public function getNodeType(): string * @param Match_ $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { $returnedTypes = []; diff --git a/src/Rule/ForbidUselessNullableReturnRule.php b/src/Rule/ForbidUselessNullableReturnRule.php index 219985e..982080e 100644 --- a/src/Rule/ForbidUselessNullableReturnRule.php +++ b/src/Rule/ForbidUselessNullableReturnRule.php @@ -30,7 +30,10 @@ public function getNodeType(): string * @param ReturnStatementsNode $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { $verbosity = VerbosityLevel::precise(); $methodReflection = $scope->getFunction(); diff --git a/src/Rule/ForbidVariableTypeOverwritingRule.php b/src/Rule/ForbidVariableTypeOverwritingRule.php index fcaace3..a38900a 100644 --- a/src/Rule/ForbidVariableTypeOverwritingRule.php +++ b/src/Rule/ForbidVariableTypeOverwritingRule.php @@ -37,7 +37,10 @@ public function getNodeType(): string * @param Assign $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { if (!$node->var instanceof Variable) { return []; // array append not yet supported diff --git a/src/Rule/RequirePreviousExceptionPassRule.php b/src/Rule/RequirePreviousExceptionPassRule.php index d7ebe28..3827acf 100644 --- a/src/Rule/RequirePreviousExceptionPassRule.php +++ b/src/Rule/RequirePreviousExceptionPassRule.php @@ -58,7 +58,10 @@ public function getNodeType(): string * @param TryCatch $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { $errors = []; $previouslyCaughtExceptionsUnion = new NeverType(); @@ -158,7 +161,10 @@ private function processExceptionCreation( /** * @return list */ - private function getCallLikeParameters(CallLike $node, Scope $scope): array + private function getCallLikeParameters( + CallLike $node, + Scope $scope + ): array { $methodReflection = null; diff --git a/src/Rule/UselessPrivatePropertyDefaultValueRule.php b/src/Rule/UselessPrivatePropertyDefaultValueRule.php index a5d73e0..53b6b05 100644 --- a/src/Rule/UselessPrivatePropertyDefaultValueRule.php +++ b/src/Rule/UselessPrivatePropertyDefaultValueRule.php @@ -27,7 +27,10 @@ public function getNodeType(): string * @param ClassPropertiesNode $node * @return list */ - public function processNode(Node $node, Scope $scope): array + public function processNode( + Node $node, + Scope $scope + ): array { $classReflection = $scope->getClassReflection(); diff --git a/tests/Rule/ForbidCheckedExceptionInCallableRuleTest.php b/tests/Rule/ForbidCheckedExceptionInCallableRuleTest.php index 2c995ec..086f750 100644 --- a/tests/Rule/ForbidCheckedExceptionInCallableRuleTest.php +++ b/tests/Rule/ForbidCheckedExceptionInCallableRuleTest.php @@ -56,9 +56,13 @@ protected function getRule(): Rule /** * @param list $checkedExceptions + * * @dataProvider provideSetup */ - public function test(bool $implicitThrows, array $checkedExceptions): void + public function test( + bool $implicitThrows, + array $checkedExceptions + ): void { self::$implicitThrows = $implicitThrows; $this->checkedExceptions = $checkedExceptions; diff --git a/tests/RuleTestCase.php b/tests/RuleTestCase.php index 098c0d4..54da771 100644 --- a/tests/RuleTestCase.php +++ b/tests/RuleTestCase.php @@ -26,7 +26,10 @@ abstract class RuleTestCase extends OriginalRuleTestCase { - protected function analyseFile(string $file, bool $autofix = false): void + protected function analyseFile( + string $file, + bool $autofix = false + ): void { $analyserErrors = $this->gatherAnalyserErrors([$file]); @@ -98,7 +101,10 @@ private function parseExpectedErrors(string $file): array return array_values($expectedErrors); } - private function formatErrorForAssert(string $message, int $line): string + private function formatErrorForAssert( + string $message, + int $line + ): string { return sprintf('%02d: %s', $line, $message); } @@ -106,7 +112,10 @@ private function formatErrorForAssert(string $message, int $line): string /** * @param list $analyserErrors */ - private function autofix(string $file, array $analyserErrors): void + private function autofix( + string $file, + array $analyserErrors + ): void { $errorsByLines = [];