From 71481b8626546f7eb617dcb6d108d82e8fe3ded5 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 12 Dec 2024 20:28:50 +0100 Subject: [PATCH 1/4] Drop thecodingmachine/safe --- composer.json | 2 - composer.lock | 91 +++----------- vendor/composer/autoload_classmap.php | 11 +- vendor/composer/autoload_files.php | 2 +- vendor/composer/autoload_psr4.php | 3 +- vendor/composer/autoload_static.php | 20 +-- vendor/composer/installed.json | 116 ++++-------------- vendor/composer/installed.php | 31 ++--- vendor/doctrine/deprecations/README.md | 61 +++++++++ vendor/doctrine/deprecations/composer.json | 12 +- .../Deprecations => src}/Deprecation.php | 14 +-- .../PHPUnit/VerifyDeprecations.php | 8 +- vendor/staabm/phpstan-todo-by/composer.json | 2 +- .../phpstan-safe-rule/README.md | 16 --- .../phpstan-safe-rule/composer.json | 49 -------- .../phpstan-safe-rule/phpstan-safe-rule.neon | 13 -- .../src/Rules/UseSafeClassesRule.php | 51 -------- .../src/Rules/UseSafeFunctionsRule.php | 92 -------------- ...afeFunctionsDynamicReturnTypeExtension.php | 79 ------------ .../src/Utils/ClassListLoader.php | 27 ---- .../src/Utils/FunctionListLoader.php | 35 ------ .../unused-public/config/extension.neon | 2 +- ...ollector.php => CallableTypeCollector.php} | 33 +---- .../src/NodeCollectorExtractor.php | 4 +- 24 files changed, 146 insertions(+), 628 deletions(-) rename vendor/doctrine/deprecations/{lib/Doctrine/Deprecations => src}/Deprecation.php (95%) rename vendor/doctrine/deprecations/{lib/Doctrine/Deprecations => src}/PHPUnit/VerifyDeprecations.php (96%) delete mode 100644 vendor/thecodingmachine/phpstan-safe-rule/README.md delete mode 100644 vendor/thecodingmachine/phpstan-safe-rule/composer.json delete mode 100644 vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon delete mode 100644 vendor/thecodingmachine/phpstan-safe-rule/src/Rules/UseSafeClassesRule.php delete mode 100644 vendor/thecodingmachine/phpstan-safe-rule/src/Rules/UseSafeFunctionsRule.php delete mode 100644 vendor/thecodingmachine/phpstan-safe-rule/src/Type/Php/ReplaceSafeFunctionsDynamicReturnTypeExtension.php delete mode 100644 vendor/thecodingmachine/phpstan-safe-rule/src/Utils/ClassListLoader.php delete mode 100644 vendor/thecodingmachine/phpstan-safe-rule/src/Utils/FunctionListLoader.php rename vendor/tomasvotruba/unused-public/src/Collectors/Callable_/{CallUserFuncCollector.php => CallableTypeCollector.php} (74%) diff --git a/composer.json b/composer.json index 86ded6c16..e7771663f 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,6 @@ "staabm/phpstan-dba": "0.2.85", "staabm/phpstan-todo-by": "0.2", "symplify/phpstan-rules": "12.7.0", - "thecodingmachine/phpstan-safe-rule": "1.2", - "thecodingmachine/safe": "1.3.3", "tomasvotruba/cognitive-complexity": "0.2.3", "tomasvotruba/type-coverage": "1.0.0", "tomasvotruba/unused-public": "1.1.0" diff --git a/composer.lock b/composer.lock index dafb6c95f..4af2e5c88 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": "b610d670c163e34bb87c6ca555607821", + "content-hash": "b5ea2ca1b13058ddc0d79aa7b5aad0bb", "packages": [ { "name": "beberlei/assert", @@ -362,29 +362,27 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -392,7 +390,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -403,9 +401,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "doctrine/event-manager", @@ -1713,8 +1711,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1827,63 +1825,6 @@ ], "time": "2024-05-25T15:32:40+00:00" }, - { - "name": "thecodingmachine/phpstan-safe-rule", - "version": "v1.2.0", - "source": { - "type": "git", - "url": "https://github.com/thecodingmachine/phpstan-safe-rule.git", - "reference": "8a7b88e0d54f209a488095085f183e9174c40e1e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/phpstan-safe-rule/zipball/8a7b88e0d54f209a488095085f183e9174c40e1e", - "reference": "8a7b88e0d54f209a488095085f183e9174c40e1e", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^1.0", - "thecodingmachine/safe": "^1.0 || ^2.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^7.5.2 || ^8.0", - "squizlabs/php_codesniffer": "^3.4" - }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "phpstan-safe-rule.neon" - ] - }, - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "TheCodingMachine\\Safe\\PHPStan\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "David Négrier", - "email": "d.negrier@thecodingmachine.com" - } - ], - "description": "A PHPStan rule to detect safety issues. Must be used in conjunction with thecodingmachine/safe", - "support": { - "issues": "https://github.com/thecodingmachine/phpstan-safe-rule/issues", - "source": "https://github.com/thecodingmachine/phpstan-safe-rule/tree/v1.2.0" - }, - "time": "2022-01-17T10:12:29+00:00" - }, { "name": "thecodingmachine/safe", "version": "v1.3.3", @@ -2251,13 +2192,13 @@ "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.4" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { "php": "7.4.30" }, diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 76add7809..5f04f47fa 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -384,8 +384,8 @@ 'Doctrine\\DBAL\\Types\\VarDateTimeImmutableType' => $vendorDir . '/doctrine/dbal/src/Types/VarDateTimeImmutableType.php', 'Doctrine\\DBAL\\Types\\VarDateTimeType' => $vendorDir . '/doctrine/dbal/src/Types/VarDateTimeType.php', 'Doctrine\\DBAL\\VersionAwarePlatformDriver' => $vendorDir . '/doctrine/dbal/src/VersionAwarePlatformDriver.php', - 'Doctrine\\Deprecations\\Deprecation' => $vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php', - 'Doctrine\\Deprecations\\PHPUnit\\VerifyDeprecations' => $vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php', + 'Doctrine\\Deprecations\\Deprecation' => $vendorDir . '/doctrine/deprecations/src/Deprecation.php', + 'Doctrine\\Deprecations\\PHPUnit\\VerifyDeprecations' => $vendorDir . '/doctrine/deprecations/src/PHPUnit/VerifyDeprecations.php', 'Dogma\\Application\\Colors' => $vendorDir . '/dogma/dogma/src/Application/Colors.php', 'Dogma\\Application\\ConfigurationProfile' => $vendorDir . '/dogma/dogma/src/Application/ConfigurationProfile.php', 'Dogma\\Application\\Configurator' => $vendorDir . '/dogma/dogma/src/Application/Configurator.php', @@ -2023,11 +2023,6 @@ 'Symplify\\PHPStanRules\\ValueObject\\ClassNamespaceAndDirectory' => $vendorDir . '/symplify/phpstan-rules/src/ValueObject/ClassNamespaceAndDirectory.php', 'Symplify\\PHPStanRules\\ValueObject\\Configuration\\RequiredWithMessage' => $vendorDir . '/symplify/phpstan-rules/src/ValueObject/Configuration/RequiredWithMessage.php', 'Symplify\\PHPStanRules\\ValueObject\\MethodCallReference' => $vendorDir . '/symplify/phpstan-rules/src/ValueObject/MethodCallReference.php', - 'TheCodingMachine\\Safe\\PHPStan\\Rules\\UseSafeClassesRule' => $vendorDir . '/thecodingmachine/phpstan-safe-rule/src/Rules/UseSafeClassesRule.php', - 'TheCodingMachine\\Safe\\PHPStan\\Rules\\UseSafeFunctionsRule' => $vendorDir . '/thecodingmachine/phpstan-safe-rule/src/Rules/UseSafeFunctionsRule.php', - 'TheCodingMachine\\Safe\\PHPStan\\Type\\Php\\ReplaceSafeFunctionsDynamicReturnTypeExtension' => $vendorDir . '/thecodingmachine/phpstan-safe-rule/src/Type/Php/ReplaceSafeFunctionsDynamicReturnTypeExtension.php', - 'TheCodingMachine\\Safe\\PHPStan\\Utils\\ClassListLoader' => $vendorDir . '/thecodingmachine/phpstan-safe-rule/src/Utils/ClassListLoader.php', - 'TheCodingMachine\\Safe\\PHPStan\\Utils\\FunctionListLoader' => $vendorDir . '/thecodingmachine/phpstan-safe-rule/src/Utils/FunctionListLoader.php', 'TomasVotruba\\CognitiveComplexity\\AstCognitiveComplexityAnalyzer' => $vendorDir . '/tomasvotruba/cognitive-complexity/src/AstCognitiveComplexityAnalyzer.php', 'TomasVotruba\\CognitiveComplexity\\ClassReflectionParser' => $vendorDir . '/tomasvotruba/cognitive-complexity/src/ClassReflectionParser.php', 'TomasVotruba\\CognitiveComplexity\\Configuration' => $vendorDir . '/tomasvotruba/cognitive-complexity/src/Configuration.php', @@ -2061,7 +2056,7 @@ 'TomasVotruba\\UnusedPublic\\ClassTypeDetector' => $vendorDir . '/tomasvotruba/unused-public/src/ClassTypeDetector.php', 'TomasVotruba\\UnusedPublic\\CollectorMapper\\MethodCallCollectorMapper' => $vendorDir . '/tomasvotruba/unused-public/src/CollectorMapper/MethodCallCollectorMapper.php', 'TomasVotruba\\UnusedPublic\\Collectors\\Callable_\\AttributeCallableCollector' => $vendorDir . '/tomasvotruba/unused-public/src/Collectors/Callable_/AttributeCallableCollector.php', - 'TomasVotruba\\UnusedPublic\\Collectors\\Callable_\\CallUserFuncCollector' => $vendorDir . '/tomasvotruba/unused-public/src/Collectors/Callable_/CallUserFuncCollector.php', + 'TomasVotruba\\UnusedPublic\\Collectors\\Callable_\\CallableTypeCollector' => $vendorDir . '/tomasvotruba/unused-public/src/Collectors/Callable_/CallableTypeCollector.php', 'TomasVotruba\\UnusedPublic\\Collectors\\ClassConstFetchCollector' => $vendorDir . '/tomasvotruba/unused-public/src/Collectors/ClassConstFetchCollector.php', 'TomasVotruba\\UnusedPublic\\Collectors\\FormTypeClassCollector' => $vendorDir . '/tomasvotruba/unused-public/src/Collectors/FormTypeClassCollector.php', 'TomasVotruba\\UnusedPublic\\Collectors\\MethodCall\\MethodCallCollector' => $vendorDir . '/tomasvotruba/unused-public/src/Collectors/MethodCall/MethodCallCollector.php', diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 94ee15522..8ee5dbdd0 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -8,6 +8,7 @@ return array( '9b38cf48e83f5d8f60375221cd213eee' => $vendorDir . '/phpstan/phpstan/bootstrap.php', 'a4ecaeafb8cfb009ad0e052c90355e98' => $vendorDir . '/beberlei/assert/lib/Assert/functions.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '51fcf4e06c07cc00c920b44bcd900e7a' => $vendorDir . '/thecodingmachine/safe/deprecated/apc.php', '47f619d9197b36cf5ab70738d7743fe2' => $vendorDir . '/thecodingmachine/safe/deprecated/libevent.php', 'ea6bb8a12ef9b68f6ada99058e530760' => $vendorDir . '/thecodingmachine/safe/deprecated/mssql.php', @@ -97,5 +98,4 @@ '4af1dca6db8c527c6eed27bff85ff0e5' => $vendorDir . '/thecodingmachine/safe/generated/yaz.php', 'fe43ca06499ac37bc2dedd823af71eb5' => $vendorDir . '/thecodingmachine/safe/generated/zip.php', '356736db98a6834f0a886b8d509b0ecd' => $vendorDir . '/thecodingmachine/safe/generated/zlib.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index d9077997f..9ccf92202 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -13,7 +13,6 @@ 'TomasVotruba\\UnusedPublic\\' => array($vendorDir . '/tomasvotruba/unused-public/src'), 'TomasVotruba\\TypeCoverage\\' => array($vendorDir . '/tomasvotruba/type-coverage/src'), 'TomasVotruba\\CognitiveComplexity\\' => array($vendorDir . '/tomasvotruba/cognitive-complexity/src'), - 'TheCodingMachine\\Safe\\PHPStan\\' => array($vendorDir . '/thecodingmachine/phpstan-safe-rule/src'), 'Symplify\\PHPStanRules\\' => array($vendorDir . '/symplify/phpstan-rules/src'), 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), 'Spaze\\PHPStan\\Rules\\Disallowed\\' => array($vendorDir . '/spaze/phpstan-disallowed-calls/src'), @@ -22,7 +21,7 @@ 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), 'PHPStan\\' => array($vendorDir . '/phpstan/phpstan-deprecation-rules/src', $vendorDir . '/phpstan/phpstan-phpunit/src', $vendorDir . '/phpstan/phpstan-strict-rules/src', $vendorDir . '/phpstan/phpstan-symfony/src'), 'JsonSchema\\' => array($vendorDir . '/justinrainbow/json-schema/src/JsonSchema'), - 'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations'), + 'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/src'), 'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/src'), 'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'), 'Doctrine\\Common\\' => array($vendorDir . '/doctrine/event-manager/src'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 700c409e9..f48bb95c3 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -9,6 +9,7 @@ class ComposerStaticInit9cf8af24a7a084f114b4553be2a1ff9f public static $files = array ( '9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php', 'a4ecaeafb8cfb009ad0e052c90355e98' => __DIR__ . '/..' . '/beberlei/assert/lib/Assert/functions.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '51fcf4e06c07cc00c920b44bcd900e7a' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/apc.php', '47f619d9197b36cf5ab70738d7743fe2' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/libevent.php', 'ea6bb8a12ef9b68f6ada99058e530760' => __DIR__ . '/..' . '/thecodingmachine/safe/deprecated/mssql.php', @@ -98,7 +99,6 @@ class ComposerStaticInit9cf8af24a7a084f114b4553be2a1ff9f '4af1dca6db8c527c6eed27bff85ff0e5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/yaz.php', 'fe43ca06499ac37bc2dedd823af71eb5' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/zip.php', '356736db98a6834f0a886b8d509b0ecd' => __DIR__ . '/..' . '/thecodingmachine/safe/generated/zlib.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', ); public static $prefixLengthsPsr4 = array ( @@ -120,7 +120,6 @@ class ComposerStaticInit9cf8af24a7a084f114b4553be2a1ff9f 'TomasVotruba\\UnusedPublic\\' => 26, 'TomasVotruba\\TypeCoverage\\' => 26, 'TomasVotruba\\CognitiveComplexity\\' => 33, - 'TheCodingMachine\\Safe\\PHPStan\\' => 30, ), 'S' => array ( @@ -185,10 +184,6 @@ class ComposerStaticInit9cf8af24a7a084f114b4553be2a1ff9f array ( 0 => __DIR__ . '/..' . '/tomasvotruba/cognitive-complexity/src', ), - 'TheCodingMachine\\Safe\\PHPStan\\' => - array ( - 0 => __DIR__ . '/..' . '/thecodingmachine/phpstan-safe-rule/src', - ), 'Symplify\\PHPStanRules\\' => array ( 0 => __DIR__ . '/..' . '/symplify/phpstan-rules/src', @@ -228,7 +223,7 @@ class ComposerStaticInit9cf8af24a7a084f114b4553be2a1ff9f ), 'Doctrine\\Deprecations\\' => array ( - 0 => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations', + 0 => __DIR__ . '/..' . '/doctrine/deprecations/src', ), 'Doctrine\\DBAL\\' => array ( @@ -631,8 +626,8 @@ class ComposerStaticInit9cf8af24a7a084f114b4553be2a1ff9f 'Doctrine\\DBAL\\Types\\VarDateTimeImmutableType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/VarDateTimeImmutableType.php', 'Doctrine\\DBAL\\Types\\VarDateTimeType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/VarDateTimeType.php', 'Doctrine\\DBAL\\VersionAwarePlatformDriver' => __DIR__ . '/..' . '/doctrine/dbal/src/VersionAwarePlatformDriver.php', - 'Doctrine\\Deprecations\\Deprecation' => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php', - 'Doctrine\\Deprecations\\PHPUnit\\VerifyDeprecations' => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php', + 'Doctrine\\Deprecations\\Deprecation' => __DIR__ . '/..' . '/doctrine/deprecations/src/Deprecation.php', + 'Doctrine\\Deprecations\\PHPUnit\\VerifyDeprecations' => __DIR__ . '/..' . '/doctrine/deprecations/src/PHPUnit/VerifyDeprecations.php', 'Dogma\\Application\\Colors' => __DIR__ . '/..' . '/dogma/dogma/src/Application/Colors.php', 'Dogma\\Application\\ConfigurationProfile' => __DIR__ . '/..' . '/dogma/dogma/src/Application/ConfigurationProfile.php', 'Dogma\\Application\\Configurator' => __DIR__ . '/..' . '/dogma/dogma/src/Application/Configurator.php', @@ -2270,11 +2265,6 @@ class ComposerStaticInit9cf8af24a7a084f114b4553be2a1ff9f 'Symplify\\PHPStanRules\\ValueObject\\ClassNamespaceAndDirectory' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/ValueObject/ClassNamespaceAndDirectory.php', 'Symplify\\PHPStanRules\\ValueObject\\Configuration\\RequiredWithMessage' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/ValueObject/Configuration/RequiredWithMessage.php', 'Symplify\\PHPStanRules\\ValueObject\\MethodCallReference' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/ValueObject/MethodCallReference.php', - 'TheCodingMachine\\Safe\\PHPStan\\Rules\\UseSafeClassesRule' => __DIR__ . '/..' . '/thecodingmachine/phpstan-safe-rule/src/Rules/UseSafeClassesRule.php', - 'TheCodingMachine\\Safe\\PHPStan\\Rules\\UseSafeFunctionsRule' => __DIR__ . '/..' . '/thecodingmachine/phpstan-safe-rule/src/Rules/UseSafeFunctionsRule.php', - 'TheCodingMachine\\Safe\\PHPStan\\Type\\Php\\ReplaceSafeFunctionsDynamicReturnTypeExtension' => __DIR__ . '/..' . '/thecodingmachine/phpstan-safe-rule/src/Type/Php/ReplaceSafeFunctionsDynamicReturnTypeExtension.php', - 'TheCodingMachine\\Safe\\PHPStan\\Utils\\ClassListLoader' => __DIR__ . '/..' . '/thecodingmachine/phpstan-safe-rule/src/Utils/ClassListLoader.php', - 'TheCodingMachine\\Safe\\PHPStan\\Utils\\FunctionListLoader' => __DIR__ . '/..' . '/thecodingmachine/phpstan-safe-rule/src/Utils/FunctionListLoader.php', 'TomasVotruba\\CognitiveComplexity\\AstCognitiveComplexityAnalyzer' => __DIR__ . '/..' . '/tomasvotruba/cognitive-complexity/src/AstCognitiveComplexityAnalyzer.php', 'TomasVotruba\\CognitiveComplexity\\ClassReflectionParser' => __DIR__ . '/..' . '/tomasvotruba/cognitive-complexity/src/ClassReflectionParser.php', 'TomasVotruba\\CognitiveComplexity\\Configuration' => __DIR__ . '/..' . '/tomasvotruba/cognitive-complexity/src/Configuration.php', @@ -2308,7 +2298,7 @@ class ComposerStaticInit9cf8af24a7a084f114b4553be2a1ff9f 'TomasVotruba\\UnusedPublic\\ClassTypeDetector' => __DIR__ . '/..' . '/tomasvotruba/unused-public/src/ClassTypeDetector.php', 'TomasVotruba\\UnusedPublic\\CollectorMapper\\MethodCallCollectorMapper' => __DIR__ . '/..' . '/tomasvotruba/unused-public/src/CollectorMapper/MethodCallCollectorMapper.php', 'TomasVotruba\\UnusedPublic\\Collectors\\Callable_\\AttributeCallableCollector' => __DIR__ . '/..' . '/tomasvotruba/unused-public/src/Collectors/Callable_/AttributeCallableCollector.php', - 'TomasVotruba\\UnusedPublic\\Collectors\\Callable_\\CallUserFuncCollector' => __DIR__ . '/..' . '/tomasvotruba/unused-public/src/Collectors/Callable_/CallUserFuncCollector.php', + 'TomasVotruba\\UnusedPublic\\Collectors\\Callable_\\CallableTypeCollector' => __DIR__ . '/..' . '/tomasvotruba/unused-public/src/Collectors/Callable_/CallableTypeCollector.php', 'TomasVotruba\\UnusedPublic\\Collectors\\ClassConstFetchCollector' => __DIR__ . '/..' . '/tomasvotruba/unused-public/src/Collectors/ClassConstFetchCollector.php', 'TomasVotruba\\UnusedPublic\\Collectors\\FormTypeClassCollector' => __DIR__ . '/..' . '/tomasvotruba/unused-public/src/Collectors/FormTypeClassCollector.php', 'TomasVotruba\\UnusedPublic\\Collectors\\MethodCall\\MethodCallCollector' => __DIR__ . '/..' . '/tomasvotruba/unused-public/src/Collectors/MethodCall/MethodCallCollector.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 7a60f8bc0..7c6ff6c73 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -368,40 +368,38 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", - "version_normalized": "1.1.3.0", + "version": "1.1.4", + "version_normalized": "1.1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" }, - "time": "2024-01-30T19:34:25+00:00", + "time": "2024-12-07T21:18:45+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -412,7 +410,7 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, "install-path": "../doctrine/deprecations" }, @@ -1693,17 +1691,17 @@ }, { "name": "staabm/phpstan-todo-by", - "version": "0.1.32", - "version_normalized": "0.1.32.0", + "version": "0.2", + "version_normalized": "0.2.0.0", "source": { "type": "git", "url": "https://github.com/staabm/phpstan-todo-by.git", - "reference": "81a55caa8af4451082c5688f9e69089275332d9a" + "reference": "de149a2dcdc0bcb5f3ebc6f6c571bf50d74aea92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/staabm/phpstan-todo-by/zipball/81a55caa8af4451082c5688f9e69089275332d9a", - "reference": "81a55caa8af4451082c5688f9e69089275332d9a", + "url": "https://api.github.com/repos/staabm/phpstan-todo-by/zipball/de149a2dcdc0bcb5f3ebc6f6c571bf50d74aea92", + "reference": "de149a2dcdc0bcb5f3ebc6f6c571bf50d74aea92", "shasum": "" }, "require": { @@ -1713,7 +1711,7 @@ "ext-json": "*", "nikolaposa/version": "^4.1", "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^1.10" + "phpstan/phpstan": "^1.10 || ^2.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.64", @@ -1723,7 +1721,7 @@ "phpunit/phpunit": "^9 || ^10.5", "redaxo/php-cs-fixer-config": "^1.0" }, - "time": "2024-10-08T10:08:28+00:00", + "time": "2024-11-11T08:11:22+00:00", "type": "phpstan-extension", "extra": { "phpstan": { @@ -1752,7 +1750,7 @@ ], "support": { "issues": "https://github.com/staabm/phpstan-todo-by/issues", - "source": "https://github.com/staabm/phpstan-todo-by/tree/0.1.32" + "source": "https://github.com/staabm/phpstan-todo-by/tree/0.2" }, "funding": [ { @@ -1902,66 +1900,6 @@ ], "install-path": "../symplify/phpstan-rules" }, - { - "name": "thecodingmachine/phpstan-safe-rule", - "version": "v1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/thecodingmachine/phpstan-safe-rule.git", - "reference": "8a7b88e0d54f209a488095085f183e9174c40e1e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/phpstan-safe-rule/zipball/8a7b88e0d54f209a488095085f183e9174c40e1e", - "reference": "8a7b88e0d54f209a488095085f183e9174c40e1e", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^1.0", - "thecodingmachine/safe": "^1.0 || ^2.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^7.5.2 || ^8.0", - "squizlabs/php_codesniffer": "^3.4" - }, - "time": "2022-01-17T10:12:29+00:00", - "type": "phpstan-extension", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - }, - "phpstan": { - "includes": [ - "phpstan-safe-rule.neon" - ] - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "TheCodingMachine\\Safe\\PHPStan\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "David Négrier", - "email": "d.negrier@thecodingmachine.com" - } - ], - "description": "A PHPStan rule to detect safety issues. Must be used in conjunction with thecodingmachine/safe", - "support": { - "issues": "https://github.com/thecodingmachine/phpstan-safe-rule/issues", - "source": "https://github.com/thecodingmachine/phpstan-safe-rule/tree/v1.2.0" - }, - "install-path": "../thecodingmachine/phpstan-safe-rule" - }, { "name": "thecodingmachine/safe", "version": "v1.3.3", @@ -2221,17 +2159,17 @@ }, { "name": "tomasvotruba/unused-public", - "version": "1.0.0", - "version_normalized": "1.0.0.0", + "version": "1.1.0", + "version_normalized": "1.1.0.0", "source": { "type": "git", "url": "https://github.com/TomasVotruba/unused-public.git", - "reference": "8c8a94c3abd60d76ccace897c5dabab35953e5ca" + "reference": "f05169f07f4a8a53ef05107ee81e4e1201e0d47f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TomasVotruba/unused-public/zipball/8c8a94c3abd60d76ccace897c5dabab35953e5ca", - "reference": "8c8a94c3abd60d76ccace897c5dabab35953e5ca", + "url": "https://api.github.com/repos/TomasVotruba/unused-public/zipball/f05169f07f4a8a53ef05107ee81e4e1201e0d47f", + "reference": "f05169f07f4a8a53ef05107ee81e4e1201e0d47f", "shasum": "" }, "require": { @@ -2239,7 +2177,7 @@ "phpstan/phpstan": "^1.10.19", "webmozart/assert": "^1.11" }, - "time": "2024-10-01T15:42:57+00:00", + "time": "2024-12-06T16:01:31+00:00", "type": "phpstan-extension", "extra": { "phpstan": { @@ -2265,7 +2203,7 @@ ], "support": { "issues": "https://github.com/TomasVotruba/unused-public/issues", - "source": "https://github.com/TomasVotruba/unused-public/tree/1.0.0" + "source": "https://github.com/TomasVotruba/unused-public/tree/1.1.0" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 1125f1b65..7d165f436 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'b489cfe351754c46a6dea03a5370002abde61600', + 'reference' => '77c04be391846239eca56b785cf4ab1f2995bf25', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'b489cfe351754c46a6dea03a5370002abde61600', + 'reference' => '77c04be391846239eca56b785cf4ab1f2995bf25', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -56,9 +56,9 @@ 'dev_requirement' => false, ), 'doctrine/deprecations' => array( - 'pretty_version' => '1.1.3', - 'version' => '1.1.3.0', - 'reference' => 'dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab', + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'reference' => '31610dbb31faa98e6b5447b62340826f54fbc4e9', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/deprecations', 'aliases' => array(), @@ -248,9 +248,9 @@ 'dev_requirement' => false, ), 'staabm/phpstan-todo-by' => array( - 'pretty_version' => '0.1.32', - 'version' => '0.1.32.0', - 'reference' => '81a55caa8af4451082c5688f9e69089275332d9a', + 'pretty_version' => '0.2', + 'version' => '0.2.0.0', + 'reference' => 'de149a2dcdc0bcb5f3ebc6f6c571bf50d74aea92', 'type' => 'phpstan-extension', 'install_path' => __DIR__ . '/../staabm/phpstan-todo-by', 'aliases' => array(), @@ -274,15 +274,6 @@ 'aliases' => array(), 'dev_requirement' => false, ), - 'thecodingmachine/phpstan-safe-rule' => array( - 'pretty_version' => 'v1.2.0', - 'version' => '1.2.0.0', - 'reference' => '8a7b88e0d54f209a488095085f183e9174c40e1e', - 'type' => 'phpstan-extension', - 'install_path' => __DIR__ . '/../thecodingmachine/phpstan-safe-rule', - 'aliases' => array(), - 'dev_requirement' => false, - ), 'thecodingmachine/safe' => array( 'pretty_version' => 'v1.3.3', 'version' => '1.3.3.0', @@ -311,9 +302,9 @@ 'dev_requirement' => false, ), 'tomasvotruba/unused-public' => array( - 'pretty_version' => '1.0.0', - 'version' => '1.0.0.0', - 'reference' => '8c8a94c3abd60d76ccace897c5dabab35953e5ca', + 'pretty_version' => '1.1.0', + 'version' => '1.1.0.0', + 'reference' => 'f05169f07f4a8a53ef05107ee81e4e1201e0d47f', 'type' => 'phpstan-extension', 'install_path' => __DIR__ . '/../tomasvotruba/unused-public', 'aliases' => array(), diff --git a/vendor/doctrine/deprecations/README.md b/vendor/doctrine/deprecations/README.md index 93caf83f8..8b806d1f0 100644 --- a/vendor/doctrine/deprecations/README.md +++ b/vendor/doctrine/deprecations/README.md @@ -150,6 +150,67 @@ class MyTest extends TestCase } ``` +## Displaying deprecations after running a PHPUnit test suite + +It is possible to integrate this library with PHPUnit to display all +deprecations triggered during the test suite execution. + +```xml + + + + + + + + + + + + src + + + +``` + +Note that you can still trigger Deprecations in your code, provided you use the +`#[WithoutErrorHandler]` attribute to disable PHPUnit's error handler for tests +that call it. Be wary that this will disable all error handling, meaning it +will mask any warnings or errors that would otherwise be caught by PHPUnit. + +At the moment, it is not possible to disable deduplication with an environment +variable, but you can use a bootstrap file to achieve that: + +```php +// tests/bootstrap.php + + … + +``` + ## What is a deprecation identifier? An identifier for deprecations is just a link to any resource, most often a diff --git a/vendor/doctrine/deprecations/composer.json b/vendor/doctrine/deprecations/composer.json index f8319f9a2..a7a51e3e8 100644 --- a/vendor/doctrine/deprecations/composer.json +++ b/vendor/doctrine/deprecations/composer.json @@ -8,20 +8,18 @@ "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" }, "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "autoload-dev": { diff --git a/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php b/vendor/doctrine/deprecations/src/Deprecation.php similarity index 95% rename from vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php rename to vendor/doctrine/deprecations/src/Deprecation.php index bad5070ad..1801e6c7c 100644 --- a/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php +++ b/vendor/doctrine/deprecations/src/Deprecation.php @@ -173,9 +173,7 @@ public static function triggerIfCalledFromOutside(string $package, string $link, self::delegateTriggerToBackend($message, $backtrace, $link, $package); } - /** - * @param list $backtrace - */ + /** @param list $backtrace */ private static function delegateTriggerToBackend(string $message, array $backtrace, string $link, string $package): void { $type = self::$type ?? self::getTypeFromEnv(); @@ -226,19 +224,19 @@ private static function basename(string $filename): string public static function enableTrackingDeprecations(): void { - self::$type = self::$type ?? 0; + self::$type = self::$type ?? self::getTypeFromEnv(); self::$type |= self::TYPE_TRACK_DEPRECATIONS; } public static function enableWithTriggerError(): void { - self::$type = self::$type ?? 0; + self::$type = self::$type ?? self::getTypeFromEnv(); self::$type |= self::TYPE_TRIGGER_ERROR; } public static function enableWithPsrLogger(LoggerInterface $logger): void { - self::$type = self::$type ?? 0; + self::$type = self::$type ?? self::getTypeFromEnv(); self::$type |= self::TYPE_PSR_LOGGER; self::$logger = $logger; } @@ -289,9 +287,7 @@ public static function getTriggeredDeprecations(): array return self::$triggeredDeprecations; } - /** - * @return int-mask-of - */ + /** @return int-mask-of */ private static function getTypeFromEnv(): int { switch ($_SERVER['DOCTRINE_DEPRECATIONS'] ?? $_ENV['DOCTRINE_DEPRECATIONS'] ?? null) { diff --git a/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php b/vendor/doctrine/deprecations/src/PHPUnit/VerifyDeprecations.php similarity index 96% rename from vendor/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php rename to vendor/doctrine/deprecations/src/PHPUnit/VerifyDeprecations.php index 4c3366a97..8b322b755 100644 --- a/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php +++ b/vendor/doctrine/deprecations/src/PHPUnit/VerifyDeprecations.php @@ -26,17 +26,13 @@ public function expectNoDeprecationWithIdentifier(string $identifier): void $this->doctrineNoDeprecationsExpectations[$identifier] = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0; } - /** - * @before - */ + /** @before */ public function enableDeprecationTracking(): void { Deprecation::enableTrackingDeprecations(); } - /** - * @after - */ + /** @after */ public function verifyDeprecationsAreTriggered(): void { foreach ($this->doctrineDeprecationsExpectations as $identifier => $expectation) { diff --git a/vendor/staabm/phpstan-todo-by/composer.json b/vendor/staabm/phpstan-todo-by/composer.json index a52f87a5a..6792e3fa4 100644 --- a/vendor/staabm/phpstan-todo-by/composer.json +++ b/vendor/staabm/phpstan-todo-by/composer.json @@ -17,7 +17,7 @@ "composer-runtime-api": "^2", "composer/semver": "^3.4", "nikolaposa/version": "^4.1", - "phpstan/phpstan": "^1.10" + "phpstan/phpstan": "^1.10 || ^2.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.64", diff --git a/vendor/thecodingmachine/phpstan-safe-rule/README.md b/vendor/thecodingmachine/phpstan-safe-rule/README.md deleted file mode 100644 index f6f90b50b..000000000 --- a/vendor/thecodingmachine/phpstan-safe-rule/README.md +++ /dev/null @@ -1,16 +0,0 @@ -[![Latest Stable Version](https://poser.pugx.org/thecodingmachine/phpstan-safe-rule/v/stable)](https://packagist.org/packages/thecodingmachine/phpstan-safe-rule) -[![Total Downloads](https://poser.pugx.org/thecodingmachine/phpstan-safe-rule/downloads)](https://packagist.org/packages/thecodingmachine/phpstan-safe-rule) -[![Latest Unstable Version](https://poser.pugx.org/thecodingmachine/phpstan-safe-rule/v/unstable)](https://packagist.org/packages/thecodingmachine/phpstan-safe-rule) -[![License](https://poser.pugx.org/thecodingmachine/phpstan-safe-rule/license)](https://packagist.org/packages/thecodingmachine/phpstan-safe-rule) -[![Build Status](https://travis-ci.org/thecodingmachine/phpstan-safe-rule.svg?branch=master)](https://travis-ci.org/thecodingmachine/phpstan-safe-rule) -[![Coverage Status](https://coveralls.io/repos/thecodingmachine/phpstan-safe-rule/badge.svg?branch=master&service=github)](https://coveralls.io/github/thecodingmachine/phpstan-safe-rule?branch=master) - - -PHPStan rules for thecodingmachine/safe -======================================= - -The [thecodingmachine/safe](https://github.com/thecodingmachine/safe) package provides a set of core PHP functions rewritten to throw exceptions instead of returning `false` when an error is encountered. - -This PHPStan rule will help you detect unsafe function call and will propose you to use the `thecodingmachine/safe` variant instead. - -Please read [thecodingmachine/safe documentation](https://github.com/thecodingmachine/safe) for details about installation and usage. diff --git a/vendor/thecodingmachine/phpstan-safe-rule/composer.json b/vendor/thecodingmachine/phpstan-safe-rule/composer.json deleted file mode 100644 index d9962b936..000000000 --- a/vendor/thecodingmachine/phpstan-safe-rule/composer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "thecodingmachine/phpstan-safe-rule", - "description": "A PHPStan rule to detect safety issues. Must be used in conjunction with thecodingmachine/safe", - "type": "phpstan-extension", - "license": "MIT", - "authors": [ - { - "name": "David Négrier", - "email": "d.negrier@thecodingmachine.com" - } - ], - "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^1.0", - "thecodingmachine/safe": "^1.0 || ^2.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.5.2 || ^8.0", - "php-coveralls/php-coveralls": "^2.1", - "squizlabs/php_codesniffer": "^3.4" - }, - "autoload": { - "psr-4": { - "TheCodingMachine\\Safe\\PHPStan\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "TheCodingMachine\\Safe\\PHPStan\\": "tests/" - } - }, - "scripts": { - "phpstan": "phpstan analyse src -c phpstan.neon --level=7 --no-progress -vvv", - "cs-fix": "phpcbf", - "cs-check": "phpcs" - }, - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - }, - "phpstan": { - "includes": [ - "phpstan-safe-rule.neon" - ] - } - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon b/vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon deleted file mode 100644 index 9d714f192..000000000 --- a/vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon +++ /dev/null @@ -1,13 +0,0 @@ -services: - - - class: TheCodingMachine\Safe\PHPStan\Rules\UseSafeFunctionsRule - tags: - - phpstan.rules.rule - - - class: TheCodingMachine\Safe\PHPStan\Rules\UseSafeClassesRule - tags: - - phpstan.rules.rule - - - class: TheCodingMachine\Safe\PHPStan\Type\Php\ReplaceSafeFunctionsDynamicReturnTypeExtension - tags: - - phpstan.broker.dynamicFunctionReturnTypeExtension diff --git a/vendor/thecodingmachine/phpstan-safe-rule/src/Rules/UseSafeClassesRule.php b/vendor/thecodingmachine/phpstan-safe-rule/src/Rules/UseSafeClassesRule.php deleted file mode 100644 index 6dfab4877..000000000 --- a/vendor/thecodingmachine/phpstan-safe-rule/src/Rules/UseSafeClassesRule.php +++ /dev/null @@ -1,51 +0,0 @@ - - */ -class UseSafeClassesRule implements Rule -{ - public function getNodeType(): string - { - return Node\Expr\New_::class; - } - - /** - * @param Node\Expr\New_ $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - $classNode = $node->class; - if (!$classNode instanceof Node\Name) { - return []; - } - - $className = $classNode->toString(); - $unsafeClasses = ClassListLoader::getClassList(); - - if (isset($unsafeClasses[$className])) { - return ["Class $className is unsafe to use. Its methods can return FALSE instead of throwing an exception. Please add 'use Safe\\$className;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library."]; - } - - return []; - } -} diff --git a/vendor/thecodingmachine/phpstan-safe-rule/src/Rules/UseSafeFunctionsRule.php b/vendor/thecodingmachine/phpstan-safe-rule/src/Rules/UseSafeFunctionsRule.php deleted file mode 100644 index cdbf2050a..000000000 --- a/vendor/thecodingmachine/phpstan-safe-rule/src/Rules/UseSafeFunctionsRule.php +++ /dev/null @@ -1,92 +0,0 @@ - - */ -class UseSafeFunctionsRule implements Rule -{ - public function getNodeType(): string - { - return Node\Expr\FuncCall::class; - } - - /** - * @param Node\Expr\FuncCall $node - * @param \PHPStan\Analyser\Scope $scope - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node->name instanceof Node\Name) { - return []; - } - $functionName = $node->name->toString(); - $unsafeFunctions = FunctionListLoader::getFunctionList(); - - if (isset($unsafeFunctions[$functionName])) { - if (version_compare(PHP_VERSION, '7.3.0', '>=')) { - if ($functionName === "json_decode") { - if (count($node->args) == 4) { - if ($this->argValueIncludeJSONTHROWONERROR($node->args[3])) { - return []; - } - } - } - if ($functionName === "json_encode") { - if (count($node->args) >= 2) { - if ($this->argValueIncludeJSONTHROWONERROR($node->args[1])) { - return []; - } - } - } - } - - return ["Function $functionName is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\\$functionName;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library."]; - } - - return []; - } - - private function argValueIncludeJSONTHROWONERROR(Arg $arg): bool - { - $parseValue = function ($expr, array $options) use (&$parseValue): array { - if ($expr instanceof Expr\BinaryOp\BitwiseOr) { - return array_merge($parseValue($expr->left, $options), $parseValue($expr->right, $options)); - } elseif ($expr instanceof Expr\ConstFetch) { - return array_merge($options, $expr->name->parts); - } elseif ($expr instanceof Scalar\LNumber) { - return array_merge($options, [$expr->value]); - } else { - return $options; - } - }; - $options = $parseValue($arg->value, []); - - if (in_array("JSON_THROW_ON_ERROR", $options)) { - return true; - } - - return in_array(true, array_map(function ($element) { - // JSON_THROW_ON_ERROR == 4194304 - return ($element & 4194304) == 4194304; - }, array_filter($options, function ($element) { - return is_int($element); - }))); - } -} diff --git a/vendor/thecodingmachine/phpstan-safe-rule/src/Type/Php/ReplaceSafeFunctionsDynamicReturnTypeExtension.php b/vendor/thecodingmachine/phpstan-safe-rule/src/Type/Php/ReplaceSafeFunctionsDynamicReturnTypeExtension.php deleted file mode 100644 index 529b15700..000000000 --- a/vendor/thecodingmachine/phpstan-safe-rule/src/Type/Php/ReplaceSafeFunctionsDynamicReturnTypeExtension.php +++ /dev/null @@ -1,79 +0,0 @@ - */ - private $functions = [ - 'Safe\preg_replace' => 2, - ]; - - public function isFunctionSupported(FunctionReflection $functionReflection): bool - { - return array_key_exists($functionReflection->getName(), $this->functions); - } - - public function getTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type { - $type = $this->getPreliminarilyResolvedTypeFromFunctionCall($functionReflection, $functionCall, $scope); - - $possibleTypes = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - - if (TypeCombinator::containsNull($possibleTypes)) { - $type = TypeCombinator::addNull($type); - } - - return $type; - } - - private function getPreliminarilyResolvedTypeFromFunctionCall( - FunctionReflection $functionReflection, - FuncCall $functionCall, - Scope $scope - ): Type { - $argumentPosition = $this->functions[$functionReflection->getName()]; - if (count($functionCall->args) <= $argumentPosition) { - return ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - } - - $subjectArgumentType = $scope->getType($functionCall->args[$argumentPosition]->value); - $defaultReturnType = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); - if ($subjectArgumentType instanceof MixedType) { - return TypeUtils::toBenevolentUnion($defaultReturnType); - } - $stringType = new StringType(); - $arrayType = new ArrayType(new MixedType(), new MixedType()); - - $isStringSuperType = $stringType->isSuperTypeOf($subjectArgumentType); - $isArraySuperType = $arrayType->isSuperTypeOf($subjectArgumentType); - $compareSuperTypes = $isStringSuperType->compareTo($isArraySuperType); - if ($compareSuperTypes === $isStringSuperType) { - return $stringType; - } elseif ($compareSuperTypes === $isArraySuperType) { - if ($subjectArgumentType instanceof ArrayType) { - return $subjectArgumentType->generalizeValues(); - } - return $subjectArgumentType; - } - - return $defaultReturnType; - } -} diff --git a/vendor/thecodingmachine/phpstan-safe-rule/src/Utils/ClassListLoader.php b/vendor/thecodingmachine/phpstan-safe-rule/src/Utils/ClassListLoader.php deleted file mode 100644 index 74da3a1d3..000000000 --- a/vendor/thecodingmachine/phpstan-safe-rule/src/Utils/ClassListLoader.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - private static $classes = [ - 'DateTime' => 'DateTime', - 'DateTimeImmutable' => 'DateTimeImmutable', - ]; - - /** - * @return class-string[] - */ - public static function getClassList(): array - { - return self::$classes; - } -} diff --git a/vendor/thecodingmachine/phpstan-safe-rule/src/Utils/FunctionListLoader.php b/vendor/thecodingmachine/phpstan-safe-rule/src/Utils/FunctionListLoader.php deleted file mode 100644 index 2f1ad2ad5..000000000 --- a/vendor/thecodingmachine/phpstan-safe-rule/src/Utils/FunctionListLoader.php +++ /dev/null @@ -1,35 +0,0 @@ -|null> + * @implements Collector|null> */ -final class CallUserFuncCollector implements Collector +final class CallableTypeCollector implements Collector { /** * @readonly @@ -39,11 +38,11 @@ public function __construct(Configuration $configuration, ClassTypeDetector $cla public function getNodeType(): string { - return FuncCall::class; + return Expr\Array_::class; } /** - * @param FuncCall $node + * @param Expr\Array_ $node * @return string[]|null */ public function processNode(Node $node, Scope $scope): ?array @@ -52,15 +51,6 @@ public function processNode(Node $node, Scope $scope): ?array return null; } - if ($this->shouldSkipNode($node)) { - return null; - } - - $args = $node->getArgs(); - if (count($args) < 1) { - return null; - } - // skip calls in tests, as they are not used in production $classReflection = $scope->getClassReflection(); if ($classReflection instanceof ClassReflection @@ -68,7 +58,7 @@ public function processNode(Node $node, Scope $scope): ?array return null; } - $callableType = $scope->getType($args[0]->value); + $callableType = $scope->getType($node); if (! $callableType instanceof ConstantArrayType) { return null; } @@ -93,17 +83,4 @@ public function processNode(Node $node, Scope $scope): ?array return $classMethodReferences; } - - /** - * @param FuncCall $node - */ - private function shouldSkipNode(Node $node): bool - { - // unable to resolve method name - if ($node->name instanceof Expr) { - return true; - } - - return strtolower($node->name->toString()) !== 'call_user_func'; - } } diff --git a/vendor/tomasvotruba/unused-public/src/NodeCollectorExtractor.php b/vendor/tomasvotruba/unused-public/src/NodeCollectorExtractor.php index ce678b908..fb860b276 100644 --- a/vendor/tomasvotruba/unused-public/src/NodeCollectorExtractor.php +++ b/vendor/tomasvotruba/unused-public/src/NodeCollectorExtractor.php @@ -7,7 +7,7 @@ use PHPStan\Node\CollectedDataNode; use TomasVotruba\UnusedPublic\CollectorMapper\MethodCallCollectorMapper; use TomasVotruba\UnusedPublic\Collectors\Callable_\AttributeCallableCollector; -use TomasVotruba\UnusedPublic\Collectors\Callable_\CallUserFuncCollector; +use TomasVotruba\UnusedPublic\Collectors\Callable_\CallableTypeCollector; use TomasVotruba\UnusedPublic\Collectors\MethodCall\MethodCallableCollector; use TomasVotruba\UnusedPublic\Collectors\MethodCall\MethodCallCollector; use TomasVotruba\UnusedPublic\Collectors\StaticCall\StaticMethodCallableCollector; @@ -54,7 +54,7 @@ private function extractCollectedDatas(CollectedDataNode $collectedDataNode): ar $collectedDataNode->get(StaticMethodCallCollector::class), $collectedDataNode->get(StaticMethodCallableCollector::class), $collectedDataNode->get(AttributeCallableCollector::class), - $collectedDataNode->get(CallUserFuncCollector::class), + $collectedDataNode->get(CallableTypeCollector::class), ]; } } From d9b9fbe8d8ed2000db888849b9ea17de71720640 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 12 Dec 2024 20:35:13 +0100 Subject: [PATCH 2/4] use rex_file instead --- lib/collector/RexModuleInputVarsCollector.php | 2 +- lib/collector/RexModuleOutputVarsCollector.php | 2 +- lib/collector/RexTemplateVarsCollector.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/collector/RexModuleInputVarsCollector.php b/lib/collector/RexModuleInputVarsCollector.php index 0dd398cf3..d97421e8e 100644 --- a/lib/collector/RexModuleInputVarsCollector.php +++ b/lib/collector/RexModuleInputVarsCollector.php @@ -27,6 +27,6 @@ public function processNode(Node $node, Scope $scope) return null; } - return RexModuleVarsReflection::matchInputVars(\Safe\file_get_contents($scope->getFile())); + return RexModuleVarsReflection::matchInputVars(\rex_file::get($scope->getFile(), '')); } } diff --git a/lib/collector/RexModuleOutputVarsCollector.php b/lib/collector/RexModuleOutputVarsCollector.php index 6e38093d3..aa39e1188 100644 --- a/lib/collector/RexModuleOutputVarsCollector.php +++ b/lib/collector/RexModuleOutputVarsCollector.php @@ -27,6 +27,6 @@ public function processNode(Node $node, Scope $scope) return null; } - return RexModuleVarsReflection::matchOutputVars(\Safe\file_get_contents($scope->getFile())); + return RexModuleVarsReflection::matchOutputVars(\rex_file::get($scope->getFile(), '')); } } diff --git a/lib/collector/RexTemplateVarsCollector.php b/lib/collector/RexTemplateVarsCollector.php index 2e35868f9..4dd5e57d1 100644 --- a/lib/collector/RexTemplateVarsCollector.php +++ b/lib/collector/RexTemplateVarsCollector.php @@ -27,6 +27,6 @@ public function processNode(Node $node, Scope $scope) return null; } - return RexTemplateVarsReflection::matchVars(\Safe\file_get_contents($scope->getFile())); + return RexTemplateVarsReflection::matchVars(\rex_file::get($scope->getFile(), '')); } } From 6fa77e0ebca8cadcfef7e37bac776e3ada9ed0a4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 12 Dec 2024 20:36:54 +0100 Subject: [PATCH 3/4] Update rex-sapi.php --- tests/data/rex-sapi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/rex-sapi.php b/tests/data/rex-sapi.php index e77c496fc..0ee6d8787 100644 --- a/tests/data/rex-sapi.php +++ b/tests/data/rex-sapi.php @@ -44,5 +44,5 @@ function doQux() assertType('int', rex_get('HTTP_REFERER', 'int', 1)); assertType('int|null', rex_get('HTTP_REFERER', 'int', null)); assertType("'foo'|int", rex_get('HTTP_REFERER', 'int', 'foo')); - assertType("'foo'|int", rex_get('HTTP_REFERER', 'int', rand(0,1) ? 'foo' : '')); + assertType("''|'foo'|int", rex_get('HTTP_REFERER', 'int', rand(0,1) === 1 ? 'foo' : '')); } From dd64511770e9eeaa7440a18d1106e08b6d48a8e1 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 12 Dec 2024 20:37:05 +0100 Subject: [PATCH 4/4] Update installed.php --- vendor/composer/installed.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 7d165f436..2c501ff76 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '77c04be391846239eca56b785cf4ab1f2995bf25', + 'reference' => '6fa77e0ebca8cadcfef7e37bac776e3ada9ed0a4', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '77c04be391846239eca56b785cf4ab1f2995bf25', + 'reference' => '6fa77e0ebca8cadcfef7e37bac776e3ada9ed0a4', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),