diff --git a/vendor/phpstan/extension-installer/LICENSE b/vendor/phpstan/extension-installer/LICENSE deleted file mode 100644 index afe8bee4..00000000 --- a/vendor/phpstan/extension-installer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Ondřej Mirtes - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/phpstan/extension-installer/README.md b/vendor/phpstan/extension-installer/README.md deleted file mode 100644 index 70afa415..00000000 --- a/vendor/phpstan/extension-installer/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# PHPStan Extension Installer - -[![Build](https://github.com/phpstan/extension-installer/workflows/Build/badge.svg)](https://github.com/phpstan/extension-installer/actions) -[![Latest Stable Version](https://poser.pugx.org/phpstan/extension-installer/v/stable)](https://packagist.org/packages/phpstan/extension-installer) -[![License](https://poser.pugx.org/phpstan/extension-installer/license)](https://packagist.org/packages/phpstan/extension-installer) - -Composer plugin for automatic installation of [PHPStan](https://phpstan.org/) extensions. - -# Motivation - -```diff -diff --git a/phpstan.neon b/phpstan.neon -index db4e3df32e..2ca30fa20a 100644 ---- a/phpstan.neon -+++ b/phpstan.neon -@@ -1,12 +1,3 @@ --includes: -- - vendor/phpstan/phpstan-doctrine/extension.neon -- - vendor/phpstan/phpstan-doctrine/rules.neon -- - vendor/phpstan/phpstan-nette/extension.neon -- - vendor/phpstan/phpstan-nette/rules.neon -- - vendor/phpstan/phpstan-phpunit/extension.neon -- - vendor/phpstan/phpstan-phpunit/rules.neon -- - vendor/phpstan/phpstan-strict-rules/rules.neon -- - parameters: - autoload_directories: - - %rootDir%/../../../build/SlevomatSniffs -diff --git a/composer.json b/composer.json -index 1b578dd624..f6ebf6e477 100644 ---- a/composer.json -+++ b/composer.json -@@ -142,6 +142,7 @@ - "jakub-onderka/php-parallel-lint": "1.0.0", - "justinrainbow/json-schema": "5.2.8", - "ondrejmirtes/mocktainer": "0.8", -+ "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.11.7", - "phpstan/phpstan-doctrine": "^0.11.3", - "phpstan/phpstan-nette": "^0.11.1", -``` - -## Usage - -```bash -composer require --dev phpstan/extension-installer -``` - -Starting from Composer 2.2.0 you'll get the following question: -``` -phpstan/extension-installer contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins -Do you trust "phpstan/extension-installer" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] -``` - -Answer with `y` to allow the plugin. - -## Instructions for extension developers - -It's best (but optional) to set the extension's composer package [type](https://getcomposer.org/doc/04-schema.md#type) to `phpstan-extension` for this plugin to be able to recognize it and to be [discoverable on Packagist](https://packagist.org/explore/?type=phpstan-extension). - -Add `phpstan` key in the extension `composer.json`'s `extra` section: - -```json -{ - "extra": { - "phpstan": { - "includes": [ - "extension.neon" - ] - } - } -} -``` - -## Limitations - -The extension installer depends on Composer script events, therefore you cannot use `--no-scripts` flag. diff --git a/vendor/phpstan/extension-installer/build-cs/composer.json b/vendor/phpstan/extension-installer/build-cs/composer.json deleted file mode 100644 index e3079710..00000000 --- a/vendor/phpstan/extension-installer/build-cs/composer.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "require-dev": { - "consistence-community/coding-standard": "^3.10", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "slevomat/coding-standard": "^7.0" - }, - "config": { - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - } - } -} diff --git a/vendor/phpstan/extension-installer/build-cs/composer.lock b/vendor/phpstan/extension-installer/build-cs/composer.lock deleted file mode 100644 index 4bcc8de4..00000000 --- a/vendor/phpstan/extension-installer/build-cs/composer.lock +++ /dev/null @@ -1,322 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "4485bbedba7bcc71ace5f69dbb9b6c47", - "packages": [], - "packages-dev": [ - { - "name": "consistence-community/coding-standard", - "version": "3.11.1", - "source": { - "type": "git", - "url": "https://github.com/consistence-community/coding-standard.git", - "reference": "4632fead8c9ee8f50044fcbce9f66c797b34c0df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/consistence-community/coding-standard/zipball/4632fead8c9ee8f50044fcbce9f66c797b34c0df", - "reference": "4632fead8c9ee8f50044fcbce9f66c797b34c0df", - "shasum": "" - }, - "require": { - "php": ">=7.4", - "slevomat/coding-standard": "~7.0", - "squizlabs/php_codesniffer": "~3.6.0" - }, - "replace": { - "consistence/coding-standard": "3.10.*" - }, - "require-dev": { - "phing/phing": "2.16.4", - "php-parallel-lint/php-parallel-lint": "1.3.0", - "phpunit/phpunit": "9.5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Consistence\\": [ - "Consistence" - ] - }, - "classmap": [ - "Consistence" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Vašek Purchart", - "email": "me@vasekpurchart.cz", - "homepage": "http://vasekpurchart.cz" - } - ], - "description": "Consistence - Coding Standard - PHP Code Sniffer rules", - "keywords": [ - "Coding Standard", - "PHPCodeSniffer", - "codesniffer", - "coding", - "cs", - "phpcs", - "ruleset", - "sniffer", - "standard" - ], - "support": { - "issues": "https://github.com/consistence-community/coding-standard/issues", - "source": "https://github.com/consistence-community/coding-standard/tree/3.11.1" - }, - "time": "2021-05-03T18:13:22+00:00" - }, - { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.2", - "source": { - "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" - }, - "require-dev": { - "composer/composer": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" - }, - "autoload": { - "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - }, - { - "name": "Contributors", - "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcbf", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], - "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, - "time": "2022-02-04T12:51:07+00:00" - }, - { - "name": "phpstan/phpdoc-parser", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "981cc368a216c988e862a75e526b6076987d1b50" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/981cc368a216c988e862a75e526b6076987d1b50", - "reference": "981cc368a216c988e862a75e526b6076987d1b50", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "symfony/process": "^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.5.1" - }, - "time": "2022-05-05T11:32:40+00:00" - }, - { - "name": "slevomat/coding-standard", - "version": "7.2.1", - "source": { - "type": "git", - "url": "https://github.com/slevomat/coding-standard.git", - "reference": "aff06ae7a84e4534bf6f821dc982a93a5d477c90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/aff06ae7a84e4534bf6f821dc982a93a5d477c90", - "reference": "aff06ae7a84e4534bf6f821dc982a93a5d477c90", - "shasum": "" - }, - "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", - "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": "^1.5.1", - "squizlabs/php_codesniffer": "^3.6.2" - }, - "require-dev": { - "phing/phing": "2.17.3", - "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.4.10|1.7.1", - "phpstan/phpstan-deprecation-rules": "1.0.0", - "phpstan/phpstan-phpunit": "1.0.0|1.1.1", - "phpstan/phpstan-strict-rules": "1.2.3", - "phpunit/phpunit": "7.5.20|8.5.21|9.5.20" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-master": "7.x-dev" - } - }, - "autoload": { - "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", - "support": { - "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/7.2.1" - }, - "funding": [ - { - "url": "https://github.com/kukulich", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", - "type": "tidelift" - } - ], - "time": "2022-05-25T10:58:12+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.6.2", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, - "time": "2021-12-12T21:44:58+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.3.0" -} diff --git a/vendor/phpstan/extension-installer/composer.json b/vendor/phpstan/extension-installer/composer.json deleted file mode 100644 index c57fcfe5..00000000 --- a/vendor/phpstan/extension-installer/composer.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "phpstan/extension-installer", - "type": "composer-plugin", - "description": "Composer plugin for automatic installation of PHPStan extensions", - "license": [ - "MIT" - ], - "require": { - "php": "^7.2 || ^8.0", - "composer-plugin-api": "^2.0", - "phpstan/phpstan": "^1.8.0" - }, - "require-dev": { - "composer/composer": "^2.0", - "php-parallel-lint/php-parallel-lint": "^1.2.0", - "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0" - }, - "config": { - "sort-packages": true, - "allow-plugins": { - "ocramius/package-versions": true - } - }, - "extra": { - "class": "PHPStan\\ExtensionInstaller\\Plugin" - }, - "autoload": { - "psr-4": { - "PHPStan\\ExtensionInstaller\\": "src/" - } - } -} diff --git a/vendor/phpstan/extension-installer/src/GeneratedConfig.php b/vendor/phpstan/extension-installer/src/GeneratedConfig.php deleted file mode 100644 index 3c9004ac..00000000 --- a/vendor/phpstan/extension-installer/src/GeneratedConfig.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ - public static function getSubscribedEvents(): array - { - return [ - ScriptEvents::POST_INSTALL_CMD => 'process', - ScriptEvents::POST_UPDATE_CMD => 'process', - ]; - } - - public function process(Event $event): void - { - $io = $event->getIO(); - - if (!file_exists(__DIR__)) { - $io->write('phpstan/extension-installer: Package not found (probably scheduled for removal); extensions installation skipped.'); - return; - } - - $composer = $event->getComposer(); - $installationManager = $composer->getInstallationManager(); - - $generatedConfigFilePath = __DIR__ . '/GeneratedConfig.php'; - $oldGeneratedConfigFileHash = null; - if (is_file($generatedConfigFilePath)) { - $oldGeneratedConfigFileHash = md5_file($generatedConfigFilePath); - } - $notInstalledPackages = []; - $installedPackages = []; - - $data = []; - $fs = new Filesystem(); - foreach ($composer->getRepositoryManager()->getLocalRepository()->getPackages() as $package) { - if ( - $package->getType() !== 'phpstan-extension' - && !isset($package->getExtra()['phpstan']) - ) { - if ( - strpos($package->getName(), 'phpstan') !== false - && !in_array($package->getName(), [ - 'phpstan/phpstan', - 'phpstan/phpstan-shim', - 'phpstan/phpdoc-parser', - 'phpstan/extension-installer', - ], true) - ) { - $notInstalledPackages[$package->getName()] = $package->getFullPrettyVersion(); - } - continue; - } - - $installPath = $installationManager->getInstallPath($package); - - $absoluteInstallPath = $fs->isAbsolutePath($installPath) - ? $installPath - : getcwd() . DIRECTORY_SEPARATOR . $installPath; - - $data[$package->getName()] = [ - 'install_path' => $absoluteInstallPath, - 'relative_install_path' => $fs->findShortestPath(dirname($generatedConfigFilePath), $absoluteInstallPath, true), - 'extra' => $package->getExtra()['phpstan'] ?? null, - 'version' => $package->getFullPrettyVersion(), - ]; - - $installedPackages[$package->getName()] = true; - } - - ksort($data); - ksort($installedPackages); - ksort($notInstalledPackages); - - $generatedConfigFileContents = sprintf(self::$generatedFileTemplate, var_export($data, true), var_export($notInstalledPackages, true)); - file_put_contents($generatedConfigFilePath, $generatedConfigFileContents); - $io->write('phpstan/extension-installer: Extensions installed'); - - if ($oldGeneratedConfigFileHash === md5($generatedConfigFileContents)) { - return; - } - - foreach (array_keys($installedPackages) as $name) { - $io->write(sprintf('> %s: installed', $name)); - } - - foreach (array_keys($notInstalledPackages) as $name) { - $io->write(sprintf('> %s: not supported', $name)); - } - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/.editorconfig b/vendor/phpstan/phpstan-strict-rules/.editorconfig deleted file mode 100644 index 5d66bc42..00000000 --- a/vendor/phpstan/phpstan-strict-rules/.editorconfig +++ /dev/null @@ -1,27 +0,0 @@ -root = true - -[*] -end_of_line = lf -insert_final_newline = true -charset = utf-8 -trim_trailing_whitespace = true - -[*.{php,phpt}] -indent_style = tab -indent_size = 4 - -[*.xml] -indent_style = tab -indent_size = 4 - -[*.neon] -indent_style = tab -indent_size = 4 - -[*.{yaml,yml}] -indent_style = space -indent_size = 2 - -[composer.json] -indent_style = tab -indent_size = 4 diff --git a/vendor/phpstan/phpstan-strict-rules/LICENSE b/vendor/phpstan/phpstan-strict-rules/LICENSE deleted file mode 100644 index d0053746..00000000 --- a/vendor/phpstan/phpstan-strict-rules/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2016 Ondřej Mirtes - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/vendor/phpstan/phpstan-strict-rules/README.md b/vendor/phpstan/phpstan-strict-rules/README.md deleted file mode 100644 index 246c0c84..00000000 --- a/vendor/phpstan/phpstan-strict-rules/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# Extra strict and opinionated rules for PHPStan - -[![Build](https://github.com/phpstan/phpstan-strict-rules/workflows/Build/badge.svg)](https://github.com/phpstan/phpstan-strict-rules/actions) -[![Latest Stable Version](https://poser.pugx.org/phpstan/phpstan-strict-rules/v/stable)](https://packagist.org/packages/phpstan/phpstan-strict-rules) -[![License](https://poser.pugx.org/phpstan/phpstan-strict-rules/license)](https://packagist.org/packages/phpstan/phpstan-strict-rules) - -[PHPStan](https://phpstan.org/) focuses on finding bugs in your code. But in PHP there's a lot of leeway in how stuff can be written. This repository contains additional rules that revolve around strictly and strongly typed code with no loose casting for those who want additional safety in extremely defensive programming: - -* Require booleans in `if`, `elseif`, ternary operator, after `!`, and on both sides of `&&` and `||`. -* Require numeric operands or arrays in `+` and numeric operands in `-`/`*`/`/`/`**`/`%`. -* Require numeric operand in `$var++`, `$var--`, `++$var`and `--$var`. -* These functions contain a `$strict` parameter for better type safety, it must be set to `true`: - * `in_array` (3rd parameter) - * `array_search` (3rd parameter) - * `array_keys` (3rd parameter; only if the 2nd parameter `$search_value` is provided) - * `base64_decode` (2nd parameter) -* Variables assigned in `while` loop condition and `for` loop initial assignment cannot be used after the loop. -* Variables set in foreach that's always looped thanks to non-empty arrays cannot be used after the loop. -* Types in `switch` condition and `case` value must match. PHP compares them loosely by default and that can lead to unexpected results. -* Check that statically declared methods are called statically. -* Disallow `empty()` - it's a very loose comparison (see [manual](https://php.net/empty)), it's recommended to use more strict one. -* Disallow short ternary operator (`?:`) - implies weak comparison, it's recommended to use null coalesce operator (`??`) or ternary operator with strict condition. -* Disallow variable variables (`$$foo`, `$this->$method()` etc.) -* Disallow overwriting variables with foreach key and value variables -* Always true `instanceof`, type-checking `is_*` functions and strict comparisons `===`/`!==`. These checks can be turned off by setting `checkAlwaysTrueInstanceof`/`checkAlwaysTrueCheckTypeFunctionCall`/`checkAlwaysTrueStrictComparison` to false. -* Correct case for referenced and called function names. -* Correct case for inherited and implemented method names. -* Contravariance for parameter types and covariance for return types in inherited methods (also known as Liskov substitution principle - LSP) -* Check LSP even for static methods -* Require calling parent constructor -* Disallow usage of backtick operator (`` $ls = `ls -la` ``) -* Closure should use `$this` directly instead of using `$this` variable indirectly - -Additional rules are coming in subsequent releases! - - -## Installation - -To use this extension, require it in [Composer](https://getcomposer.org/): - -``` -composer require --dev phpstan/phpstan-strict-rules -``` - -If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set! - -
- Manual installation - -If you don't want to use `phpstan/extension-installer`, include rules.neon in your project's PHPStan config: - -``` -includes: - - vendor/phpstan/phpstan-strict-rules/rules.neon -``` -
- -## Disabling rules - -You can disable rules using configuration parameters: - -```neon -parameters: - strictRules: - disallowedLooseComparison: false - booleansInConditions: false - uselessCast: false - requireParentConstructorCall: false - disallowedConstructs: false - overwriteVariablesWithLoop: false - closureUsesThis: false - matchingInheritedMethodNames: false - numericOperandsInArithmeticOperators: false - strictCalls: false - switchConditionsMatchingType: false - noVariableVariables: false -``` - -## Enabling rules one-by-one - -If you don't want to start using all the available strict rules at once but only one or two, you can! - -You can disable all rules from the included `rules.neon` with: - -```neon -parameters: - strictRules: - allRules: false -``` - -Then you can re-enable individual rules with configuration parameters: - -```neon -parameters: - strictRules: - allRules: false - booleansInConditions: true -``` diff --git a/vendor/phpstan/phpstan-strict-rules/build-cs/composer.json b/vendor/phpstan/phpstan-strict-rules/build-cs/composer.json deleted file mode 100644 index e3079710..00000000 --- a/vendor/phpstan/phpstan-strict-rules/build-cs/composer.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "require-dev": { - "consistence-community/coding-standard": "^3.10", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "slevomat/coding-standard": "^7.0" - }, - "config": { - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - } - } -} diff --git a/vendor/phpstan/phpstan-strict-rules/build-cs/composer.lock b/vendor/phpstan/phpstan-strict-rules/build-cs/composer.lock deleted file mode 100644 index 4bcc8de4..00000000 --- a/vendor/phpstan/phpstan-strict-rules/build-cs/composer.lock +++ /dev/null @@ -1,322 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "4485bbedba7bcc71ace5f69dbb9b6c47", - "packages": [], - "packages-dev": [ - { - "name": "consistence-community/coding-standard", - "version": "3.11.1", - "source": { - "type": "git", - "url": "https://github.com/consistence-community/coding-standard.git", - "reference": "4632fead8c9ee8f50044fcbce9f66c797b34c0df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/consistence-community/coding-standard/zipball/4632fead8c9ee8f50044fcbce9f66c797b34c0df", - "reference": "4632fead8c9ee8f50044fcbce9f66c797b34c0df", - "shasum": "" - }, - "require": { - "php": ">=7.4", - "slevomat/coding-standard": "~7.0", - "squizlabs/php_codesniffer": "~3.6.0" - }, - "replace": { - "consistence/coding-standard": "3.10.*" - }, - "require-dev": { - "phing/phing": "2.16.4", - "php-parallel-lint/php-parallel-lint": "1.3.0", - "phpunit/phpunit": "9.5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Consistence\\": [ - "Consistence" - ] - }, - "classmap": [ - "Consistence" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Vašek Purchart", - "email": "me@vasekpurchart.cz", - "homepage": "http://vasekpurchart.cz" - } - ], - "description": "Consistence - Coding Standard - PHP Code Sniffer rules", - "keywords": [ - "Coding Standard", - "PHPCodeSniffer", - "codesniffer", - "coding", - "cs", - "phpcs", - "ruleset", - "sniffer", - "standard" - ], - "support": { - "issues": "https://github.com/consistence-community/coding-standard/issues", - "source": "https://github.com/consistence-community/coding-standard/tree/3.11.1" - }, - "time": "2021-05-03T18:13:22+00:00" - }, - { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.2", - "source": { - "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" - }, - "require-dev": { - "composer/composer": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" - }, - "autoload": { - "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - }, - { - "name": "Contributors", - "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcbf", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], - "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, - "time": "2022-02-04T12:51:07+00:00" - }, - { - "name": "phpstan/phpdoc-parser", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "981cc368a216c988e862a75e526b6076987d1b50" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/981cc368a216c988e862a75e526b6076987d1b50", - "reference": "981cc368a216c988e862a75e526b6076987d1b50", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "symfony/process": "^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.5.1" - }, - "time": "2022-05-05T11:32:40+00:00" - }, - { - "name": "slevomat/coding-standard", - "version": "7.2.1", - "source": { - "type": "git", - "url": "https://github.com/slevomat/coding-standard.git", - "reference": "aff06ae7a84e4534bf6f821dc982a93a5d477c90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/aff06ae7a84e4534bf6f821dc982a93a5d477c90", - "reference": "aff06ae7a84e4534bf6f821dc982a93a5d477c90", - "shasum": "" - }, - "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", - "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": "^1.5.1", - "squizlabs/php_codesniffer": "^3.6.2" - }, - "require-dev": { - "phing/phing": "2.17.3", - "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.4.10|1.7.1", - "phpstan/phpstan-deprecation-rules": "1.0.0", - "phpstan/phpstan-phpunit": "1.0.0|1.1.1", - "phpstan/phpstan-strict-rules": "1.2.3", - "phpunit/phpunit": "7.5.20|8.5.21|9.5.20" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-master": "7.x-dev" - } - }, - "autoload": { - "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", - "support": { - "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/7.2.1" - }, - "funding": [ - { - "url": "https://github.com/kukulich", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", - "type": "tidelift" - } - ], - "time": "2022-05-25T10:58:12+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.6.2", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, - "time": "2021-12-12T21:44:58+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.3.0" -} diff --git a/vendor/phpstan/phpstan-strict-rules/composer.json b/vendor/phpstan/phpstan-strict-rules/composer.json deleted file mode 100644 index 9cf4e652..00000000 --- a/vendor/phpstan/phpstan-strict-rules/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "phpstan/phpstan-strict-rules", - "type": "phpstan-extension", - "description": "Extra strict and opinionated rules for PHPStan", - "license": [ - "MIT" - ], - "require": { - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10" - }, - "require-dev": { - "nikic/php-parser": "^4.13.0", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-deprecation-rules": "^1.1", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5" - }, - "config": { - "platform": { - "php": "7.4.6" - }, - "sort-packages": true - }, - "extra": { - "phpstan": { - "includes": [ - "rules.neon" - ] - } - }, - "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } - }, - "autoload-dev": { - "classmap": [ - "tests/" - ] - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/vendor/phpstan/phpstan-strict-rules/phpstan-baseline.neon b/vendor/phpstan/phpstan-strict-rules/phpstan-baseline.neon deleted file mode 100644 index 84faab10..00000000 --- a/vendor/phpstan/phpstan-strict-rules/phpstan-baseline.neon +++ /dev/null @@ -1,478 +0,0 @@ - - -parameters: - ignoreErrors: - - - message: "#^Class PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInBooleanNotRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/BooleansInConditions/BooleanInBooleanNotRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\BooleanNot\\) of method PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInBooleanNotRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/BooleansInConditions/BooleanInBooleanNotRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInElseIfConditionRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/BooleansInConditions/BooleanInElseIfConditionRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Stmt\\\\ElseIf_\\) of method PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInElseIfConditionRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/BooleansInConditions/BooleanInElseIfConditionRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInIfConditionRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/BooleansInConditions/BooleanInIfConditionRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Stmt\\\\If_\\) of method PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInIfConditionRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/BooleansInConditions/BooleanInIfConditionRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInTernaryOperatorRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/BooleansInConditions/BooleanInTernaryOperatorRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\Ternary\\) of method PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInTernaryOperatorRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/BooleansInConditions/BooleanInTernaryOperatorRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Cast\\\\UselessCastRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/Cast/UselessCastRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\Cast\\) of method PHPStan\\\\Rules\\\\Cast\\\\UselessCastRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/Cast/UselessCastRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Classes\\\\RequireParentConstructCallRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/Classes/RequireParentConstructCallRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Stmt\\\\ClassMethod\\) of method PHPStan\\\\Rules\\\\Classes\\\\RequireParentConstructCallRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/Classes/RequireParentConstructCallRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\DisallowedConstructs\\\\DisallowedBacktickRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/DisallowedConstructs/DisallowedBacktickRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\Empty_\\) of method PHPStan\\\\Rules\\\\DisallowedConstructs\\\\DisallowedBacktickRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/DisallowedConstructs/DisallowedBacktickRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\DisallowedConstructs\\\\DisallowedEmptyRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/DisallowedConstructs/DisallowedEmptyRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\Empty_\\) of method PHPStan\\\\Rules\\\\DisallowedConstructs\\\\DisallowedEmptyRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/DisallowedConstructs/DisallowedEmptyRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\DisallowedConstructs\\\\DisallowedImplicitArrayCreationRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/DisallowedConstructs/DisallowedImplicitArrayCreationRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\Assign\\) of method PHPStan\\\\Rules\\\\DisallowedConstructs\\\\DisallowedImplicitArrayCreationRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/DisallowedConstructs/DisallowedImplicitArrayCreationRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\ForeachLoop\\\\OverwriteVariablesWithForeachRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/ForeachLoop/OverwriteVariablesWithForeachRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Stmt\\\\Foreach_\\) of method PHPStan\\\\Rules\\\\ForeachLoop\\\\OverwriteVariablesWithForeachRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/ForeachLoop/OverwriteVariablesWithForeachRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticAdditionRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/Operators/OperandsInArithmeticAdditionRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticDivisionRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/Operators/OperandsInArithmeticDivisionRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticExponentiationRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/Operators/OperandsInArithmeticExponentiationRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticModuloRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/Operators/OperandsInArithmeticModuloRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticMultiplicationRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/Operators/OperandsInArithmeticMultiplicationRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticSubtractionRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/Operators/OperandsInArithmeticSubtractionRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\StrictCalls\\\\DynamicCallOnStaticMethodsRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/StrictCalls/DynamicCallOnStaticMethodsRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\MethodCall\\) of method PHPStan\\\\Rules\\\\StrictCalls\\\\DynamicCallOnStaticMethodsRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/StrictCalls/DynamicCallOnStaticMethodsRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\StrictCalls\\\\StrictFunctionCallsRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/StrictCalls/StrictFunctionCallsRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\FuncCall\\) of method PHPStan\\\\Rules\\\\StrictCalls\\\\StrictFunctionCallsRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/StrictCalls/StrictFunctionCallsRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\VariableVariables\\\\VariableMethodCallRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/VariableVariables/VariableMethodCallRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\MethodCall\\) of method PHPStan\\\\Rules\\\\VariableVariables\\\\VariableMethodCallRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/VariableVariables/VariableMethodCallRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\VariableVariables\\\\VariablePropertyFetchRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/VariableVariables/VariablePropertyFetchRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\PropertyFetch\\) of method PHPStan\\\\Rules\\\\VariableVariables\\\\VariablePropertyFetchRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/VariableVariables/VariablePropertyFetchRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\VariableVariables\\\\VariableStaticMethodCallRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/VariableVariables/VariableStaticMethodCallRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\StaticCall\\) of method PHPStan\\\\Rules\\\\VariableVariables\\\\VariableStaticMethodCallRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/VariableVariables/VariableStaticMethodCallRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\VariableVariables\\\\VariableStaticPropertyFetchRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/VariableVariables/VariableStaticPropertyFetchRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\StaticPropertyFetch\\) of method PHPStan\\\\Rules\\\\VariableVariables\\\\VariableStaticPropertyFetchRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/VariableVariables/VariableStaticPropertyFetchRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\VariableVariables\\\\VariableVariablesRule implements generic interface PHPStan\\\\Rules\\\\Rule but does not specify its types\\: TNodeType$#" - count: 1 - path: src/Rules/VariableVariables/VariableVariablesRule.php - - - - message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\Variable\\) of method PHPStan\\\\Rules\\\\VariableVariables\\\\VariableVariablesRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\\\:\\:processNode\\(\\)$#" - count: 1 - path: src/Rules/VariableVariables/VariableVariablesRule.php - - - - message: "#^Class PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInBooleanNotRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/BooleansInConditions/BooleanInBooleanNotRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInBooleanNotRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/BooleansInConditions/BooleanInBooleanNotRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInElseIfConditionRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/BooleansInConditions/BooleanInElseIfConditionRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInElseIfConditionRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/BooleansInConditions/BooleanInElseIfConditionRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInIfConditionRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/BooleansInConditions/BooleanInIfConditionRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInIfConditionRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/BooleansInConditions/BooleanInIfConditionRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInTernaryOperatorRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/BooleansInConditions/BooleanInTernaryOperatorRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\BooleansInConditions\\\\BooleanInTernaryOperatorRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/BooleansInConditions/BooleanInTernaryOperatorRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Cast\\\\UselessCastRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/Cast/UselessCastRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Cast\\\\UselessCastRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Cast/UselessCastRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Classes\\\\RequireParentConstructCallRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/Classes/RequireParentConstructCallRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Classes\\\\RequireParentConstructCallRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Classes/RequireParentConstructCallRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\DisallowedConstructs\\\\DisallowedBacktickRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/DisallowedConstructs/DisallowedBacktickRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\DisallowedConstructs\\\\DisallowedBacktickRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/DisallowedConstructs/DisallowedBacktickRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\DisallowedConstructs\\\\DisallowedEmptyRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/DisallowedConstructs/DisallowedEmptyRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\DisallowedConstructs\\\\DisallowedEmptyRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/DisallowedConstructs/DisallowedEmptyRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\DisallowedConstructs\\\\DisallowedImplicitArrayCreationRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/DisallowedConstructs/DisallowedImplicitArrayCreationRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\DisallowedConstructs\\\\DisallowedImplicitArrayCreationRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/DisallowedConstructs/DisallowedImplicitArrayCreationRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\ForeachLoop\\\\OverwriteVariablesWithForeachRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/ForeachLoop/OverwriteVariablesWithForeachRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\ForeachLoop\\\\OverwriteVariablesWithForeachRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/ForeachLoop/OverwriteVariablesWithForeachRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Methods\\\\WrongCaseOfInheritedMethodRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/Methods/WrongCaseOfInheritedMethodRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Methods\\\\WrongCaseOfInheritedMethodRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Methods/WrongCaseOfInheritedMethodRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandInArithmeticIncrementOrDecrementRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/Operators/OperandInArithmeticIncrementOrDecrementRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Operators\\\\OperandInArithmeticIncrementOrDecrementRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Operators/OperandInArithmeticIncrementOrDecrementRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Operators\\\\OperandInArithmeticIncrementOrDecrementRuleTest\\:\\:createRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Operators/OperandInArithmeticIncrementOrDecrementRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Operators\\\\OperandInArithmeticPostDecrementRuleTest\\:\\:createRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Operators/OperandInArithmeticPostDecrementRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Operators\\\\OperandInArithmeticPostIncrementRuleTest\\:\\:createRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Operators/OperandInArithmeticPostIncrementRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Operators\\\\OperandInArithmeticPreDecrementRuleTest\\:\\:createRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Operators/OperandInArithmeticPreDecrementRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Operators\\\\OperandInArithmeticPreIncrementRuleTest\\:\\:createRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Operators/OperandInArithmeticPreIncrementRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticAdditionRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/Operators/OperandsInArithmeticAdditionRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticAdditionRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Operators/OperandsInArithmeticAdditionRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticDivisionRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/Operators/OperandsInArithmeticDivisionRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticDivisionRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Operators/OperandsInArithmeticDivisionRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticExponentiationRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/Operators/OperandsInArithmeticExponentiationRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticExponentiationRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Operators/OperandsInArithmeticExponentiationRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticModuloRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/Operators/OperandsInArithmeticModuloRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticModuloRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Operators/OperandsInArithmeticModuloRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticMultiplicationRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/Operators/OperandsInArithmeticMultiplicationRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticMultiplicationRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Operators/OperandsInArithmeticMultiplicationRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticSubtractionRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/Operators/OperandsInArithmeticSubtractionRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\Operators\\\\OperandsInArithmeticSubtractionRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/Operators/OperandsInArithmeticSubtractionRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\StrictCalls\\\\DynamicCallOnStaticMethodsRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/StrictCalls/DynamicCallOnStaticMethodsRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\StrictCalls\\\\DynamicCallOnStaticMethodsRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/StrictCalls/DynamicCallOnStaticMethodsRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\StrictCalls\\\\StrictFunctionCallsRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/StrictCalls/StrictFunctionCallsRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\StrictCalls\\\\StrictFunctionCallsRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/StrictCalls/StrictFunctionCallsRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\VariableVariables\\\\VariableMethodCallRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/VariableVariables/VariableMethodCallRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\VariableVariables\\\\VariableMethodCallRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/VariableVariables/VariableMethodCallRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\VariableVariables\\\\VariablePropertyFetchRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/VariableVariables/VariablePropertyFetchRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\VariableVariables\\\\VariablePropertyFetchRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/VariableVariables/VariablePropertyFetchRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\VariableVariables\\\\VariableStaticMethodCallRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/VariableVariables/VariableStaticMethodCallRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\VariableVariables\\\\VariableStaticMethodCallRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/VariableVariables/VariableStaticMethodCallRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\VariableVariables\\\\VariableStaticPropertyFetchRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/VariableVariables/VariableStaticPropertyFetchRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\VariableVariables\\\\VariableStaticPropertyFetchRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/VariableVariables/VariableStaticPropertyFetchRuleTest.php - - - - message: "#^Class PHPStan\\\\Rules\\\\VariableVariables\\\\VariableVariablesRuleTest extends generic class PHPStan\\\\Testing\\\\RuleTestCase but does not specify its types\\: TRule$#" - count: 1 - path: tests/Rules/VariableVariables/VariableVariablesRuleTest.php - - - - message: "#^Method PHPStan\\\\Rules\\\\VariableVariables\\\\VariableVariablesRuleTest\\:\\:getRule\\(\\) return type with generic interface PHPStan\\\\Rules\\\\Rule does not specify its types\\: TNodeType$#" - count: 1 - path: tests/Rules/VariableVariables/VariableVariablesRuleTest.php diff --git a/vendor/phpstan/phpstan-strict-rules/rules.neon b/vendor/phpstan/phpstan-strict-rules/rules.neon deleted file mode 100644 index 46632c0c..00000000 --- a/vendor/phpstan/phpstan-strict-rules/rules.neon +++ /dev/null @@ -1,263 +0,0 @@ -parameters: - polluteScopeWithLoopInitialAssignments: false - polluteScopeWithAlwaysIterableForeach: false - checkAlwaysTrueCheckTypeFunctionCall: true - checkAlwaysTrueInstanceof: true - checkAlwaysTrueStrictComparison: true - checkAlwaysTrueLooseComparison: true - checkDynamicProperties: %featureToggles.bleedingEdge% - checkExplicitMixedMissingReturn: true - checkFunctionNameCase: true - checkInternalClassCaseSensitivity: true - reportMaybesInMethodSignatures: true - reportStaticMethodSignatures: true - reportMaybesInPropertyPhpDocTypes: true - reportWrongPhpDocTypeInVarTag: %featureToggles.bleedingEdge% - featureToggles: - illegalConstructorMethodCall: %featureToggles.bleedingEdge% - strictRules: - allRules: true - disallowedLooseComparison: [%strictRules.allRules%, %featureToggles.bleedingEdge%] - booleansInConditions: %strictRules.allRules% - uselessCast: %strictRules.allRules% - requireParentConstructorCall: %strictRules.allRules% - disallowedConstructs: %strictRules.allRules% - overwriteVariablesWithLoop: %strictRules.allRules% - closureUsesThis: %strictRules.allRules% - matchingInheritedMethodNames: %strictRules.allRules% - numericOperandsInArithmeticOperators: %strictRules.allRules% - strictCalls: %strictRules.allRules% - switchConditionsMatchingType: %strictRules.allRules% - noVariableVariables: %strictRules.allRules% - -parametersSchema: - strictRules: structure([ - allRules: anyOf(bool(), arrayOf(bool())), - disallowedLooseComparison: anyOf(bool(), arrayOf(bool())), - booleansInConditions: anyOf(bool(), arrayOf(bool())) - uselessCast: anyOf(bool(), arrayOf(bool())) - requireParentConstructorCall: anyOf(bool(), arrayOf(bool())) - disallowedConstructs: anyOf(bool(), arrayOf(bool())) - overwriteVariablesWithLoop: anyOf(bool(), arrayOf(bool())) - closureUsesThis: anyOf(bool(), arrayOf(bool())) - matchingInheritedMethodNames: anyOf(bool(), arrayOf(bool())) - numericOperandsInArithmeticOperators: anyOf(bool(), arrayOf(bool())) - strictCalls: anyOf(bool(), arrayOf(bool())) - switchConditionsMatchingType: anyOf(bool(), arrayOf(bool())) - noVariableVariables: anyOf(bool(), arrayOf(bool())) - ]) - -conditionalTags: - PHPStan\Rules\DisallowedConstructs\DisallowedLooseComparisonRule: - phpstan.rules.rule: %strictRules.disallowedLooseComparison% - PHPStan\Rules\BooleansInConditions\BooleanInBooleanAndRule: - phpstan.rules.rule: %strictRules.booleansInConditions% - PHPStan\Rules\BooleansInConditions\BooleanInBooleanNotRule: - phpstan.rules.rule: %strictRules.booleansInConditions% - PHPStan\Rules\BooleansInConditions\BooleanInBooleanOrRule: - phpstan.rules.rule: %strictRules.booleansInConditions% - PHPStan\Rules\BooleansInConditions\BooleanInElseIfConditionRule: - phpstan.rules.rule: %strictRules.booleansInConditions% - PHPStan\Rules\BooleansInConditions\BooleanInIfConditionRule: - phpstan.rules.rule: %strictRules.booleansInConditions% - PHPStan\Rules\BooleansInConditions\BooleanInTernaryOperatorRule: - phpstan.rules.rule: %strictRules.booleansInConditions% - PHPStan\Rules\Cast\UselessCastRule: - phpstan.rules.rule: %strictRules.uselessCast% - PHPStan\Rules\Classes\RequireParentConstructCallRule: - phpstan.rules.rule: %strictRules.requireParentConstructorCall% - PHPStan\Rules\DisallowedConstructs\DisallowedBacktickRule: - phpstan.rules.rule: %strictRules.disallowedConstructs% - PHPStan\Rules\DisallowedConstructs\DisallowedEmptyRule: - phpstan.rules.rule: %strictRules.disallowedConstructs% - PHPStan\Rules\DisallowedConstructs\DisallowedImplicitArrayCreationRule: - phpstan.rules.rule: %strictRules.disallowedConstructs% - PHPStan\Rules\DisallowedConstructs\DisallowedShortTernaryRule: - phpstan.rules.rule: %strictRules.disallowedConstructs% - PHPStan\Rules\ForeachLoop\OverwriteVariablesWithForeachRule: - phpstan.rules.rule: %strictRules.overwriteVariablesWithLoop% - PHPStan\Rules\ForLoop\OverwriteVariablesWithForLoopInitRule: - phpstan.rules.rule: %strictRules.overwriteVariablesWithLoop% - PHPStan\Rules\Functions\ClosureUsesThisRule: - phpstan.rules.rule: %strictRules.closureUsesThis% - PHPStan\Rules\Methods\WrongCaseOfInheritedMethodRule: - phpstan.rules.rule: %strictRules.matchingInheritedMethodNames% - PHPStan\Rules\Operators\OperandInArithmeticPostDecrementRule: - phpstan.rules.rule: %strictRules.numericOperandsInArithmeticOperators% - PHPStan\Rules\Operators\OperandInArithmeticPostIncrementRule: - phpstan.rules.rule: %strictRules.numericOperandsInArithmeticOperators% - PHPStan\Rules\Operators\OperandInArithmeticPreDecrementRule: - phpstan.rules.rule: %strictRules.numericOperandsInArithmeticOperators% - PHPStan\Rules\Operators\OperandInArithmeticPreIncrementRule: - phpstan.rules.rule: %strictRules.numericOperandsInArithmeticOperators% - PHPStan\Rules\Operators\OperandsInArithmeticAdditionRule: - phpstan.rules.rule: %strictRules.numericOperandsInArithmeticOperators% - PHPStan\Rules\Operators\OperandsInArithmeticDivisionRule: - phpstan.rules.rule: %strictRules.numericOperandsInArithmeticOperators% - PHPStan\Rules\Operators\OperandsInArithmeticExponentiationRule: - phpstan.rules.rule: %strictRules.numericOperandsInArithmeticOperators% - PHPStan\Rules\Operators\OperandsInArithmeticModuloRule: - phpstan.rules.rule: %strictRules.numericOperandsInArithmeticOperators% - PHPStan\Rules\Operators\OperandsInArithmeticMultiplicationRule: - phpstan.rules.rule: %strictRules.numericOperandsInArithmeticOperators% - PHPStan\Rules\Operators\OperandsInArithmeticSubtractionRule: - phpstan.rules.rule: %strictRules.numericOperandsInArithmeticOperators% - PHPStan\Rules\StrictCalls\DynamicCallOnStaticMethodsRule: - phpstan.rules.rule: %strictRules.strictCalls% - PHPStan\Rules\StrictCalls\DynamicCallOnStaticMethodsCallableRule: - phpstan.rules.rule: %strictRules.strictCalls% - PHPStan\Rules\StrictCalls\StrictFunctionCallsRule: - phpstan.rules.rule: %strictRules.strictCalls% - PHPStan\Rules\SwitchConditions\MatchingTypeInSwitchCaseConditionRule: - phpstan.rules.rule: %strictRules.switchConditionsMatchingType% - PHPStan\Rules\VariableVariables\VariableMethodCallRule: - phpstan.rules.rule: %strictRules.noVariableVariables% - PHPStan\Rules\VariableVariables\VariableMethodCallableRule: - phpstan.rules.rule: %strictRules.noVariableVariables% - PHPStan\Rules\VariableVariables\VariableStaticMethodCallRule: - phpstan.rules.rule: %strictRules.noVariableVariables% - PHPStan\Rules\VariableVariables\VariableStaticMethodCallableRule: - phpstan.rules.rule: %strictRules.noVariableVariables% - PHPStan\Rules\VariableVariables\VariableStaticPropertyFetchRule: - phpstan.rules.rule: %strictRules.noVariableVariables% - PHPStan\Rules\VariableVariables\VariableVariablesRule: - phpstan.rules.rule: %strictRules.noVariableVariables% - PHPStan\Rules\VariableVariables\VariablePropertyFetchRule: - phpstan.rules.rule: %strictRules.noVariableVariables% - -services: - - - class: PHPStan\Rules\BooleansInConditions\BooleanRuleHelper - - - - class: PHPStan\Rules\Operators\OperatorRuleHelper - - - - class: PHPStan\Rules\VariableVariables\VariablePropertyFetchRule - arguments: - universalObjectCratesClasses: %universalObjectCratesClasses% - - - - class: PHPStan\Rules\DisallowedConstructs\DisallowedLooseComparisonRule - - - - class: PHPStan\Rules\BooleansInConditions\BooleanInBooleanAndRule - - - - class: PHPStan\Rules\BooleansInConditions\BooleanInBooleanNotRule - - - - class: PHPStan\Rules\BooleansInConditions\BooleanInBooleanOrRule - - - - class: PHPStan\Rules\BooleansInConditions\BooleanInElseIfConditionRule - - - - class: PHPStan\Rules\BooleansInConditions\BooleanInIfConditionRule - - - - class: PHPStan\Rules\BooleansInConditions\BooleanInTernaryOperatorRule - - - - class: PHPStan\Rules\Cast\UselessCastRule - arguments: - treatPhpDocTypesAsCertain: %treatPhpDocTypesAsCertain% - - - - class: PHPStan\Rules\Classes\RequireParentConstructCallRule - - - - class: PHPStan\Rules\DisallowedConstructs\DisallowedBacktickRule - - - - class: PHPStan\Rules\DisallowedConstructs\DisallowedEmptyRule - - - - class: PHPStan\Rules\DisallowedConstructs\DisallowedImplicitArrayCreationRule - - - - class: PHPStan\Rules\DisallowedConstructs\DisallowedShortTernaryRule - - - - class: PHPStan\Rules\ForeachLoop\OverwriteVariablesWithForeachRule - - - - class: PHPStan\Rules\ForLoop\OverwriteVariablesWithForLoopInitRule - - - - class: PHPStan\Rules\Functions\ClosureUsesThisRule - - - - class: PHPStan\Rules\Methods\WrongCaseOfInheritedMethodRule - - - - class: PHPStan\Rules\Operators\OperandInArithmeticPostDecrementRule - - - - class: PHPStan\Rules\Operators\OperandInArithmeticPostIncrementRule - - - - class: PHPStan\Rules\Operators\OperandInArithmeticPreDecrementRule - - - - class: PHPStan\Rules\Operators\OperandInArithmeticPreIncrementRule - - - - class: PHPStan\Rules\Operators\OperandsInArithmeticAdditionRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - - - - class: PHPStan\Rules\Operators\OperandsInArithmeticDivisionRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - - - - class: PHPStan\Rules\Operators\OperandsInArithmeticExponentiationRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - - - - class: PHPStan\Rules\Operators\OperandsInArithmeticModuloRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - - - - class: PHPStan\Rules\Operators\OperandsInArithmeticMultiplicationRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - - - - class: PHPStan\Rules\Operators\OperandsInArithmeticSubtractionRule - arguments: - bleedingEdge: %featureToggles.bleedingEdge% - - - - class: PHPStan\Rules\StrictCalls\DynamicCallOnStaticMethodsRule - - - - class: PHPStan\Rules\StrictCalls\DynamicCallOnStaticMethodsCallableRule - - - - class: PHPStan\Rules\StrictCalls\StrictFunctionCallsRule - - - - class: PHPStan\Rules\SwitchConditions\MatchingTypeInSwitchCaseConditionRule - - - - class: PHPStan\Rules\VariableVariables\VariableMethodCallRule - - - - class: PHPStan\Rules\VariableVariables\VariableMethodCallableRule - - - - class: PHPStan\Rules\VariableVariables\VariableStaticMethodCallRule - - - - class: PHPStan\Rules\VariableVariables\VariableStaticMethodCallableRule - - - - class: PHPStan\Rules\VariableVariables\VariableStaticPropertyFetchRule - - - - class: PHPStan\Rules\VariableVariables\VariableVariablesRule diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInBooleanAndRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInBooleanAndRule.php deleted file mode 100644 index 53140ccf..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInBooleanAndRule.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ -class BooleanInBooleanAndRule implements Rule -{ - - /** @var BooleanRuleHelper */ - private $helper; - - public function __construct(BooleanRuleHelper $helper) - { - $this->helper = $helper; - } - - public function getNodeType(): string - { - return BooleanAndNode::class; - } - - public function processNode(Node $node, Scope $scope): array - { - $originalNode = $node->getOriginalNode(); - $messages = []; - if (!$this->helper->passesAsBoolean($scope, $originalNode->left)) { - $leftType = $scope->getType($originalNode->left); - $messages[] = sprintf( - 'Only booleans are allowed in &&, %s given on the left side.', - $leftType->describe(VerbosityLevel::typeOnly()) - ); - } - - $rightScope = $node->getRightScope(); - if (!$this->helper->passesAsBoolean($rightScope, $originalNode->right)) { - $rightType = $rightScope->getType($originalNode->right); - $messages[] = sprintf( - 'Only booleans are allowed in &&, %s given on the right side.', - $rightType->describe(VerbosityLevel::typeOnly()) - ); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInBooleanNotRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInBooleanNotRule.php deleted file mode 100644 index 0e53c873..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInBooleanNotRule.php +++ /dev/null @@ -1,48 +0,0 @@ -helper = $helper; - } - - public function getNodeType(): string - { - return BooleanNot::class; - } - - /** - * @param BooleanNot $node - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if ($this->helper->passesAsBoolean($scope, $node->expr)) { - return []; - } - - $expressionType = $scope->getType($node->expr); - - return [ - sprintf( - 'Only booleans are allowed in a negated boolean, %s given.', - $expressionType->describe(VerbosityLevel::typeOnly()) - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInBooleanOrRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInBooleanOrRule.php deleted file mode 100644 index bf98c5cd..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInBooleanOrRule.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ -class BooleanInBooleanOrRule implements Rule -{ - - /** @var BooleanRuleHelper */ - private $helper; - - public function __construct(BooleanRuleHelper $helper) - { - $this->helper = $helper; - } - - public function getNodeType(): string - { - return BooleanOrNode::class; - } - - public function processNode(Node $node, Scope $scope): array - { - $originalNode = $node->getOriginalNode(); - $messages = []; - if (!$this->helper->passesAsBoolean($scope, $originalNode->left)) { - $leftType = $scope->getType($originalNode->left); - $messages[] = sprintf( - 'Only booleans are allowed in ||, %s given on the left side.', - $leftType->describe(VerbosityLevel::typeOnly()) - ); - } - - $rightScope = $node->getRightScope(); - if (!$this->helper->passesAsBoolean($rightScope, $originalNode->right)) { - $rightType = $rightScope->getType($originalNode->right); - $messages[] = sprintf( - 'Only booleans are allowed in ||, %s given on the right side.', - $rightType->describe(VerbosityLevel::typeOnly()) - ); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInElseIfConditionRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInElseIfConditionRule.php deleted file mode 100644 index 8dfe3dac..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInElseIfConditionRule.php +++ /dev/null @@ -1,48 +0,0 @@ -helper = $helper; - } - - public function getNodeType(): string - { - return ElseIf_::class; - } - - /** - * @param ElseIf_ $node - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if ($this->helper->passesAsBoolean($scope, $node->cond)) { - return []; - } - - $conditionExpressionType = $scope->getType($node->cond); - - return [ - sprintf( - 'Only booleans are allowed in an elseif condition, %s given.', - $conditionExpressionType->describe(VerbosityLevel::typeOnly()) - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInIfConditionRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInIfConditionRule.php deleted file mode 100644 index 7b1cbfb8..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInIfConditionRule.php +++ /dev/null @@ -1,48 +0,0 @@ -helper = $helper; - } - - public function getNodeType(): string - { - return If_::class; - } - - /** - * @param If_ $node - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if ($this->helper->passesAsBoolean($scope, $node->cond)) { - return []; - } - - $conditionExpressionType = $scope->getType($node->cond); - - return [ - sprintf( - 'Only booleans are allowed in an if condition, %s given.', - $conditionExpressionType->describe(VerbosityLevel::typeOnly()) - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInTernaryOperatorRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInTernaryOperatorRule.php deleted file mode 100644 index 5d389b7a..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanInTernaryOperatorRule.php +++ /dev/null @@ -1,52 +0,0 @@ -helper = $helper; - } - - public function getNodeType(): string - { - return Ternary::class; - } - - /** - * @param Ternary $node - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if ($node->if === null) { - return []; // elvis ?: - } - - if ($this->helper->passesAsBoolean($scope, $node->cond)) { - return []; - } - - $conditionExpressionType = $scope->getType($node->cond); - - return [ - sprintf( - 'Only booleans are allowed in a ternary operator condition, %s given.', - $conditionExpressionType->describe(VerbosityLevel::typeOnly()) - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanRuleHelper.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanRuleHelper.php deleted file mode 100644 index 1e307d63..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanRuleHelper.php +++ /dev/null @@ -1,45 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function passesAsBoolean(Scope $scope, Expr $expr): bool - { - $type = $scope->getType($expr); - if ($type instanceof MixedType) { - return !$type->isExplicitMixed(); - } - $typeToCheck = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $expr, - '', - static function (Type $type): bool { - return $type->isBoolean()->yes(); - } - ); - $foundType = $typeToCheck->getType(); - if ($foundType instanceof ErrorType) { - return true; - } - - return $foundType->isBoolean()->yes(); - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Cast/UselessCastRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Cast/UselessCastRule.php deleted file mode 100644 index c156a09a..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Cast/UselessCastRule.php +++ /dev/null @@ -1,74 +0,0 @@ -treatPhpDocTypesAsCertain = $treatPhpDocTypesAsCertain; - } - - public function getNodeType(): string - { - return Cast::class; - } - - /** - * @param Cast $node - * @return RuleError[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - $castType = $scope->getType($node); - if ($castType instanceof ErrorType) { - return []; - } - $castType = $castType->generalize(GeneralizePrecision::lessSpecific()); - - if ($this->treatPhpDocTypesAsCertain) { - $expressionType = $scope->getType($node->expr); - } else { - $expressionType = $scope->getNativeType($node->expr); - } - if ($castType->isSuperTypeOf($expressionType)->yes()) { - $addTip = function (RuleErrorBuilder $ruleErrorBuilder) use ($scope, $node, $castType): RuleErrorBuilder { - if (!$this->treatPhpDocTypesAsCertain) { - return $ruleErrorBuilder; - } - - $expressionTypeWithoutPhpDoc = $scope->getNativeType($node->expr); - if ($castType->isSuperTypeOf($expressionTypeWithoutPhpDoc)->yes()) { - return $ruleErrorBuilder; - } - - return $ruleErrorBuilder->tip('Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your %configurationFile%.'); - }; - return [ - $addTip(RuleErrorBuilder::message(sprintf( - 'Casting to %s something that\'s already %s.', - $castType->describe(VerbosityLevel::typeOnly()), - $expressionType->describe(VerbosityLevel::typeOnly()) - )))->build(), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Classes/RequireParentConstructCallRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Classes/RequireParentConstructCallRule.php deleted file mode 100644 index c07e04e4..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Classes/RequireParentConstructCallRule.php +++ /dev/null @@ -1,157 +0,0 @@ -isInClass()) { - throw new ShouldNotHappenException(); - } - - if ($scope->isInTrait()) { - return []; - } - - if ($node->name->name !== '__construct') { - return []; - } - - if ($node->isAbstract()) { - return []; - } - - $classReflection = $scope->getClassReflection()->getNativeReflection(); - if ($classReflection->isInterface() || $classReflection->isAnonymous()) { - return []; - } - - if ($this->callsParentConstruct($node)) { - if ($classReflection->getParentClass() === false) { - return [ - sprintf( - '%s::__construct() calls parent constructor but does not extend any class.', - $classReflection->getName() - ), - ]; - } - - if ($this->getParentConstructorClass($classReflection) === false) { - return [ - sprintf( - '%s::__construct() calls parent constructor but parent does not have one.', - $classReflection->getName() - ), - ]; - } - } else { - $parentClass = $this->getParentConstructorClass($classReflection); - if ($parentClass !== false) { - return [ - sprintf( - '%s::__construct() does not call parent constructor from %s.', - $classReflection->getName(), - $parentClass->getName() - ), - ]; - } - } - - return []; - } - - private function callsParentConstruct(Node $parserNode): bool - { - if (!property_exists($parserNode, 'stmts')) { - return false; - } - - foreach ($parserNode->stmts as $statement) { - if ($statement instanceof Node\Stmt\Expression) { - $statement = $statement->expr; - } - - $statement = $this->ignoreErrorSuppression($statement); - if ($statement instanceof StaticCall) { - if ( - $statement->class instanceof Name - && ((string) $statement->class === 'parent') - && $statement->name instanceof Node\Identifier - && $statement->name->name === '__construct' - ) { - return true; - } - } else { - if ($this->callsParentConstruct($statement)) { - return true; - } - } - } - - return false; - } - - /** - * @param ReflectionClass|ReflectionEnum $classReflection - * @return ReflectionClass|false - */ - private function getParentConstructorClass($classReflection) - { - while ($classReflection->getParentClass() !== false) { - $constructor = $classReflection->getParentClass()->hasMethod('__construct') ? $classReflection->getParentClass()->getMethod('__construct') : null; - $constructorWithClassName = $classReflection->getParentClass()->hasMethod($classReflection->getParentClass()->getName()) ? $classReflection->getParentClass()->getMethod($classReflection->getParentClass()->getName()) : null; - if ( - ( - $constructor !== null - && $constructor->getDeclaringClass()->getName() === $classReflection->getParentClass()->getName() - && !$constructor->isAbstract() - && !$constructor->isPrivate() - ) || ( - $constructorWithClassName !== null - && $constructorWithClassName->getDeclaringClass()->getName() === $classReflection->getParentClass()->getName() - && !$constructorWithClassName->isAbstract() - ) - ) { - return $classReflection->getParentClass(); - } - - $classReflection = $classReflection->getParentClass(); - } - - return false; - } - - private function ignoreErrorSuppression(Node $statement): Node - { - if ($statement instanceof Node\Expr\ErrorSuppress) { - - return $statement->expr; - } - - return $statement; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/DisallowedConstructs/DisallowedBacktickRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/DisallowedConstructs/DisallowedBacktickRule.php deleted file mode 100644 index aab3824d..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/DisallowedConstructs/DisallowedBacktickRule.php +++ /dev/null @@ -1,30 +0,0 @@ -var instanceof ArrayDimFetch) { - return []; - } - - $node = $node->var; - while ($node instanceof ArrayDimFetch) { - $node = $node->var; - } - - if (!$node instanceof Variable) { - return []; - } - - if (!is_string($node->name)) { - return []; - } - - $certainty = $scope->hasVariableType($node->name); - if ($certainty->no()) { - return [ - sprintf('Implicit array creation is not allowed - variable $%s does not exist.', $node->name), - ]; - } - - if ($certainty->maybe()) { - return [ - sprintf('Implicit array creation is not allowed - variable $%s might not exist.', $node->name), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/DisallowedConstructs/DisallowedLooseComparisonRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/DisallowedConstructs/DisallowedLooseComparisonRule.php deleted file mode 100644 index a1425c76..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/DisallowedConstructs/DisallowedLooseComparisonRule.php +++ /dev/null @@ -1,44 +0,0 @@ - - */ -class DisallowedLooseComparisonRule implements Rule -{ - - public function getNodeType(): string - { - return BinaryOp::class; - } - - public function processNode(Node $node, Scope $scope): array - { - if ($node instanceof Equal) { - return [ - RuleErrorBuilder::message( - 'Loose comparison via "==" is not allowed.' - )->tip('Use strict comparison via "===" instead.')->build(), - ]; - } - if ($node instanceof NotEqual) { - return [ - RuleErrorBuilder::message( - 'Loose comparison via "!=" is not allowed.' - )->tip('Use strict comparison via "!==" instead.')->build(), - ]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/DisallowedConstructs/DisallowedShortTernaryRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/DisallowedConstructs/DisallowedShortTernaryRule.php deleted file mode 100644 index 59db24ac..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/DisallowedConstructs/DisallowedShortTernaryRule.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ -class DisallowedShortTernaryRule implements Rule -{ - - public function getNodeType(): string - { - return Ternary::class; - } - - public function processNode(Node $node, Scope $scope): array - { - if ($node->if !== null) { - return []; - } - - return [ - 'Short ternary operator is not allowed. Use null coalesce operator if applicable or consider using long ternary.', - ]; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/ForLoop/OverwriteVariablesWithForLoopInitRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/ForLoop/OverwriteVariablesWithForLoopInitRule.php deleted file mode 100644 index ca8f631c..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/ForLoop/OverwriteVariablesWithForLoopInitRule.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ -class OverwriteVariablesWithForLoopInitRule implements Rule -{ - - public function getNodeType(): string - { - return For_::class; - } - - /** - * @param For_ $node - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - $errors = []; - foreach ($node->init as $expr) { - if (!($expr instanceof Assign)) { - continue; - } - - foreach ($this->checkValueVar($scope, $expr->var) as $error) { - $errors[] = $error; - } - } - - return $errors; - } - - /** - * @return string[] - */ - private function checkValueVar(Scope $scope, Expr $expr): array - { - $errors = []; - if ( - $expr instanceof Node\Expr\Variable - && is_string($expr->name) - && $scope->hasVariableType($expr->name)->yes() - ) { - $errors[] = sprintf('For loop initial assignment overwrites variable $%s.', $expr->name); - } - - if ( - $expr instanceof Node\Expr\List_ - || $expr instanceof Node\Expr\Array_ - ) { - foreach ($expr->items as $item) { - if ($item === null) { - continue; - } - - foreach ($this->checkValueVar($scope, $item->value) as $error) { - $errors[] = $error; - } - } - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/ForeachLoop/OverwriteVariablesWithForeachRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/ForeachLoop/OverwriteVariablesWithForeachRule.php deleted file mode 100644 index dbf16d25..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/ForeachLoop/OverwriteVariablesWithForeachRule.php +++ /dev/null @@ -1,75 +0,0 @@ -keyVar instanceof Node\Expr\Variable - && is_string($node->keyVar->name) - && $scope->hasVariableType($node->keyVar->name)->yes() - ) { - $errors[] = sprintf('Foreach overwrites $%s with its key variable.', $node->keyVar->name); - } - - foreach ($this->checkValueVar($scope, $node->valueVar) as $error) { - $errors[] = $error; - } - - return $errors; - } - - /** - * @return string[] - */ - private function checkValueVar(Scope $scope, Expr $expr): array - { - $errors = []; - if ( - $expr instanceof Node\Expr\Variable - && is_string($expr->name) - && $scope->hasVariableType($expr->name)->yes() - ) { - $errors[] = sprintf('Foreach overwrites $%s with its value variable.', $expr->name); - } - - if ( - $expr instanceof Node\Expr\List_ - || $expr instanceof Node\Expr\Array_ - ) { - foreach ($expr->items as $item) { - if ($item === null) { - continue; - } - - foreach ($this->checkValueVar($scope, $item->value) as $error) { - $errors[] = $error; - } - } - } - - return $errors; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Functions/ClosureUsesThisRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Functions/ClosureUsesThisRule.php deleted file mode 100644 index fbce62f9..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Functions/ClosureUsesThisRule.php +++ /dev/null @@ -1,51 +0,0 @@ - - */ -class ClosureUsesThisRule implements Rule -{ - - public function getNodeType(): string - { - return Node\Expr\Closure::class; - } - - public function processNode(Node $node, Scope $scope): array - { - if ($node->static) { - return []; - } - - if ($scope->isInClosureBind()) { - return []; - } - - $messages = []; - foreach ($node->uses as $closureUse) { - $varType = $scope->getType($closureUse->var); - if (!is_string($closureUse->var->name)) { - continue; - } - if (!$varType instanceof ThisType) { - continue; - } - - $messages[] = RuleErrorBuilder::message(sprintf('Anonymous function uses $this assigned to variable $%s. Use $this directly in the function body.', $closureUse->var->name)) - ->line($closureUse->getLine()) - ->build(); - } - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Methods/WrongCaseOfInheritedMethodRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Methods/WrongCaseOfInheritedMethodRule.php deleted file mode 100644 index be62e245..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Methods/WrongCaseOfInheritedMethodRule.php +++ /dev/null @@ -1,87 +0,0 @@ - - */ -class WrongCaseOfInheritedMethodRule implements Rule -{ - - public function getNodeType(): string - { - return InClassMethodNode::class; - } - - public function processNode( - Node $node, - Scope $scope - ): array - { - $methodReflection = $node->getMethodReflection(); - $declaringClass = $methodReflection->getDeclaringClass(); - - $messages = []; - if ($declaringClass->getParentClass() !== null) { - $parentMessage = $this->findMethod( - $declaringClass, - $declaringClass->getParentClass(), - $methodReflection->getName() - ); - if ($parentMessage !== null) { - $messages[] = $parentMessage; - } - } - - foreach ($declaringClass->getInterfaces() as $interface) { - $interfaceMessage = $this->findMethod( - $declaringClass, - $interface, - $methodReflection->getName() - ); - if ($interfaceMessage === null) { - continue; - } - - /** @var string $interfaceMessage */ - $interfaceMessage = $interfaceMessage; - - $messages[] = $interfaceMessage; - } - - return $messages; - } - - private function findMethod( - ClassReflection $declaringClass, - ClassReflection $classReflection, - string $methodName - ): ?string - { - if (!$classReflection->hasNativeMethod($methodName)) { - return null; - } - - $parentMethod = $classReflection->getNativeMethod($methodName); - if ($parentMethod->getName() === $methodName) { - return null; - } - - return sprintf( - 'Method %s::%s() does not match %s method name: %s::%s().', - $declaringClass->getDisplayName(), - $methodName, - $classReflection->isInterface() ? 'interface' : 'parent', - $classReflection->getDisplayName(), - $parentMethod->getName() - ); - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticIncrementOrDecrementRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticIncrementOrDecrementRule.php deleted file mode 100644 index 13364758..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticIncrementOrDecrementRule.php +++ /dev/null @@ -1,57 +0,0 @@ - - */ -abstract class OperandInArithmeticIncrementOrDecrementRule implements Rule -{ - - /** @var OperatorRuleHelper */ - private $helper; - - public function __construct(OperatorRuleHelper $helper) - { - $this->helper = $helper; - } - - /** - * @param PreInc|PreDec|PostInc|PostDec $node - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - $messages = []; - $varType = $scope->getType($node->var); - - if ( - ($node instanceof PreInc || $node instanceof PostInc) - && !$this->helper->isValidForIncrement($scope, $node->var) - || ($node instanceof PreDec || $node instanceof PostDec) - && !$this->helper->isValidForDecrement($scope, $node->var) - ) { - $messages[] = sprintf( - 'Only numeric types are allowed in %s, %s given.', - $this->describeOperation(), - $varType->describe(VerbosityLevel::typeOnly()) - ); - } - - return $messages; - } - - abstract protected function describeOperation(): string; - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticPostDecrementRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticPostDecrementRule.php deleted file mode 100644 index 88298ec9..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticPostDecrementRule.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class OperandInArithmeticPostDecrementRule extends OperandInArithmeticIncrementOrDecrementRule -{ - - public function getNodeType(): string - { - return PostDec::class; - } - - protected function describeOperation(): string - { - return 'post-decrement'; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticPostIncrementRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticPostIncrementRule.php deleted file mode 100644 index e9367dcb..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticPostIncrementRule.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class OperandInArithmeticPostIncrementRule extends OperandInArithmeticIncrementOrDecrementRule -{ - - public function getNodeType(): string - { - return PostInc::class; - } - - protected function describeOperation(): string - { - return 'post-increment'; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticPreDecrementRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticPreDecrementRule.php deleted file mode 100644 index 643f8d31..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticPreDecrementRule.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class OperandInArithmeticPreDecrementRule extends OperandInArithmeticIncrementOrDecrementRule -{ - - public function getNodeType(): string - { - return PreDec::class; - } - - protected function describeOperation(): string - { - return 'pre-decrement'; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticPreIncrementRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticPreIncrementRule.php deleted file mode 100644 index 3ad29af7..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandInArithmeticPreIncrementRule.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class OperandInArithmeticPreIncrementRule extends OperandInArithmeticIncrementOrDecrementRule -{ - - public function getNodeType(): string - { - return PreInc::class; - } - - protected function describeOperation(): string - { - return 'pre-increment'; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticAdditionRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticAdditionRule.php deleted file mode 100644 index ba29b5a7..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticAdditionRule.php +++ /dev/null @@ -1,73 +0,0 @@ -helper = $helper; - $this->bleedingEdge = $bleedingEdge; - } - - public function getNodeType(): string - { - return Expr::class; - } - - /** - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if ($node instanceof BinaryOpPlus) { - $left = $node->left; - $right = $node->right; - } elseif ($node instanceof AssignOpPlus && $this->bleedingEdge) { - $left = $node->var; - $right = $node->expr; - } else { - return []; - } - - $leftType = $scope->getType($left); - $rightType = $scope->getType($right); - if (count($leftType->getArrays()) > 0 && count($rightType->getArrays()) > 0) { - return []; - } - - $messages = []; - if (!$this->helper->isValidForArithmeticOperation($scope, $left)) { - $messages[] = sprintf( - 'Only numeric types are allowed in +, %s given on the left side.', - $leftType->describe(VerbosityLevel::typeOnly()) - ); - } - if (!$this->helper->isValidForArithmeticOperation($scope, $right)) { - $messages[] = sprintf( - 'Only numeric types are allowed in +, %s given on the right side.', - $rightType->describe(VerbosityLevel::typeOnly()) - ); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticDivisionRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticDivisionRule.php deleted file mode 100644 index 663ff36e..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticDivisionRule.php +++ /dev/null @@ -1,69 +0,0 @@ -helper = $helper; - $this->bleedingEdge = $bleedingEdge; - } - - public function getNodeType(): string - { - return Expr::class; - } - - /** - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if ($node instanceof BinaryOpDiv) { - $left = $node->left; - $right = $node->right; - } elseif ($node instanceof AssignOpDiv && $this->bleedingEdge) { - $left = $node->var; - $right = $node->expr; - } else { - return []; - } - - $messages = []; - $leftType = $scope->getType($left); - if (!$this->helper->isValidForArithmeticOperation($scope, $left)) { - $messages[] = sprintf( - 'Only numeric types are allowed in /, %s given on the left side.', - $leftType->describe(VerbosityLevel::typeOnly()) - ); - } - - $rightType = $scope->getType($right); - if (!$this->helper->isValidForArithmeticOperation($scope, $right)) { - $messages[] = sprintf( - 'Only numeric types are allowed in /, %s given on the right side.', - $rightType->describe(VerbosityLevel::typeOnly()) - ); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticExponentiationRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticExponentiationRule.php deleted file mode 100644 index 40f7ae7e..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticExponentiationRule.php +++ /dev/null @@ -1,69 +0,0 @@ -helper = $helper; - $this->bleedingEdge = $bleedingEdge; - } - - public function getNodeType(): string - { - return Expr::class; - } - - /** - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if ($node instanceof BinaryOpPow) { - $left = $node->left; - $right = $node->right; - } elseif ($node instanceof AssignOpPow && $this->bleedingEdge) { - $left = $node->var; - $right = $node->expr; - } else { - return []; - } - - $messages = []; - $leftType = $scope->getType($left); - if (!$this->helper->isValidForArithmeticOperation($scope, $left)) { - $messages[] = sprintf( - 'Only numeric types are allowed in **, %s given on the left side.', - $leftType->describe(VerbosityLevel::typeOnly()) - ); - } - - $rightType = $scope->getType($right); - if (!$this->helper->isValidForArithmeticOperation($scope, $right)) { - $messages[] = sprintf( - 'Only numeric types are allowed in **, %s given on the right side.', - $rightType->describe(VerbosityLevel::typeOnly()) - ); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticModuloRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticModuloRule.php deleted file mode 100644 index 38e0d38d..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticModuloRule.php +++ /dev/null @@ -1,69 +0,0 @@ -helper = $helper; - $this->bleedingEdge = $bleedingEdge; - } - - public function getNodeType(): string - { - return Expr::class; - } - - /** - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if ($node instanceof BinaryOpMod) { - $left = $node->left; - $right = $node->right; - } elseif ($node instanceof AssignOpMod && $this->bleedingEdge) { - $left = $node->var; - $right = $node->expr; - } else { - return []; - } - - $messages = []; - $leftType = $scope->getType($left); - if (!$this->helper->isValidForArithmeticOperation($scope, $left)) { - $messages[] = sprintf( - 'Only numeric types are allowed in %%, %s given on the left side.', - $leftType->describe(VerbosityLevel::typeOnly()) - ); - } - - $rightType = $scope->getType($right); - if (!$this->helper->isValidForArithmeticOperation($scope, $right)) { - $messages[] = sprintf( - 'Only numeric types are allowed in %%, %s given on the right side.', - $rightType->describe(VerbosityLevel::typeOnly()) - ); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticMultiplicationRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticMultiplicationRule.php deleted file mode 100644 index f1e4c064..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticMultiplicationRule.php +++ /dev/null @@ -1,69 +0,0 @@ -helper = $helper; - $this->bleedingEdge = $bleedingEdge; - } - - public function getNodeType(): string - { - return Expr::class; - } - - /** - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if ($node instanceof BinaryOpMul) { - $left = $node->left; - $right = $node->right; - } elseif ($node instanceof AssignOpMul && $this->bleedingEdge) { - $left = $node->var; - $right = $node->expr; - } else { - return []; - } - - $messages = []; - $leftType = $scope->getType($left); - if (!$this->helper->isValidForArithmeticOperation($scope, $left)) { - $messages[] = sprintf( - 'Only numeric types are allowed in *, %s given on the left side.', - $leftType->describe(VerbosityLevel::typeOnly()) - ); - } - - $rightType = $scope->getType($right); - if (!$this->helper->isValidForArithmeticOperation($scope, $right)) { - $messages[] = sprintf( - 'Only numeric types are allowed in *, %s given on the right side.', - $rightType->describe(VerbosityLevel::typeOnly()) - ); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticSubtractionRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticSubtractionRule.php deleted file mode 100644 index 5333c2a1..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperandsInArithmeticSubtractionRule.php +++ /dev/null @@ -1,69 +0,0 @@ -helper = $helper; - $this->bleedingEdge = $bleedingEdge; - } - - public function getNodeType(): string - { - return Expr::class; - } - - /** - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if ($node instanceof BinaryOpMinus) { - $left = $node->left; - $right = $node->right; - } elseif ($node instanceof AssignOpMinus && $this->bleedingEdge) { - $left = $node->var; - $right = $node->expr; - } else { - return []; - } - - $messages = []; - $leftType = $scope->getType($left); - if (!$this->helper->isValidForArithmeticOperation($scope, $left)) { - $messages[] = sprintf( - 'Only numeric types are allowed in -, %s given on the left side.', - $leftType->describe(VerbosityLevel::typeOnly()) - ); - } - - $rightType = $scope->getType($right); - if (!$this->helper->isValidForArithmeticOperation($scope, $right)) { - $messages[] = sprintf( - 'Only numeric types are allowed in -, %s given on the right side.', - $rightType->describe(VerbosityLevel::typeOnly()) - ); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperatorRuleHelper.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperatorRuleHelper.php deleted file mode 100644 index 28902857..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperatorRuleHelper.php +++ /dev/null @@ -1,95 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function isValidForArithmeticOperation(Scope $scope, Expr $expr): bool - { - $type = $scope->getType($expr); - if ($type instanceof MixedType) { - return true; - } - - // already reported by PHPStan core - if ($type->toNumber() instanceof ErrorType) { - return true; - } - - return $this->isSubtypeOfNumber($scope, $expr); - } - - public function isValidForIncrement(Scope $scope, Expr $expr): bool - { - $type = $scope->getType($expr); - if ($type instanceof MixedType) { - return true; - } - - if ($type->isString()->yes()) { - // Because `$a = 'a'; $a++;` is valid - return true; - } - - return $this->isSubtypeOfNumber($scope, $expr); - } - - public function isValidForDecrement(Scope $scope, Expr $expr): bool - { - $type = $scope->getType($expr); - if ($type instanceof MixedType) { - return true; - } - - return $this->isSubtypeOfNumber($scope, $expr); - } - - private function isSubtypeOfNumber(Scope $scope, Expr $expr): bool - { - $acceptedType = new UnionType([new IntegerType(), new FloatType(), new IntersectionType([new StringType(), new AccessoryNumericStringType()])]); - - $type = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $expr, - '', - static function (Type $type) use ($acceptedType): bool { - return $acceptedType->isSuperTypeOf($type)->yes(); - } - )->getType(); - - if ($type instanceof ErrorType) { - return true; - } - - $isSuperType = $acceptedType->isSuperTypeOf($type); - if ($type instanceof BenevolentUnionType) { - return !$isSuperType->no(); - } - - return $isSuperType->yes(); - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/StrictCalls/DynamicCallOnStaticMethodsCallableRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/StrictCalls/DynamicCallOnStaticMethodsCallableRule.php deleted file mode 100644 index 95e27fec..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/StrictCalls/DynamicCallOnStaticMethodsCallableRule.php +++ /dev/null @@ -1,65 +0,0 @@ - - */ -class DynamicCallOnStaticMethodsCallableRule implements Rule -{ - - /** @var RuleLevelHelper */ - private $ruleLevelHelper; - - public function __construct(RuleLevelHelper $ruleLevelHelper) - { - $this->ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return MethodCallableNode::class; - } - - public function processNode(Node $node, Scope $scope): array - { - if (!$node->getName() instanceof Node\Identifier) { - return []; - } - - $name = $node->getName()->name; - $type = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->getVar(), - '', - static function (Type $type) use ($name): bool { - return $type->canCallMethods()->yes() && $type->hasMethod($name)->yes(); - } - )->getType(); - - if ($type instanceof ErrorType || !$type->canCallMethods()->yes() || !$type->hasMethod($name)->yes()) { - return []; - } - - $methodReflection = $type->getMethod($name, $scope); - if ($methodReflection->isStatic()) { - return [sprintf( - 'Dynamic call to static method %s::%s().', - $methodReflection->getDeclaringClass()->getDisplayName(), - $methodReflection->getName() - )]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/StrictCalls/DynamicCallOnStaticMethodsRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/StrictCalls/DynamicCallOnStaticMethodsRule.php deleted file mode 100644 index c412cb2b..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/StrictCalls/DynamicCallOnStaticMethodsRule.php +++ /dev/null @@ -1,66 +0,0 @@ -ruleLevelHelper = $ruleLevelHelper; - } - - public function getNodeType(): string - { - return MethodCall::class; - } - - /** - * @param MethodCall $node - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node->name instanceof Node\Identifier) { - return []; - } - - $name = $node->name->name; - $type = $this->ruleLevelHelper->findTypeToCheck( - $scope, - $node->var, - '', - static function (Type $type) use ($name): bool { - return $type->canCallMethods()->yes() && $type->hasMethod($name)->yes(); - } - )->getType(); - - if ($type instanceof ErrorType || !$type->canCallMethods()->yes() || !$type->hasMethod($name)->yes()) { - return []; - } - - $methodReflection = $type->getMethod($name, $scope); - if ($methodReflection->isStatic()) { - return [sprintf( - 'Dynamic call to static method %s::%s().', - $methodReflection->getDeclaringClass()->getDisplayName(), - $methodReflection->getName() - )]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/StrictCalls/StrictFunctionCallsRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/StrictCalls/StrictFunctionCallsRule.php deleted file mode 100644 index b27c25fe..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/StrictCalls/StrictFunctionCallsRule.php +++ /dev/null @@ -1,77 +0,0 @@ - 2, - 'array_search' => 2, - 'base64_decode' => 1, - 'array_keys' => 2, - ]; - - /** @var ReflectionProvider */ - private $reflectionProvider; - - public function __construct(ReflectionProvider $reflectionProvider) - { - $this->reflectionProvider = $reflectionProvider; - } - - public function getNodeType(): string - { - return FuncCall::class; - } - - /** - * @param FuncCall $node - * @return string[] errors - */ - public function processNode(Node $node, Scope $scope): array - { - if (!$node->name instanceof Name) { - return []; - } - - $functionName = $this->reflectionProvider->resolveFunctionName($node->name, $scope); - if ($functionName === null) { - return []; - } - $functionName = strtolower($functionName); - if (!array_key_exists($functionName, $this->functionArguments)) { - return []; - } - - if ($functionName === 'array_keys' && !array_key_exists(1, $node->getArgs())) { - return []; - } - - $argumentPosition = $this->functionArguments[$functionName]; - if (!array_key_exists($argumentPosition, $node->getArgs())) { - return [sprintf('Call to function %s() requires parameter #%d to be set.', $functionName, $argumentPosition + 1)]; - } - - $argumentType = $scope->getType($node->getArgs()[$argumentPosition]->value); - $trueType = new ConstantBooleanType(true); - if (!$trueType->isSuperTypeOf($argumentType)->yes()) { - return [sprintf('Call to function %s() requires parameter #%d to be true.', $functionName, $argumentPosition + 1)]; - } - - return []; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/SwitchConditions/MatchingTypeInSwitchCaseConditionRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/SwitchConditions/MatchingTypeInSwitchCaseConditionRule.php deleted file mode 100644 index bb4bebbf..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/SwitchConditions/MatchingTypeInSwitchCaseConditionRule.php +++ /dev/null @@ -1,58 +0,0 @@ - - */ -class MatchingTypeInSwitchCaseConditionRule implements Rule -{ - - /** @var Standard */ - private $printer; - - public function __construct(Standard $printer) - { - $this->printer = $printer; - } - - public function getNodeType(): string - { - return Switch_::class; - } - - public function processNode(Node $node, Scope $scope): array - { - $messages = []; - $conditionType = $scope->getType($node->cond); - foreach ($node->cases as $case) { - if ($case->cond === null) { - continue; - } - - $caseType = $scope->getType($case->cond); - if (!$conditionType->isSuperTypeOf($caseType)->no()) { - continue; - } - - $messages[] = RuleErrorBuilder::message(sprintf( - 'Switch condition type (%s) does not match case condition %s (%s).', - $conditionType->describe(VerbosityLevel::value()), - $this->printer->prettyPrintExpr($case->cond), - $caseType->describe(VerbosityLevel::typeOnly()) - ))->line($case->getLine())->build(); - } - - return $messages; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableMethodCallRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableMethodCallRule.php deleted file mode 100644 index 4221cfa8..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableMethodCallRule.php +++ /dev/null @@ -1,38 +0,0 @@ -name instanceof Node\Identifier) { - return []; - } - - return [ - sprintf( - 'Variable method call on %s.', - $scope->getType($node->var)->describe(VerbosityLevel::typeOnly()) - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableMethodCallableRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableMethodCallableRule.php deleted file mode 100644 index f293b562..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableMethodCallableRule.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -class VariableMethodCallableRule implements Rule -{ - - public function getNodeType(): string - { - return MethodCallableNode::class; - } - - public function processNode(Node $node, Scope $scope): array - { - if ($node->getName() instanceof Node\Identifier) { - return []; - } - - return [ - sprintf( - 'Variable method call on %s.', - $scope->getType($node->getVar())->describe(VerbosityLevel::typeOnly()) - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariablePropertyFetchRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariablePropertyFetchRule.php deleted file mode 100644 index 1b7fe52d..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariablePropertyFetchRule.php +++ /dev/null @@ -1,86 +0,0 @@ -reflectionProvider = $reflectionProvider; - $this->universalObjectCratesClasses = $universalObjectCratesClasses; - } - - public function getNodeType(): string - { - return Node\Expr\PropertyFetch::class; - } - - /** - * @param PropertyFetch $node - * @return string[] - */ - public function processNode(Node $node, Scope $scope): array - { - if ($node->name instanceof Node\Identifier) { - return []; - } - - $fetchedOnType = $scope->getType($node->var); - foreach ($fetchedOnType->getObjectClassNames() as $referencedClass) { - if (!$this->reflectionProvider->hasClass($referencedClass)) { - continue; - } - - if ($this->isUniversalObjectCrate($this->reflectionProvider->getClass($referencedClass))) { - return []; - } - } - - return [ - sprintf( - 'Variable property access on %s.', - $fetchedOnType->describe(VerbosityLevel::typeOnly()) - ), - ]; - } - - private function isUniversalObjectCrate( - ClassReflection $classReflection - ): bool - { - foreach ($this->universalObjectCratesClasses as $className) { - if (!$this->reflectionProvider->hasClass($className)) { - continue; - } - - if ( - $classReflection->getName() === $className - || $classReflection->isSubclassOf($className) - ) { - return true; - } - } - - return false; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableStaticMethodCallRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableStaticMethodCallRule.php deleted file mode 100644 index 0d6b8202..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableStaticMethodCallRule.php +++ /dev/null @@ -1,44 +0,0 @@ -name instanceof Node\Identifier) { - return []; - } - - if ($node->class instanceof Node\Name) { - $methodCalledOn = $scope->resolveName($node->class); - } else { - $methodCalledOn = $scope->getType($node->class)->describe(VerbosityLevel::typeOnly()); - } - - return [ - sprintf( - 'Variable static method call on %s.', - $methodCalledOn - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableStaticMethodCallableRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableStaticMethodCallableRule.php deleted file mode 100644 index 8ede1f00..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableStaticMethodCallableRule.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ -class VariableStaticMethodCallableRule implements Rule -{ - - public function getNodeType(): string - { - return StaticMethodCallableNode::class; - } - - public function processNode(Node $node, Scope $scope): array - { - if ($node->getName() instanceof Node\Identifier) { - return []; - } - - if ($node->getClass() instanceof Node\Name) { - $methodCalledOn = $scope->resolveName($node->getClass()); - } else { - $methodCalledOn = $scope->getType($node->getClass())->describe(VerbosityLevel::typeOnly()); - } - - return [ - sprintf( - 'Variable static method call on %s.', - $methodCalledOn - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableStaticPropertyFetchRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableStaticPropertyFetchRule.php deleted file mode 100644 index 4b410a7f..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableStaticPropertyFetchRule.php +++ /dev/null @@ -1,44 +0,0 @@ -name instanceof Node\Identifier) { - return []; - } - - if ($node->class instanceof Node\Name) { - $propertyAccessedOn = $scope->resolveName($node->class); - } else { - $propertyAccessedOn = $scope->getType($node->class)->describe(VerbosityLevel::typeOnly()); - } - - return [ - sprintf( - 'Variable static property access on %s.', - $propertyAccessedOn - ), - ]; - } - -} diff --git a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableVariablesRule.php b/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableVariablesRule.php deleted file mode 100644 index 9768f21b..00000000 --- a/vendor/phpstan/phpstan-strict-rules/src/Rules/VariableVariables/VariableVariablesRule.php +++ /dev/null @@ -1,34 +0,0 @@ -name)) { - return []; - } - - return [ - 'Variable variables are not allowed.', - ]; - } - -}