diff --git a/composer.json b/composer.json
index 229e0223b..b9d96387c 100644
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"require": {
"php": ">=7.4",
"rector/rector": "1.0.5",
- "friendsofphp/php-cs-fixer": "3.38.2",
+ "friendsofphp/php-cs-fixer": "3.56.1",
"redaxo/php-cs-fixer-config": "^1.0"
},
"config": {
diff --git a/composer.lock b/composer.lock
index c88e43f49..e02ecca07 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "95ff7e8f234a2bf2a45b6eda334f9b72",
+ "content-hash": "b93c814ff9294c8fb33e24f6e387c2e7",
"packages": [
{
"name": "composer/pcre",
@@ -226,50 +226,50 @@
},
{
"name": "friendsofphp/php-cs-fixer",
- "version": "v3.38.2",
+ "version": "v3.56.1",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
- "reference": "d872cdd543797ade030aaa307c0a4954a712e081"
+ "reference": "69c6168ae8bc96dc656c7f6c7271120a68ae5903"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d872cdd543797ade030aaa307c0a4954a712e081",
- "reference": "d872cdd543797ade030aaa307c0a4954a712e081",
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/69c6168ae8bc96dc656c7f6c7271120a68ae5903",
+ "reference": "69c6168ae8bc96dc656c7f6c7271120a68ae5903",
"shasum": ""
},
"require": {
- "composer/semver": "^3.3",
+ "composer/semver": "^3.4",
"composer/xdebug-handler": "^3.0.3",
+ "ext-filter": "*",
"ext-json": "*",
"ext-tokenizer": "*",
"php": "^7.4 || ^8.0",
- "sebastian/diff": "^4.0 || ^5.0",
- "symfony/console": "^5.4 || ^6.0",
- "symfony/event-dispatcher": "^5.4 || ^6.0",
- "symfony/filesystem": "^5.4 || ^6.0",
- "symfony/finder": "^5.4 || ^6.0",
- "symfony/options-resolver": "^5.4 || ^6.0",
- "symfony/polyfill-mbstring": "^1.27",
- "symfony/polyfill-php80": "^1.27",
- "symfony/polyfill-php81": "^1.27",
- "symfony/process": "^5.4 || ^6.0",
- "symfony/stopwatch": "^5.4 || ^6.0"
+ "sebastian/diff": "^4.0 || ^5.0 || ^6.0",
+ "symfony/console": "^5.4 || ^6.0 || ^7.0",
+ "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0",
+ "symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
+ "symfony/finder": "^5.4 || ^6.0 || ^7.0",
+ "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0",
+ "symfony/polyfill-mbstring": "^1.28",
+ "symfony/polyfill-php80": "^1.28",
+ "symfony/polyfill-php81": "^1.28",
+ "symfony/process": "^5.4 || ^6.0 || ^7.0",
+ "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
},
"require-dev": {
"facile-it/paraunit": "^1.3 || ^2.0",
+ "infection/infection": "^0.27.11",
"justinrainbow/json-schema": "^5.2",
- "keradus/cli-executor": "^2.0",
+ "keradus/cli-executor": "^2.1",
"mikey179/vfsstream": "^1.6.11",
- "php-coveralls/php-coveralls": "^2.5.3",
+ "php-coveralls/php-coveralls": "^2.7",
"php-cs-fixer/accessible-object": "^1.1",
- "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2",
- "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1",
- "phpspec/prophecy": "^1.16",
- "phpspec/prophecy-phpunit": "^2.0",
- "phpunit/phpunit": "^9.5",
- "symfony/phpunit-bridge": "^6.2.3",
- "symfony/yaml": "^5.4 || ^6.0"
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4",
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4",
+ "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2",
+ "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
+ "symfony/yaml": "^5.4 || ^6.0 || ^7.0"
},
"suggest": {
"ext-dom": "For handling output formats in XML",
@@ -307,7 +307,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
- "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.38.2"
+ "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.56.1"
},
"funding": [
{
@@ -315,7 +315,7 @@
"type": "github"
}
],
- "time": "2023-11-14T00:19:22+00:00"
+ "time": "2024-05-10T11:31:15+00:00"
},
{
"name": "phpstan/phpstan",
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index c795f005f..139329541 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -79,6 +79,7 @@
'PhpCsFixer\\Console\\Output\\OutputContext' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php',
'PhpCsFixer\\Console\\Output\\Progress\\DotsOutput' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php',
'PhpCsFixer\\Console\\Output\\Progress\\NullOutput' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.php',
+ 'PhpCsFixer\\Console\\Output\\Progress\\PercentageBarOutput' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php',
'PhpCsFixer\\Console\\Output\\Progress\\ProgressOutputFactory' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php',
'PhpCsFixer\\Console\\Output\\Progress\\ProgressOutputInterface' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputInterface.php',
'PhpCsFixer\\Console\\Output\\Progress\\ProgressOutputType' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php',
@@ -118,11 +119,12 @@
'PhpCsFixer\\Doctrine\\Annotation\\Tokens' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php',
'PhpCsFixer\\Documentation\\DocumentationLocator' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php',
'PhpCsFixer\\Documentation\\FixerDocumentGenerator' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php',
- 'PhpCsFixer\\Documentation\\ListDocumentGenerator' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Documentation/ListDocumentGenerator.php',
'PhpCsFixer\\Documentation\\RstUtils' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Documentation/RstUtils.php',
'PhpCsFixer\\Documentation\\RuleSetDocumentationGenerator' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Documentation/RuleSetDocumentationGenerator.php',
'PhpCsFixer\\Error\\Error' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Error/Error.php',
'PhpCsFixer\\Error\\ErrorsManager' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php',
+ 'PhpCsFixer\\ExecutorWithoutErrorHandler' => $vendorDir . '/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php',
+ 'PhpCsFixer\\ExecutorWithoutErrorHandlerException' => $vendorDir . '/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php',
'PhpCsFixer\\FileReader' => $vendorDir . '/friendsofphp/php-cs-fixer/src/FileReader.php',
'PhpCsFixer\\FileRemoval' => $vendorDir . '/friendsofphp/php-cs-fixer/src/FileRemoval.php',
'PhpCsFixer\\Finder' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Finder.php',
@@ -175,6 +177,7 @@
'PhpCsFixer\\Fixer\\ArrayNotation\\WhitespaceAfterCommaInArrayFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php',
'PhpCsFixer\\Fixer\\ArrayNotation\\YieldFromArrayToYieldsFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php',
'PhpCsFixer\\Fixer\\AttributeNotation\\AttributeEmptyParenthesesFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/AttributeEmptyParenthesesFixer.php',
+ 'PhpCsFixer\\Fixer\\AttributeNotation\\OrderedAttributesFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php',
'PhpCsFixer\\Fixer\\Basic\\BracesFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php',
'PhpCsFixer\\Fixer\\Basic\\BracesPositionFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php',
'PhpCsFixer\\Fixer\\Basic\\CurlyBracesPositionFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/CurlyBracesPositionFixer.php',
@@ -182,6 +185,7 @@
'PhpCsFixer\\Fixer\\Basic\\NoMultipleStatementsPerLineFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoMultipleStatementsPerLineFixer.php',
'PhpCsFixer\\Fixer\\Basic\\NoTrailingCommaInSinglelineFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php',
'PhpCsFixer\\Fixer\\Basic\\NonPrintableCharacterFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php',
+ 'PhpCsFixer\\Fixer\\Basic\\NumericLiteralSeparatorFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php',
'PhpCsFixer\\Fixer\\Basic\\OctalNotationFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/OctalNotationFixer.php',
'PhpCsFixer\\Fixer\\Basic\\PsrAutoloadingFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php',
'PhpCsFixer\\Fixer\\Basic\\SingleLineEmptyBodyFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/SingleLineEmptyBodyFixer.php',
@@ -256,6 +260,7 @@
'PhpCsFixer\\Fixer\\DoctrineAnnotation\\DoctrineAnnotationBracesFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationBracesFixer.php',
'PhpCsFixer\\Fixer\\DoctrineAnnotation\\DoctrineAnnotationIndentationFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php',
'PhpCsFixer\\Fixer\\DoctrineAnnotation\\DoctrineAnnotationSpacesFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixer.php',
+ 'PhpCsFixer\\Fixer\\ExperimentalFixerInterface' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ExperimentalFixerInterface.php',
'PhpCsFixer\\Fixer\\FixerInterface' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/FixerInterface.php',
'PhpCsFixer\\Fixer\\FunctionNotation\\CombineNestedDirnameFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php',
'PhpCsFixer\\Fixer\\FunctionNotation\\DateTimeCreateFromFormatCallFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php',
@@ -291,6 +296,7 @@
'PhpCsFixer\\Fixer\\Import\\SingleImportPerStatementFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleImportPerStatementFixer.php',
'PhpCsFixer\\Fixer\\Import\\SingleLineAfterImportsFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleLineAfterImportsFixer.php',
'PhpCsFixer\\Fixer\\Indentation' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Indentation.php',
+ 'PhpCsFixer\\Fixer\\LanguageConstruct\\ClassKeywordFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordFixer.php',
'PhpCsFixer\\Fixer\\LanguageConstruct\\ClassKeywordRemoveFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php',
'PhpCsFixer\\Fixer\\LanguageConstruct\\CombineConsecutiveIssetsFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php',
'PhpCsFixer\\Fixer\\LanguageConstruct\\CombineConsecutiveUnsetsFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveUnsetsFixer.php',
@@ -340,6 +346,7 @@
'PhpCsFixer\\Fixer\\PhpTag\\FullOpeningTagFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/FullOpeningTagFixer.php',
'PhpCsFixer\\Fixer\\PhpTag\\LinebreakAfterOpeningTagFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/LinebreakAfterOpeningTagFixer.php',
'PhpCsFixer\\Fixer\\PhpTag\\NoClosingTagFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/NoClosingTagFixer.php',
+ 'PhpCsFixer\\Fixer\\PhpUnit\\PhpUnitAttributesFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAttributesFixer.php',
'PhpCsFixer\\Fixer\\PhpUnit\\PhpUnitConstructFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitConstructFixer.php',
'PhpCsFixer\\Fixer\\PhpUnit\\PhpUnitDataProviderNameFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderNameFixer.php',
'PhpCsFixer\\Fixer\\PhpUnit\\PhpUnitDataProviderReturnTypeFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderReturnTypeFixer.php',
@@ -370,9 +377,11 @@
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocAddMissingParamAnnotationFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocAlignFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAlignFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocAnnotationWithoutDotFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixer.php',
+ 'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocArrayTypeFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocArrayTypeFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocIndentFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocIndentFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocInlineTagNormalizerFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocLineSpanFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocLineSpanFixer.php',
+ 'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocListTypeFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocListTypeFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocNoAccessFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAccessFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocNoAliasTagFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocNoEmptyReturnFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php',
@@ -408,11 +417,14 @@
'PhpCsFixer\\Fixer\\Strict\\StrictParamFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictParamFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\EscapeImplicitBackslashesFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/EscapeImplicitBackslashesFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\ExplicitStringVariableFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/ExplicitStringVariableFixer.php',
+ 'PhpCsFixer\\Fixer\\StringNotation\\HeredocClosingMarkerFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocClosingMarkerFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\HeredocToNowdocFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocToNowdocFixer.php',
+ 'PhpCsFixer\\Fixer\\StringNotation\\MultilineStringToHeredocFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/MultilineStringToHeredocFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\NoBinaryStringFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoBinaryStringFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\NoTrailingWhitespaceInStringFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoTrailingWhitespaceInStringFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\SimpleToComplexStringVariableFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SimpleToComplexStringVariableFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\SingleQuoteFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SingleQuoteFixer.php',
+ 'PhpCsFixer\\Fixer\\StringNotation\\StringImplicitBackslashesFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringImplicitBackslashesFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\StringLengthToEmptyFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLengthToEmptyFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\StringLineEndingFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLineEndingFixer.php',
'PhpCsFixer\\Fixer\\Whitespace\\ArrayIndentationFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/ArrayIndentationFixer.php',
@@ -453,6 +465,7 @@
'PhpCsFixer\\PregException' => $vendorDir . '/friendsofphp/php-cs-fixer/src/PregException.php',
'PhpCsFixer\\RuleSet\\AbstractMigrationSetDescription' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMigrationSetDescription.php',
'PhpCsFixer\\RuleSet\\AbstractRuleSetDescription' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/AbstractRuleSetDescription.php',
+ 'PhpCsFixer\\RuleSet\\DeprecatedRuleSetDescriptionInterface' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/DeprecatedRuleSetDescriptionInterface.php',
'PhpCsFixer\\RuleSet\\RuleSet' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/RuleSet.php',
'PhpCsFixer\\RuleSet\\RuleSetDescriptionInterface' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetDescriptionInterface.php',
'PhpCsFixer\\RuleSet\\RuleSetInterface' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetInterface.php',
@@ -479,6 +492,8 @@
'PhpCsFixer\\RuleSet\\Sets\\PHP80MigrationSet' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP80MigrationSet.php',
'PhpCsFixer\\RuleSet\\Sets\\PHP81MigrationSet' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP81MigrationSet.php',
'PhpCsFixer\\RuleSet\\Sets\\PHP82MigrationSet' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationSet.php',
+ 'PhpCsFixer\\RuleSet\\Sets\\PHP83MigrationSet' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP83MigrationSet.php',
+ 'PhpCsFixer\\RuleSet\\Sets\\PHP84MigrationSet' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP84MigrationSet.php',
'PhpCsFixer\\RuleSet\\Sets\\PHPUnit100MigrationRiskySet' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit100MigrationRiskySet.php',
'PhpCsFixer\\RuleSet\\Sets\\PHPUnit30MigrationRiskySet' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit30MigrationRiskySet.php',
'PhpCsFixer\\RuleSet\\Sets\\PHPUnit32MigrationRiskySet' => $vendorDir . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit32MigrationRiskySet.php',
@@ -512,6 +527,7 @@
'PhpCsFixer\\Tokenizer\\Analyzer\\AlternativeSyntaxAnalyzer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AlternativeSyntaxAnalyzer.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\AbstractControlCaseStructuresAnalysis' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AbstractControlCaseStructuresAnalysis.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\ArgumentAnalysis' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/ArgumentAnalysis.php',
+ 'PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\AttributeAnalysis' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AttributeAnalysis.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\CaseAnalysis' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/CaseAnalysis.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\DataProviderAnalysis' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DataProviderAnalysis.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\DefaultAnalysis' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DefaultAnalysis.php',
@@ -535,9 +551,11 @@
'PhpCsFixer\\Tokenizer\\Analyzer\\NamespacesAnalyzer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespacesAnalyzer.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\RangeAnalyzer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/RangeAnalyzer.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\ReferenceAnalyzer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ReferenceAnalyzer.php',
+ 'PhpCsFixer\\Tokenizer\\Analyzer\\SwitchAnalyzer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/SwitchAnalyzer.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\WhitespacesAnalyzer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/WhitespacesAnalyzer.php',
'PhpCsFixer\\Tokenizer\\CT' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/CT.php',
'PhpCsFixer\\Tokenizer\\CodeHasher' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/CodeHasher.php',
+ 'PhpCsFixer\\Tokenizer\\Processor\\ImportProcessor' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Processor/ImportProcessor.php',
'PhpCsFixer\\Tokenizer\\Token' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Token.php',
'PhpCsFixer\\Tokenizer\\Tokens' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/Tokens.php',
'PhpCsFixer\\Tokenizer\\TokensAnalyzer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Tokenizer/TokensAnalyzer.php',
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index 150085553..6e35661ae 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -237,6 +237,7 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\Console\\Output\\OutputContext' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php',
'PhpCsFixer\\Console\\Output\\Progress\\DotsOutput' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php',
'PhpCsFixer\\Console\\Output\\Progress\\NullOutput' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.php',
+ 'PhpCsFixer\\Console\\Output\\Progress\\PercentageBarOutput' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php',
'PhpCsFixer\\Console\\Output\\Progress\\ProgressOutputFactory' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php',
'PhpCsFixer\\Console\\Output\\Progress\\ProgressOutputInterface' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputInterface.php',
'PhpCsFixer\\Console\\Output\\Progress\\ProgressOutputType' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php',
@@ -276,11 +277,12 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\Doctrine\\Annotation\\Tokens' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php',
'PhpCsFixer\\Documentation\\DocumentationLocator' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php',
'PhpCsFixer\\Documentation\\FixerDocumentGenerator' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php',
- 'PhpCsFixer\\Documentation\\ListDocumentGenerator' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Documentation/ListDocumentGenerator.php',
'PhpCsFixer\\Documentation\\RstUtils' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Documentation/RstUtils.php',
'PhpCsFixer\\Documentation\\RuleSetDocumentationGenerator' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Documentation/RuleSetDocumentationGenerator.php',
'PhpCsFixer\\Error\\Error' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Error/Error.php',
'PhpCsFixer\\Error\\ErrorsManager' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php',
+ 'PhpCsFixer\\ExecutorWithoutErrorHandler' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php',
+ 'PhpCsFixer\\ExecutorWithoutErrorHandlerException' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php',
'PhpCsFixer\\FileReader' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/FileReader.php',
'PhpCsFixer\\FileRemoval' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/FileRemoval.php',
'PhpCsFixer\\Finder' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Finder.php',
@@ -333,6 +335,7 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\Fixer\\ArrayNotation\\WhitespaceAfterCommaInArrayFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php',
'PhpCsFixer\\Fixer\\ArrayNotation\\YieldFromArrayToYieldsFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php',
'PhpCsFixer\\Fixer\\AttributeNotation\\AttributeEmptyParenthesesFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/AttributeEmptyParenthesesFixer.php',
+ 'PhpCsFixer\\Fixer\\AttributeNotation\\OrderedAttributesFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php',
'PhpCsFixer\\Fixer\\Basic\\BracesFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php',
'PhpCsFixer\\Fixer\\Basic\\BracesPositionFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php',
'PhpCsFixer\\Fixer\\Basic\\CurlyBracesPositionFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/CurlyBracesPositionFixer.php',
@@ -340,6 +343,7 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\Fixer\\Basic\\NoMultipleStatementsPerLineFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoMultipleStatementsPerLineFixer.php',
'PhpCsFixer\\Fixer\\Basic\\NoTrailingCommaInSinglelineFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php',
'PhpCsFixer\\Fixer\\Basic\\NonPrintableCharacterFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php',
+ 'PhpCsFixer\\Fixer\\Basic\\NumericLiteralSeparatorFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php',
'PhpCsFixer\\Fixer\\Basic\\OctalNotationFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/OctalNotationFixer.php',
'PhpCsFixer\\Fixer\\Basic\\PsrAutoloadingFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php',
'PhpCsFixer\\Fixer\\Basic\\SingleLineEmptyBodyFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Basic/SingleLineEmptyBodyFixer.php',
@@ -414,6 +418,7 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\Fixer\\DoctrineAnnotation\\DoctrineAnnotationBracesFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationBracesFixer.php',
'PhpCsFixer\\Fixer\\DoctrineAnnotation\\DoctrineAnnotationIndentationFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php',
'PhpCsFixer\\Fixer\\DoctrineAnnotation\\DoctrineAnnotationSpacesFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixer.php',
+ 'PhpCsFixer\\Fixer\\ExperimentalFixerInterface' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ExperimentalFixerInterface.php',
'PhpCsFixer\\Fixer\\FixerInterface' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/FixerInterface.php',
'PhpCsFixer\\Fixer\\FunctionNotation\\CombineNestedDirnameFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php',
'PhpCsFixer\\Fixer\\FunctionNotation\\DateTimeCreateFromFormatCallFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php',
@@ -449,6 +454,7 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\Fixer\\Import\\SingleImportPerStatementFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleImportPerStatementFixer.php',
'PhpCsFixer\\Fixer\\Import\\SingleLineAfterImportsFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleLineAfterImportsFixer.php',
'PhpCsFixer\\Fixer\\Indentation' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Indentation.php',
+ 'PhpCsFixer\\Fixer\\LanguageConstruct\\ClassKeywordFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordFixer.php',
'PhpCsFixer\\Fixer\\LanguageConstruct\\ClassKeywordRemoveFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php',
'PhpCsFixer\\Fixer\\LanguageConstruct\\CombineConsecutiveIssetsFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php',
'PhpCsFixer\\Fixer\\LanguageConstruct\\CombineConsecutiveUnsetsFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveUnsetsFixer.php',
@@ -498,6 +504,7 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\Fixer\\PhpTag\\FullOpeningTagFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/FullOpeningTagFixer.php',
'PhpCsFixer\\Fixer\\PhpTag\\LinebreakAfterOpeningTagFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/LinebreakAfterOpeningTagFixer.php',
'PhpCsFixer\\Fixer\\PhpTag\\NoClosingTagFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/PhpTag/NoClosingTagFixer.php',
+ 'PhpCsFixer\\Fixer\\PhpUnit\\PhpUnitAttributesFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitAttributesFixer.php',
'PhpCsFixer\\Fixer\\PhpUnit\\PhpUnitConstructFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitConstructFixer.php',
'PhpCsFixer\\Fixer\\PhpUnit\\PhpUnitDataProviderNameFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderNameFixer.php',
'PhpCsFixer\\Fixer\\PhpUnit\\PhpUnitDataProviderReturnTypeFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitDataProviderReturnTypeFixer.php',
@@ -528,9 +535,11 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocAddMissingParamAnnotationFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocAlignFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAlignFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocAnnotationWithoutDotFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixer.php',
+ 'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocArrayTypeFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocArrayTypeFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocIndentFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocIndentFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocInlineTagNormalizerFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocLineSpanFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocLineSpanFixer.php',
+ 'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocListTypeFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocListTypeFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocNoAccessFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAccessFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocNoAliasTagFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php',
'PhpCsFixer\\Fixer\\Phpdoc\\PhpdocNoEmptyReturnFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Phpdoc/PhpdocNoEmptyReturnFixer.php',
@@ -566,11 +575,14 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\Fixer\\Strict\\StrictParamFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Strict/StrictParamFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\EscapeImplicitBackslashesFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/EscapeImplicitBackslashesFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\ExplicitStringVariableFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/ExplicitStringVariableFixer.php',
+ 'PhpCsFixer\\Fixer\\StringNotation\\HeredocClosingMarkerFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocClosingMarkerFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\HeredocToNowdocFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/HeredocToNowdocFixer.php',
+ 'PhpCsFixer\\Fixer\\StringNotation\\MultilineStringToHeredocFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/MultilineStringToHeredocFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\NoBinaryStringFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoBinaryStringFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\NoTrailingWhitespaceInStringFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/NoTrailingWhitespaceInStringFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\SimpleToComplexStringVariableFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SimpleToComplexStringVariableFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\SingleQuoteFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/SingleQuoteFixer.php',
+ 'PhpCsFixer\\Fixer\\StringNotation\\StringImplicitBackslashesFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringImplicitBackslashesFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\StringLengthToEmptyFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLengthToEmptyFixer.php',
'PhpCsFixer\\Fixer\\StringNotation\\StringLineEndingFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/StringNotation/StringLineEndingFixer.php',
'PhpCsFixer\\Fixer\\Whitespace\\ArrayIndentationFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Whitespace/ArrayIndentationFixer.php',
@@ -611,6 +623,7 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\PregException' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/PregException.php',
'PhpCsFixer\\RuleSet\\AbstractMigrationSetDescription' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMigrationSetDescription.php',
'PhpCsFixer\\RuleSet\\AbstractRuleSetDescription' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/AbstractRuleSetDescription.php',
+ 'PhpCsFixer\\RuleSet\\DeprecatedRuleSetDescriptionInterface' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/DeprecatedRuleSetDescriptionInterface.php',
'PhpCsFixer\\RuleSet\\RuleSet' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/RuleSet.php',
'PhpCsFixer\\RuleSet\\RuleSetDescriptionInterface' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetDescriptionInterface.php',
'PhpCsFixer\\RuleSet\\RuleSetInterface' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/RuleSetInterface.php',
@@ -637,6 +650,8 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\RuleSet\\Sets\\PHP80MigrationSet' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP80MigrationSet.php',
'PhpCsFixer\\RuleSet\\Sets\\PHP81MigrationSet' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP81MigrationSet.php',
'PhpCsFixer\\RuleSet\\Sets\\PHP82MigrationSet' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP82MigrationSet.php',
+ 'PhpCsFixer\\RuleSet\\Sets\\PHP83MigrationSet' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP83MigrationSet.php',
+ 'PhpCsFixer\\RuleSet\\Sets\\PHP84MigrationSet' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHP84MigrationSet.php',
'PhpCsFixer\\RuleSet\\Sets\\PHPUnit100MigrationRiskySet' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit100MigrationRiskySet.php',
'PhpCsFixer\\RuleSet\\Sets\\PHPUnit30MigrationRiskySet' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit30MigrationRiskySet.php',
'PhpCsFixer\\RuleSet\\Sets\\PHPUnit32MigrationRiskySet' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/RuleSet/Sets/PHPUnit32MigrationRiskySet.php',
@@ -670,6 +685,7 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\Tokenizer\\Analyzer\\AlternativeSyntaxAnalyzer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/AlternativeSyntaxAnalyzer.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\AbstractControlCaseStructuresAnalysis' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AbstractControlCaseStructuresAnalysis.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\ArgumentAnalysis' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/ArgumentAnalysis.php',
+ 'PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\AttributeAnalysis' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/AttributeAnalysis.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\CaseAnalysis' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/CaseAnalysis.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\DataProviderAnalysis' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DataProviderAnalysis.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\Analysis\\DefaultAnalysis' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/Analysis/DefaultAnalysis.php',
@@ -693,9 +709,11 @@ class ComposerStaticInit432d9322d3d4193d52e9a1d1ec2ff418
'PhpCsFixer\\Tokenizer\\Analyzer\\NamespacesAnalyzer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/NamespacesAnalyzer.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\RangeAnalyzer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/RangeAnalyzer.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\ReferenceAnalyzer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/ReferenceAnalyzer.php',
+ 'PhpCsFixer\\Tokenizer\\Analyzer\\SwitchAnalyzer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/SwitchAnalyzer.php',
'PhpCsFixer\\Tokenizer\\Analyzer\\WhitespacesAnalyzer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Analyzer/WhitespacesAnalyzer.php',
'PhpCsFixer\\Tokenizer\\CT' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/CT.php',
'PhpCsFixer\\Tokenizer\\CodeHasher' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/CodeHasher.php',
+ 'PhpCsFixer\\Tokenizer\\Processor\\ImportProcessor' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Processor/ImportProcessor.php',
'PhpCsFixer\\Tokenizer\\Token' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Token.php',
'PhpCsFixer\\Tokenizer\\Tokens' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/Tokens.php',
'PhpCsFixer\\Tokenizer\\TokensAnalyzer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Tokenizer/TokensAnalyzer.php',
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 0d8857162..4e0fc2be1 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -229,57 +229,57 @@
},
{
"name": "friendsofphp/php-cs-fixer",
- "version": "v3.38.2",
- "version_normalized": "3.38.2.0",
+ "version": "v3.56.1",
+ "version_normalized": "3.56.1.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
- "reference": "d872cdd543797ade030aaa307c0a4954a712e081"
+ "reference": "69c6168ae8bc96dc656c7f6c7271120a68ae5903"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d872cdd543797ade030aaa307c0a4954a712e081",
- "reference": "d872cdd543797ade030aaa307c0a4954a712e081",
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/69c6168ae8bc96dc656c7f6c7271120a68ae5903",
+ "reference": "69c6168ae8bc96dc656c7f6c7271120a68ae5903",
"shasum": ""
},
"require": {
- "composer/semver": "^3.3",
+ "composer/semver": "^3.4",
"composer/xdebug-handler": "^3.0.3",
+ "ext-filter": "*",
"ext-json": "*",
"ext-tokenizer": "*",
"php": "^7.4 || ^8.0",
- "sebastian/diff": "^4.0 || ^5.0",
- "symfony/console": "^5.4 || ^6.0",
- "symfony/event-dispatcher": "^5.4 || ^6.0",
- "symfony/filesystem": "^5.4 || ^6.0",
- "symfony/finder": "^5.4 || ^6.0",
- "symfony/options-resolver": "^5.4 || ^6.0",
- "symfony/polyfill-mbstring": "^1.27",
- "symfony/polyfill-php80": "^1.27",
- "symfony/polyfill-php81": "^1.27",
- "symfony/process": "^5.4 || ^6.0",
- "symfony/stopwatch": "^5.4 || ^6.0"
+ "sebastian/diff": "^4.0 || ^5.0 || ^6.0",
+ "symfony/console": "^5.4 || ^6.0 || ^7.0",
+ "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0",
+ "symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
+ "symfony/finder": "^5.4 || ^6.0 || ^7.0",
+ "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0",
+ "symfony/polyfill-mbstring": "^1.28",
+ "symfony/polyfill-php80": "^1.28",
+ "symfony/polyfill-php81": "^1.28",
+ "symfony/process": "^5.4 || ^6.0 || ^7.0",
+ "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
},
"require-dev": {
"facile-it/paraunit": "^1.3 || ^2.0",
+ "infection/infection": "^0.27.11",
"justinrainbow/json-schema": "^5.2",
- "keradus/cli-executor": "^2.0",
+ "keradus/cli-executor": "^2.1",
"mikey179/vfsstream": "^1.6.11",
- "php-coveralls/php-coveralls": "^2.5.3",
+ "php-coveralls/php-coveralls": "^2.7",
"php-cs-fixer/accessible-object": "^1.1",
- "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2",
- "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1",
- "phpspec/prophecy": "^1.16",
- "phpspec/prophecy-phpunit": "^2.0",
- "phpunit/phpunit": "^9.5",
- "symfony/phpunit-bridge": "^6.2.3",
- "symfony/yaml": "^5.4 || ^6.0"
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4",
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4",
+ "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2",
+ "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
+ "symfony/yaml": "^5.4 || ^6.0 || ^7.0"
},
"suggest": {
"ext-dom": "For handling output formats in XML",
"ext-mbstring": "For handling non-UTF8 characters."
},
- "time": "2023-11-14T00:19:22+00:00",
+ "time": "2024-05-10T11:31:15+00:00",
"bin": [
"php-cs-fixer"
],
@@ -313,7 +313,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
- "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.38.2"
+ "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.56.1"
},
"funding": [
{
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index 6b1891888..8673d0861 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
- 'reference' => '6e4343516f2667323b3b38369ea21e52d3a47f8e',
+ 'reference' => '251d9aaa81bc6cbf0d1b00e1a0becc40f608e8d0',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
- 'reference' => '6e4343516f2667323b3b38369ea21e52d3a47f8e',
+ 'reference' => '251d9aaa81bc6cbf0d1b00e1a0becc40f608e8d0',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -47,9 +47,9 @@
'dev_requirement' => false,
),
'friendsofphp/php-cs-fixer' => array(
- 'pretty_version' => 'v3.38.2',
- 'version' => '3.38.2.0',
- 'reference' => 'd872cdd543797ade030aaa307c0a4954a712e081',
+ 'pretty_version' => 'v3.56.1',
+ 'version' => '3.56.1.0',
+ 'reference' => '69c6168ae8bc96dc656c7f6c7271120a68ae5903',
'type' => 'application',
'install_path' => __DIR__ . '/../friendsofphp/php-cs-fixer',
'aliases' => array(),
diff --git a/vendor/friendsofphp/php-cs-fixer/CHANGELOG.md b/vendor/friendsofphp/php-cs-fixer/CHANGELOG.md
index 1ddea4295..1c790833c 100644
--- a/vendor/friendsofphp/php-cs-fixer/CHANGELOG.md
+++ b/vendor/friendsofphp/php-cs-fixer/CHANGELOG.md
@@ -3,6 +3,437 @@ CHANGELOG for PHP CS Fixer
This file contains changelogs for stable releases only.
+Changelog for v3.56.1
+---------------------
+
+* chore: improve PHPDoc typehints (#7994)
+* CI: Allow any integer in PHPStan error for Token's constructor (#8000)
+* fix: Better array shape in `PhpUnitDedicateAssertFixer` (#7999)
+* fix: `ConstantCaseFixer` - do not touch typed constants (#7998)
+
+Changelog for v3.56.0
+---------------------
+
+* feat: `TrailingCommaInMultilineFixer` - handle trailing comma in language constructs (#7989)
+* fix: `TrailingCommaInMultilineFixer` - language constructs should be covered by arguments, not parameters (#7990)
+* chore: remove invalid comment (#7987)
+* DX: Cache optimisation (#7985)
+
+Changelog for v3.55.0
+---------------------
+
+* feat: Introduce `OrderedAttributesFixer` (#7395)
+* chore: few SCA fixes and dev-tools update (#7969)
+* chore: fix phpdoc types (#7977)
+* chore: narrow PHPDoc types (#7979)
+* chore: Normalize implicit backslahes in single quoted strings internally (#7786)
+* chore: phpdoc - rely on strict list/tuple/assoc instead of array (#7978)
+* chore: PhpUnitDataProviderNameFixer - follow config creation pattern (#7980)
+* chore: Preg - drop half-support for array-pattern (#7976)
+* chore: re-use CodeHasher (#7984)
+* chore: RuleSetsTest - assert that Fixer is configurable (#7961)
+* chore: sugar syntax (#7986)
+* chore: Tokens should be always a list (#7698)
+* CI: Ad-hoc fix for MacOS jobs (#7970)
+* CI: Fix calculating diff between branches in PRs (#7973)
+* DX: allow to enforce cache mechanism by env var (#7983)
+* DX: do not typehint fixed-length arrays as lists (#7974)
+* DX: Prevent having deprecated fixers listed as successors of other deprecated fixers (#7967)
+* DX: Resolve/Ignore PHPStan issues on level 6 + bump to level 7 with new baseline (#7971)
+* DX: use `list` type in PHPDoc (#7975)
+* fix: `PhpUnitAttributesFixer` - fix for `#[RequiresPhp]` exceeding its constructor parameters (#7966)
+* test: don't count comment after class as another classy element (#7982)
+
+Changelog for v3.54.0
+---------------------
+
+* feat: introduce `PhpUnitAttributesFixer` (#7831)
+* chore: Properly determine self-approval trigger commit (#7936)
+* chore: Revert ref for self-approval Git checkout (#7944)
+* CI: check if proper array key is declared (#7912)
+* DX: cleanup `FullyQualifiedStrictTypesFixerTest` (#7954)
+* DX: cleanup `PhpdocNoAccessFixerTest` (#7933)
+* DX: cleanup `PhpUnitMethodCasingFixerTest` (#7948)
+* DX: cleanup `PhpUnitStrictFixerTest` (#7938)
+* DX: Improve internal dist config for Fixer (#7952)
+* DX: Improve issue templates (#7942)
+* DX: there is no namespace if there is no PHP code (#7953)
+* DX: update .gitattributes (#7931)
+* fix: Remove Infection during Docker release (#7937)
+* fix: `FullyQualifiedStrictTypesFixer` - do not add imports before PHP opening tag (#7955)
+* fix: `PhpUnitMethodCasingFixer` - do not double underscore (#7949)
+* fix: `PhpUnitTestClassRequiresCoversFixer` - do not add annotation when there are attributes (#7880)
+* test: Ignore PHP version related mutations (#7935)
+
+Changelog for v3.53.0
+---------------------
+
+* chore: Use `list` over `array` in more places (#7905)
+* CI: allow for self-approvals for maintainers (#7921)
+* CI: Improve Infection setup (#7913)
+* CI: no need to trigger enable auto-merge when self-approve (#7929)
+* DX: reduce `array_filter` function usages (#7923)
+* DX: remove duplicated character from `trim` call (#7930)
+* DX: update actions producing warnings (#7925)
+* DX: update actions producing warnings (#7928)
+* DX: update `phpstan/phpstan-strict-rules` (#7924)
+* feat: Add trailing comma in multiline to PER-CS 2.0 (#7916)
+* feat: Introduce `AttributeAnalysis` (#7909)
+* feat: `@PHP84Migration` introduction (#7774)
+* fix: Constant invocation detected in typed constants (#7892)
+* fix: `PhpdocArrayTypeFixer` - JIT stack limit exhausted (#7895)
+* test: Introduce Infection for mutation tests (#7874)
+
+Changelog for v3.52.1
+---------------------
+
+* fix: StatementIndentationFixer - do not crash on ternary operator in class property (#7899)
+* fix: `PhpCsFixer\Tokenizer\Tokens::setSize` return type (#7900)
+
+Changelog for v3.52.0
+---------------------
+
+* chore: fix PHP 8.4 deprecations (#7894)
+* chore: fix PHPStan 1.10.60 issues (#7873)
+* chore: list over array in more places (#7876)
+* chore: replace template with variable in Preg class (#7882)
+* chore: update PHPStan (#7871)
+* depr: `nullable_type_declaration_for_default_null_value` - deprecate option that is against `@PHP84Migration` (#7872)
+* docs: Fix typo (#7889)
+* feat: Add support for callable template in PHPDoc parser (#7084)
+* feat: Add `array_indentation` to `PER-CS2.0` ruleset (#7881)
+* feat: `@Symfony:risky` - add `no_unreachable_default_argument_value` (#7863)
+* feat: `PhpCsFixer` ruleset - enable `nullable_type_declaration_for_default_null_value` (#7870)
+* fix: Constant invocation detected in DNF types (#7869)
+* fix: Correctly indent multiline constants and properties (#7875)
+* fix: `no_useless_concat_operator` - do not break variable (#7827)
+* fix: `TokensAnalyzer` - handle unary operator in arrow functions (#7862)
+* fix: `TypeExpression` - fix "JIT stack limit exhausted" error (#7843)
+
+Changelog for v3.51.0
+---------------------
+
+* chore: add missing tests for non-documentation classes (#7848)
+* chore: do not perform type analysis in tests (#7852)
+* chore: list over array in more places (#7857)
+* chore: tests documentation classes (#7855)
+* feat: `@Symfony` - add nullable_type_declaration (#7856)
+* test: fix wrong type in param annotation (#7858)
+
+Changelog for v3.50.0
+---------------------
+
+* chore: add missing types (#7842)
+* chore: BlocksAnalyzer - raise exception on invalid index (#7819)
+* chore: DataProviderAnalysis - expect list over array (#7800)
+* chore: do not use `@large` on method level (#7832)
+* chore: do not use `@medium` on method level (#7833)
+* chore: Fix typos (#7835)
+* chore: rename variables (#7847)
+* chore: some improvements around array typehints (#7799)
+* CI: fix PHP 8.4 job (#7829)
+* DX: Include `symfony/var-dumper` in dev tools (#7795)
+* feat: Ability to remove unused imports from multi-use statements (#7815)
+* feat: allow PHPUnit 11 (#7824)
+* feat: Allow shortening symbols from multi-use statements (only classes for now) (#7816)
+* feat: introduce `PhpdocArrayTypeFixer` (#7812)
+* feat: PhpUnitTestCaseStaticMethodCallsFixer - cover PHPUnit v11 methods (#7822)
+* feat: Support for multi-use statements in `NamespaceUsesAnalyzer` (#7814)
+* feat: `MbStrFunctionsFixer` - add support for `mb_trim`, `mb_ltrim` and `mb_rtrim` functions (#7840)
+* feat: `NoEmptyPhpdocFixer` - do not leave empty line after removing PHPDoc (#7820)
+* feat: `no_superfluous_phpdoc_tags` - introduce `allow_future_params` option (#7743)
+* fix: do not use wrongly named arguments in data providers (#7823)
+* fix: Ensure PCNTL extension is always installed in Docker (#7782)
+* fix: PhpdocListTypeFixer - support key types containing `<…>` (#7817)
+* fix: Proper build target for local Docker Compose (#7834)
+* fix: union PHPDoc support in `fully_qualified_strict_types` fixer (#7719)
+* fix: `ExecutorWithoutErrorHandler` - remove invalid PHP 7.4 type (#7845)
+* fix: `fully_qualified_strict_types` must honor template/local type identifiers (#7724)
+* fix: `MethodArgumentSpaceFixer` - do not break heredoc/nowdoc (#7828)
+* fix: `NumericLiteralSeparatorFixer` - do not change `float` to `int` when there is nothing after the dot (#7805)
+* fix: `PhpUnitStrictFixer` - do not crash on property having the name of method to fix (#7804)
+* fix: `SingleSpaceAroundConstructFixer` - correctly recognise multiple constants (#7700)
+* fix: `TypeExpression` - handle array shape key with dash (#7841)
+
+Changelog for v3.49.0
+---------------------
+
+* chore(checkbashisms): update to 2.23.7 (#7780)
+* chore: add missing key types in PHPDoc types (#7779)
+* chore: Exclude `topic/core` issues/PRs from Stale Bot (#7788)
+* chore: `DescribeCommand` - better handling of deprecations (#7778)
+* docs: docker - use gitlab reporter in GitLab integration example (#7764)
+* docs: docker in CI - don't suggest command that overrides path from config file (#7763)
+* DX: check deprecations exactly (#7742)
+* feat: Add `ordered_types` to `@Symfony` (#7356)
+* feat: introduce `PhpdocListTypeFixer` (#7796)
+* feat: introduce `string_implicit_backslashes` as `escape_implicit_backslashes` replacement (#7669)
+* feat: update `Symfony.nullable_type_declaration_for_default_null_value` config (#7773)
+* feat: `@PhpCsFixer` ruleset - enable `php_unit_data_provider_static` (#7685)
+* fix: Allow using cache when running in Docker distribution (#7769)
+* fix: ClassDefinitionFixer for anonymous class with phpdoc/attribute on separate line (#7546)
+* fix: `ClassKeywordFixer` must run before `FullyQualifiedStrictTypesFixer` (#7767)
+* fix: `function_to_constant` `get_class()` replacement (#7770)
+* fix: `LowercaseStaticReferenceFixer` - do not change typed constants (#7775)
+* fix: `PhpdocTypesFixer` - handle more complex types (#7791)
+* fix: `TypeExpression` - do not break type using `walkTypes` method (#7785)
+
+Changelog for v3.48.0
+---------------------
+
+* chore: `FullyQualifiedStrictTypesFixer` must run before `OrderedInterfacesFixer` (#7762)
+* docs: Add PHP-CS-Fixer integration in a GitHub Action step (#7757)
+* feat: `PhpdocTypesOrderFixer` Support DNF types (#7732)
+* fix: Support shebang in fixers operating on PHP opening tag (#7687)
+* fix: work correctly for a switch/case with ternary operator (#7756)
+* fix: `NoUselessConcatOperatorFixer` - do not remove new line (#7759)
+
+Changelog for v3.47.1
+---------------------
+
+* fix: Do not override short name with relative reference (#7752)
+* fix: make `BinaryOperatorSpacesFixer` work as pre-v3.47 (#7751)
+* fix: Proper Docker image name suffix (#7739)
+* fix: `FullyQualifiedStrictTypesFixer` - do not change case of the symbol when there's name collision between imported class and imported function (#7750)
+* fix: `FullyQualifiedStrictTypesFixer` - do not modify statements with property fetch and `::` (#7749)
+
+Changelog for v3.47.0
+---------------------
+
+* chore: better identify EXPERIMENTAL rules (#7729)
+* chore: fix issue detected by unlocked PHPStan + upgrade dev-tools (#7678)
+* chore: handle extract() (#7684)
+* chore: Mention contributors in app info (#7668)
+* chore: no need to mark private methods as internal (#7715)
+* chore: ProjectCodeTests - dry for function usage extractions (#7690)
+* chore: reduce PHPStan baseline (#7644)
+* chore: use numeric literal separator for PHP version IDs (#7712)
+* chore: use numeric_literal_separator for project (#7713)
+* chore: Utils::sortElements - better typing (#7646)
+* CI: Allow running Stale Bot on demand (#7711)
+* CI: Fix PHP 8.4 (#7702)
+* CI: Give write permissions to Stale Bot (#7716)
+* CI: Use `actions/stale` v9 (#7710)
+* docs: Add information about allowing maintainers to update PRs (#7683)
+* docs: CONTRIBUTING.md - update Opening a PR (#7691)
+* docs: Display/include tool info/version by default in commands and reports (#7733)
+* DX: fix deprecation tests warnings for PHP 7.4 (#7725)
+* DX: update `host.docker.internal` in Compose override template (#7661)
+* DX: `NumericLiteralSeparatorFixer` - change default strategy to `use_separator` (#7730)
+* feat: Add support for official Docker images of Fixer (#7555)
+* feat: Add `spacing` option to `PhpdocAlignFixer` (#6505)
+* feat: Add `union_types` option to `phpdoc_to_param_type`, `phpdoc_to_property_type`, and `phpdoc_to_return_type` fixers (#7672)
+* feat: Introduce `heredoc_closing_marker` fixer (#7660)
+* feat: Introduce `multiline_string_to_heredoc` fixer (#7665)
+* feat: Introduce `NumericLiteralSeparatorFixer` (#6761)
+* feat: no_superfluous_phpdoc_tags - support for arrow function (#7666)
+* feat: Simplify closing marker when possible in `heredoc_closing_marker` fixer (#7676)
+* feat: Support typed properties and attributes in `fully_qualified_strict_types` (#7659)
+* feat: `@PhpCsFixer` ruleset - enable no_whitespace_before_comma_in_array.after_heredoc (#7670)
+* fix: Improve progress bar visual layer (#7708)
+* fix: indentation of control structure body without braces (#7663)
+* fix: make sure all PHP extensions required by PHPUnit are installed (#7727)
+* fix: PhpdocToReturnTypeFixerTest - support for arrow functions (#7645)
+* fix: Several improvements for `fully_qualified_strict_types` (respect declared symbols, relative imports, leading backslash in global namespace) (#7679)
+* fix: SimplifiedNullReturnFixer - support array return typehint (#7728)
+* fix: Support numeric values without leading zero in `numeric_literal_separator` (#7735)
+* fix: `BinaryOperatorSpacesFixer` - align correctly when multiple shifts occurs in single line (#7593)
+* fix: `ClassReferenceNameCasingFixer` capitalizes the property name after the nullsafe operator (#7696)
+* fix: `fully_qualified_strict_types` with `leading_backslash_in_global_namespace` enabled - handle reserved types in phpDoc (#7648)
+* fix: `NoSpaceAroundDoubleColonFixer` must run before `MethodChainingIndentationFixer` (#7723)
+* fix: `no_superfluous_phpdoc_tags` must honor multiline docs (#7697)
+* fix: `numeric_literal_separator` - Handle zero-leading floats properly (#7737)
+* refactor: increase performance by ~7% thanks to `Tokens::block*Cache` hit increased by ~12% (#6176)
+* refactor: Tokens - fast check for non-block in 'detectBlockType', evaluate definitions only once in 'getBlockEdgeDefinitions' (#7655)
+* refactor: `Tokens::clearEmptyTokens` - play defensive with cache clearing (#7658)
+* test: ensure we do not forget to test any short_open_tag test (#7638)
+
+Changelog for v3.46.0
+---------------------
+
+* chore: fix internal typehints in Tokens (#7656)
+* chore: reduce PHPStan baseline (#7643)
+* docs: Show class with unit tests and BC promise info (#7667)
+* feat: change default ruleset to `@PER-CS` (only behind PHP_CS_FIXER_FUTURE_MODE=1) (#7650)
+* feat: Support new/instanceof/use trait in `fully_qualified_strict_types` (#7653)
+* fix: FQCN parse phpdoc using full grammar regex (#7649)
+* fix: Handle FQCN properly with `leading_backslash_in_global_namespace` option enabled (#7654)
+* fix: PhpdocToParamTypeFixerTest - support for arrow functions (#7647)
+* fix: PHP_CS_FIXER_FUTURE_MODE - proper boolean validation (#7651)
+
+Changelog for v3.45.0
+---------------------
+
+* feat: Enable symbol importing in `@PhpCsFixer` ruleset (#7629)
+* fix: NoUnneededBracesFixer - improve handling of global namespace (#7639)
+* test: run tests with "short_open_tag" enabled (#7637)
+
+Changelog for v3.44.0
+---------------------
+
+* feat: Introduce percentage bar as new default progress output (#7603)
+
+Changelog for v3.43.1
+---------------------
+
+* fix: Import only unique symbols' short names (#7635)
+
+Changelog for v3.43.0
+---------------------
+
+* chore: change base of `@Symfony` set to `@PER-CS2.0` (#7627)
+* chore: PHPUnit - allow for v10 (#7606)
+* chore: Preg - rework catching the error (#7616)
+* chore: Revert unneeded peer-dep-pin and re-gen lock file (#7618)
+* docs: drop extra note about 8.0.0 bug in README.md (#7614)
+* feat: add cast_spaces into `@PER-CS2.0` (#7625)
+* feat: Configurable phpDoc tags for FQCN processing (#7628)
+* feat: StatementIndentationFixer - introduce stick_comment_to_next_continuous_control_statement config (#7624)
+* feat: UnaryOperatorSpacesFixer - introduce only_dec_inc config (#7626)
+* fix: FullyQualifiedStrictTypesFixer - better support annotations in inline {} (#7633)
+* fix: Improve how FQCN is handled in phpDoc (#7622)
+* fix: phpdoc_align - fix multiline tag alignment issue (#7630)
+
+Changelog for v3.42.0
+---------------------
+
+* chore: aim to not rely on internal array pointer but use array_key_first (#7613)
+* chore: deprecate Token::isKeyCaseSensitive (#7599)
+* chore: deprecate Token::isKeyCaseSensitive, 2nd part (#7601)
+* chore: do not check PHP_VERSION_ID (#7602)
+* chore: FileFilterIteratorTest - more accurate type in docs (#7542)
+* chore: minor code cleanup (#7607)
+* chore: more types (#7598)
+* chore: PHPDoc key-value spacing (#7592)
+* chore: PHPUnit - run defects first (#7570)
+* chore: ProjectCodeTest - DRY on Tokens creation (#7574)
+* chore: ProjectCodeTest - prepare for symfony/console v7 (#7605)
+* chore: ProjectCodeTest::provide*ClassCases to return iterable with key for better tests execution log (#7572)
+* chore: ProjectCodeTest::testDataProvidersDeclaredReturnType - use better DataProvider to simplify test logic (#7573)
+* chore: TokensAnalyzer - string-enum for better typehinting (#7571)
+* chore: unify tests not agnostic of PHP version (#7581)
+* chore: use ::class more (#7545)
+* CI: Introduce `composer-unused` (#7536)
+* DX: add types to anonymous functions (#7561)
+* DX: Allow running smoke tests within Docker runtime (#7608)
+* DX: check fixer's options for wording (#7543)
+* DX: cleanup deprecation message (#7576)
+* DX: do not allow overriding constructor of `PHPUnit\Framework\TestCase` (#7563)
+* DX: do not import ExpectDeprecationTrait in UtilsTest (#7562)
+* DX: Enforce consistent naming in tests (#7556)
+* DX: fix checking test class extends `PhpCsFixer\Tests\TestCase` (#7567)
+* DX: make sure that exceptions in `AbstractFixerTestCase::testProperMethodNaming` are not already fixed (#7588)
+* DX: remove recursion from AbstractIntegrationTestCase::testIntegration (#7577)
+* DX: remove `PhpUnitNamespacedFixerTest::testClassIsFixed` (#7564)
+* DX: remove `symfony/phpunit-bridge` (#7578)
+* DX: replace fixture classes with anonymous ones (#7533)
+* DX: Unify Docker mount points and paths (#7549)
+* DX: unify fixer's test method names - quick wins (#7584)
+* DX: unify tests for casing fixers (#7558)
+* DX: use anonymous function over concrete classes (#7553)
+* feat(EXPERIMENTAL): ClassKeywordFixer (#2918)
+* feat(EXPERIMENTAL): ClassKeywordFixer, part 2 (#7550)
+* feat(PhpdocToCommentFixer): Add option to handle return as valid docblock usage (#7401) (#7402)
+* feat: Ability to import FQCNs found during analysis (#7597)
+* feat: add phpDoc support for `fully_qualified_strict_types` fixer (#5620)
+* feat: Handle deprecated rule sets similarly to deprecated fixers (#7288)
+* feat: PhpUnitTestCaseStaticMethodCallsFixer - cover PHPUnit v10 methods (#7604)
+* feat: Support more FQCNs cases in `fully_qualified_strict_types` (#7459)
+* fix: AbstractFixerTestCase - fix checking for correct casing (#7540)
+* fix: Better OS detection in integration tests (#7547)
+* fix: NativeTypeDeclarationCasingFixe - handle static property without type (#7589)
+* test: AutoReview - unify data provider returns (#7544)
+* test: check to have DataProviders code agnostic of PHP version (#7575)
+
+Changelog for v3.41.1
+---------------------
+
+* DX: Change `@testWith` to `@dataProvider` (#7535)
+* DX: Introduce Markdownlint (#7534)
+* fix: NativeTypeDeclarationCasingFixer - do not crash on `var` keyword (#7538)
+
+Changelog for v3.41.0
+---------------------
+
+* chore: Move `mb_str_functions` PHP 8.3 cases to separate test (#7505)
+* chore: Symfony v7 is now stable (#7469)
+* CI: drop PHP 8.3 hacks (#7519)
+* docs: Improve docs for `no_spaces_after_function_name` (#7520)
+* DX: Ability to run Sphinx linter locally (#7481)
+* DX: AbstractFixerTest - use anonymous classes (#7527)
+* DX: Add progress output for `cs:check` script (#7514)
+* DX: align doubles naming (#7525)
+* DX: remove AbstractFixerTestCase::getTestFile() (#7495)
+* DX: remove jangregor/phpstan-prophecy (#7524)
+* DX: remove Prophecy (#7509)
+* DX: replace Prophecy with anonymous classes in CacheTest (#7503)
+* DX: replace Prophecy with anonymous classes in ProcessLintingResultTest (#7501)
+* DX: Utilise auto-discovery for PHPStan formatter (#7490)
+* feat: Support `mb_str_pad` function in `mb_str_functions` rule (#7499)
+* fix: BinaryOperatorSpacesFixer - do not add whitespace inside short function (#7523)
+* fix: Downgrade PDepend to version not supporting Symfony 7 (#7513)
+* fix: GlobalNamespaceImportFixer - key in PHPDoc's array shape matching class name (#7522)
+* fix: SpacesInsideParenthesesFixer - handle class instantiation parentheses (#7531)
+* Update PHPstan to 1.10.48 (#7532)
+
+Changelog for v3.40.2
+---------------------
+
+* docs: fix link to source classes (#7493)
+
+Changelog for v3.40.1
+---------------------
+
+* chore: Delete stray file x (#7473)
+* chore: Fix editorconfig (#7478)
+* chore: Fix typos (#7474)
+* chore: Fix YAML line length (#7476)
+* chore: Indent JSON files with 4 spaces (#7480)
+* chore: Make YAML workflow git-based (#7477)
+* chore: Use stable XDebug (#7489)
+* CI: Lint docs (#7479)
+* CI: Use PHPStan's native Github error formatter (#7487)
+* DX: fix PHPStan error (#7488)
+* DX: PsrAutoloadingFixerTest - do not build mock in data provider (#7491)
+* DX: PsrAutoloadingFixerTest - merge all data providers into one (#7492)
+* DX: Update PHPStan to 1.10.46 (#7486)
+* fix: `NoSpacesAfterFunctionNameFixer` - do not remove space if the opening parenthesis part of an expression (#7430)
+
+Changelog for v3.40.0
+---------------------
+
+* chore: officially support PHP 8.3 (#7466)
+* chore: update deps (#7471)
+* CI: add --no-update while dropping non-compat `facile-it/paraunit` (#7470)
+* CI: automate --ignore-platform-req=PHP (#7467)
+* CI: bump actions/github-script to v7 (#7468)
+* CI: move humbug/box out of dev-tools/composer.json (#7472)
+
+Changelog for v3.39.1
+---------------------
+
+* DX: introduce SwitchAnalyzer (#7456)
+* fix: NoExtraBlankLinesFixer - do not remove blank line after `? : throw` (#7457)
+* fix: OrderedInterfacesFixer - do not comment out interface (#7464)
+* test: Improve `ExplicitIndirectVariableFixerTest` (#7451)
+
+Changelog for v3.39.0
+---------------------
+
+* chore: Add support for Symfony 7 (#7453)
+* chore: IntegrationTest - move support of php< requirement to main Integration classes (#7448)
+* CI: drop Symfony ^7 incompat exceptions of php-coveralls and cli-executor (#7455)
+* CI: early compatibility checks with Symfony 7 (#7431)
+* docs: drop list.rst and code behind it (#7436)
+* docs: remove Gitter mentions (#7441)
+* DX: Ability to run Fixer on PHP8.3 for development (#7449)
+* DX: describe command - for rules, list also sets that are including them (#7419)
+* DX: Docker clean up (#7450)
+* DX: more usage of spaceship operator (#7438)
+* DX: Put `Preg`'s last error message in exception message (#7443)
+* feat: Introduce `@PHP83Migration` ruleset and PHP 8.3 integration test (#7439)
+* test: Improve `AbstractIntegrationTestCase` description (#7452)
+
Changelog for v3.38.2
---------------------
@@ -216,7 +647,7 @@ Changelog for v3.23.0
---------------------
* bug: BlankLineBeforeStatementFixer - do not enforce/add a blank line when there is a blank line between the comment and the statement already (#7190)
-* bug: Fix detecting classy invokation in catch (#7191)
+* bug: Fix detecting classy invocation in catch (#7191)
* bug: Fix names resolving in `no_superfluous_phpdoc_tags` fixer (#7189)
* bug: Fix various bugs in `FullyQualifiedStrictTypesFixer` fixer (#7188)
* bug: Fixed line between general script documentation and require (#7177)
@@ -645,7 +1076,7 @@ Changelog for v3.11.0
* bug: Fix MethodChainingIndentationFixer with arrow functions and class instantiation (#5587)
* bug: MethodChainingIndentationFixer - Fix bug with attribute access (#6573)
* bug: NoMultilineWhitespaceAroundDoubleArrowFixer - fix for single line comment (#6589)
-* bug: TypeAlternationTransformer - TypeIntersectionTransforme - Bug: handle attributes (#6579)
+* bug: TypeAlternationTransformer - TypeIntersectionTransformer - Bug: handle attributes (#6579)
* bug: [BinaryOperatorFixer] Fix more issues with scoped operators (#6559)
* docs: Remove `$` from console command snippets (#6600)
* docs: Remove `$` from console command snippets in documentation (#6599)
@@ -704,7 +1135,7 @@ Changelog for v3.9.5
* DX: Narrow docblock types in Runner and Report (#6465)
* DX: Narrow docblock types in Tokenizer (#6293)
* minor: extract NoMultipleStatementsPerLineFixer from BracesFixer (#6458)
-* minor: Let PhpdocLineSpan fixer detect docblocks when seperator from token with attribute (#6343)
+* minor: Let PhpdocLineSpan fixer detect docblocks when separator from token with attribute (#6343)
Changelog for v3.9.4
--------------------
@@ -786,7 +1217,7 @@ Changelog for v3.7.0
* bug #6112 [BinaryOperatorSpacesFixer] Fix align of `=` inside calls of methods (VincentLanglet)
* bug #6279 ClassReferenceNameCasingFixer - Fix for double arrow (SpacePossum)
-* bug #6280 Fix bunch of enum issus (SpacePossum)
+* bug #6280 Fix bunch of enum issues (SpacePossum)
* bug #6283 ClassReferenceNameCasingFixer - detect imports (SpacePossum)
* feature #5892 NewWithBracesFixer - option to remove braces (jrmajor)
* feature #6081 Allow multiline constructor arguments in an anonymous classes (jrmajor, SpacePossum)
@@ -816,7 +1247,7 @@ Changelog for v3.6.0
* bug #6241 NoSuperfluousPhpdocTagsFixer - fix for reference and splat operator (kubawerlos)
* bug #6243 PhpdocTypesOrderFixer - fix for intersection types (kubawerlos)
* bug #6254 PhpUnitDedicateAssertFixer - remove `is_resource`. (drupol)
-* bug #6264 TokensAnalyzer - fix isConstantInvocation detection for mulitple exce… (SpacePossum)
+* bug #6264 TokensAnalyzer - fix isConstantInvocation detection for multiple exce… (SpacePossum)
* bug #6265 NullableTypeDeclarationForDefaultNullValueFixer - handle "readonly" a… (SpacePossum)
* bug #6266 SimplifiedIfReturnFixer - handle statement in loop without braces (SpacePossum)
* feature #6262 ClassReferenceNameCasingFixer - introduction (SpacePossum)
@@ -838,7 +1269,7 @@ Changelog for v3.5.0
* bug #6165 DeclareEqualNormalizeFixer - fix for declare having multiple directives (kubawerlos)
* bug #6170 NonPrintableCharacterFixer - fix for string in single quotes, having non-breaking space, linebreak, and single quote inside (kubawerlos)
* bug #6181 UseTransformer - Trait import in enum fix (PHP8.1) (SpacePossum)
-* bug #6188 PhpdocTo(Param|Property|Return)TypeFixer - fix for type intersections (kubawerlos)
+* bug #6188 `PhpdocTo(Param|Property|Return)TypeFixer` - fix for type intersections (kubawerlos)
* bug #6202 SquareBraceTransformer - fix for destructing square brace after double arrow (kubawerlos)
* bug #6209 OrderedClassElementsFixer - PHP8.0 support abstract private methods in traits (SpacePossum)
* bug #6224 ArgumentsAnalyzer - support PHP8.1 readonly (SpacePossum)
@@ -894,7 +1325,7 @@ Changelog for v3.4.0
* minor #6109 Add return type to `DummyTestSplFileInfo::getRealPath()` (derrabus)
* minor #6115 Remove PHP 7.2 polyfill (derrabus)
* minor #6116 CI: remove installation of mbstring polyfill in build script, it's required dependency now (keradus)
-* minor #6119 OrderedClassElementsFixer - PHPUnit assert(Pre|Post)Conditions methods support (meyerbaptiste)
+* minor #6119 OrderedClassElementsFixer - PHPUnit `assert(Pre|Post)Conditions` methods support (meyerbaptiste)
* minor #6121 Use Tokens::ensureWhitespaceAtIndex to simplify code (kubawerlos)
* minor #6127 Remove 2nd parameter to XdebugHandler constructor (phil-davis)
* minor #6129 clean ups (SpacePossum)
@@ -1017,7 +1448,7 @@ Changelog for v3.2.0
* minor #6029 PhpUnitDedicateAssertFixer - add "assertStringContainsString" and "as… (SpacePossum)
* minor #6030 SingleSpaceAfterConstructFixer - Add `switch` support (SpacePossum)
* minor #6033 ArgumentsAnalyzerTest - add more tests (SpacePossum)
-* minor #6034 7.0|7.1 - cleanup tests (SpacePossum)
+* minor #6034 Cleanup tests for PHP 7.0 and 7.1 (SpacePossum)
* minor #6035 Documentation generation split up and add list. (SpacePossum)
* minor #6048 Fix "can not" spelling (mvorisek)
@@ -1476,7 +1907,7 @@ Changelog for v2.17.3
Changelog for v2.17.2
---------------------
-* bug #5345 CleanNamespaceFixer - preserve traling comments (SpacePossum)
+* bug #5345 CleanNamespaceFixer - preserve trailing comments (SpacePossum)
* bug #5348 PsrAutoloadingFixer - fix for class without namespace (kubawerlos)
* bug #5362 SingleSpaceAfterConstructFixer: Do not adjust whitespace before multiple multi-line extends (localheinz, SpacePossum)
* minor #5314 Enable testing with PHPUnit 9.x (sanmai)
@@ -1574,7 +2005,6 @@ Changelog for v2.17.0
* minor #5323 NoUselessSprintfFixer - Fix test on PHP5.6 (SpacePossum)
* minor #5326 DX: relax composer requirements to not block installation under PHP v8, support for PHP v8 is not yet ready (keradus)
-
Changelog for v2.16.10
----------------------
@@ -2198,7 +2628,7 @@ Changelog for v2.15.4
* minor #4564 Move readme-update command to Section 3 (iwasherefirst2)
* minor #4566 Update symfony ruleset (gharlan)
* minor #4570 Command::execute() should always return an integer (derrabus)
-* minor #4580 Add suport for true/false return type hints. (SpacePossum)
+* minor #4580 Add support for true/false return type hints. (SpacePossum)
* minor #4584 Increase PHPStan level to 1 (julienfalque)
* minor #4585 Fix deprecation notices (julienfalque)
* minor #4587 Output details - Explain why a file was skipped (SpacePossum)
@@ -2359,8 +2789,8 @@ Changelog for v2.14.3
* minor #4340 Travis: build against 7.4snapshot instead of nightly (Slamdunk)
* minor #4351 code grooming (SpacePossum)
* minor #4353 Add more priority tests (SpacePossum)
-* minor #4364 DX: MethodChainingIndentationFixer - remove unneccesary loop (Sijun Zhu)
-* minor #4366 Unset the auxillary variable $a (GrahamCampbell)
+* minor #4364 DX: MethodChainingIndentationFixer - remove unnecessary loop (Sijun Zhu)
+* minor #4366 Unset the auxiliary variable $a (GrahamCampbell)
* minor #4368 Fixed TypeShortNameResolverTest::testResolver (GrahamCampbell)
* minor #4380 PHP7.4 - Add "str_split" => "mb_str_split" mapping. (SpacePossum)
* minor #4381 PHP7.4 - Add support for magic methods (un)serialize. (SpacePossum)
@@ -2534,7 +2964,7 @@ Changelog for v2.13.0
* feature #3812 Add FopenFlagOrderFixer & FopenFlagsFixer (SpacePossum)
* feature #3826 Add CombineNestedDirnameFixer (gharlan)
* feature #3833 BinaryOperatorSpacesFixer - Add "no space" fix strategy (SpacePossum)
-* feature #3841 NoAliasFunctionsFixer - add opt in option for ext-mbstring aliasses (SpacePossum)
+* feature #3841 NoAliasFunctionsFixer - add opt in option for ext-mbstring aliases (SpacePossum)
* feature #3876 NativeConstantInvocationFixer - add the scope option (stof, keradus)
* feature #3886 Add PhpUnitMethodCasingFixer (Slamdunk)
* feature #3907 Add ImplodeCallFixer (kubawerlos)
@@ -2615,8 +3045,8 @@ Changelog for v2.12.9
* minor #4340 Travis: build against 7.4snapshot instead of nightly (Slamdunk)
* minor #4351 code grooming (SpacePossum)
* minor #4353 Add more priority tests (SpacePossum)
-* minor #4364 DX: MethodChainingIndentationFixer - remove unneccesary loop (Sijun Zhu)
-* minor #4366 Unset the auxillary variable $a (GrahamCampbell)
+* minor #4364 DX: MethodChainingIndentationFixer - remove unnecessary loop (Sijun Zhu)
+* minor #4366 Unset the auxiliary variable $a (GrahamCampbell)
* minor #4368 Fixed TypeShortNameResolverTest::testResolver (GrahamCampbell)
* minor #4380 PHP7.4 - Add "str_split" => "mb_str_split" mapping. (SpacePossum)
* minor #4393 DX: add missing explicit return types (kubawerlos)
@@ -2871,7 +3301,7 @@ Changelog for v2.11.2
* bug #3673 PhpdocScalarFixer - Add "types" option (julienfalque, keradus)
* bug #3674 YodaStyleFixer - Fix variable detection for multidimensional arrays (julienfalque, SpacePossum)
* bug #3684 PhpUnitStrictFixer - Do not fix if not correct # of arguments are used (SpacePossum)
-* bug #3708 EspaceImplicitBackslashesFixer - Fix escaping multiple backslashes (julienfalque)
+* bug #3708 EscapeImplicitBackslashesFixer - Fix escaping multiple backslashes (julienfalque)
* bug #3715 SingleImportPerStatementFixer - Fix handling whitespace before opening brace (julienfalque)
* bug #3731 PhpdocIndentFixer - crash fix (SpacePossum)
* bug #3755 YodaStyleFixer - handle space between var name and index (SpacePossum)
@@ -3005,7 +3435,7 @@ Changelog for v2.10.3
* minor #3484 Create Tokens::findBlockStart (ntzm)
* minor #3512 Add missing array typehints (ntzm)
* minor #3513 Making AppVeyor happy (kubawerlos)
-* minor #3516 Use null|type instead of ?type in PHPDocs (ntzm)
+* minor #3516 Use `null|type` instead of `?type` in PHPDocs (ntzm)
* minor #3518 FixerFactoryTest - Test each priority test file is listed as test (SpacePossum)
* minor #3519 Fix typo (SpacePossum)
* minor #3520 Fix typos: ran vs. run (SpacePossum)
@@ -3190,7 +3620,7 @@ Changelog for v2.8.1
* bug #3199 TokensAnalyzer - getClassyElements (SpacePossum)
* bug #3208 BracesFixer - Fix for instantiation in control structures (julienfalque, SpacePossum)
-* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (|) (ntzm)
+* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (ntzm)
* bug #3216 AbstractLinesBeforeNamespaceFixer - add min. and max. option, not only single target count (SpacePossum)
* bug #3217 TokenizerLinter - fix lack of linting when code is cached (SpacePossum, keradus)
* minor #3200 Skip slow test when Xdebug is loaded (julienfalque)
@@ -3237,7 +3667,7 @@ Changelog for v2.7.4
* bug #3199 TokensAnalyzer - getClassyElements (SpacePossum)
* bug #3208 BracesFixer - Fix for instantiation in control structures (julienfalque, SpacePossum)
-* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (|) (ntzm)
+* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (ntzm)
* bug #3216 AbstractLinesBeforeNamespaceFixer - add min. and max. option, not only single target count (SpacePossum)
* bug #3217 TokenizerLinter - fix lack of linting when code is cached (SpacePossum, keradus)
* minor #3200 Skip slow test when Xdebug is loaded (julienfalque)
@@ -3259,7 +3689,7 @@ Changelog for v2.7.2
* bug #3062 BraceClassInstantiationTransformer - Fix instantiation inside method call braces case (julienfalque, keradus)
* bug #3083 SingleBlankLineBeforeNamespaceFixer - Fix handling namespace right after opening tag (mlocati)
* bug #3109 SwitchCaseSemicolonToColonFixer - Fix bug with nested constructs (SpacePossum)
-* bug #3117 Multibyte character in array key makes alignment incorect (kubawerlos)
+* bug #3117 Multibyte character in array key makes alignment incorrect (kubawerlos)
* bug #3123 Cache - File permissions (SpacePossum)
* bug #3138 NoHomoglyphNamesFixer - fix crash on non-ascii but not mapped either (SpacePossum)
* bug #3172 IndentationTypeFixer - do not touch whitespace that is not indentation (SpacePossum)
@@ -3459,7 +3889,7 @@ Changelog for v2.3.3
* bug #2807 NoUselessElseFixer - Fix detection of conditional block (SpacePossum)
* bug #2809 Phar release - fix readme generation (SpacePossum, keradus)
* bug #2827 MethodArgumentSpaceFixer - Always remove trailing spaces (julienfalque)
-* bug #2835 SelfAcessorFixer - class property fix (mnabialek)
+* bug #2835 SelfAccessorFixer - class property fix (mnabialek)
* bug #2848 PhpdocIndentFixer - fix edge case with inline phpdoc (keradus)
* bug #2849 BracesFixer - Fix indentation issues with comments (julienfalque)
* bug #2851 Tokens - ensureWhitespaceAtIndex (GrahamCampbell, SpacePossum)
@@ -3648,7 +4078,7 @@ Changelog for v2.2.17
* minor #3435 Add tests for general_phpdoc_annotation_remove (BackEndTea)
* minor #3484 Create Tokens::findBlockStart (ntzm)
* minor #3512 Add missing array typehints (ntzm)
-* minor #3516 Use null|type instead of ?type in PHPDocs (ntzm)
+* minor #3516 Use `null|type` instead of `?type` in PHPDocs (ntzm)
* minor #3518 FixerFactoryTest - Test each priority test file is listed as test (SpacePossum)
* minor #3520 Fix typos: ran vs. run (SpacePossum)
* minor #3521 Use HTTPS (carusogabriel)
@@ -3741,7 +4171,7 @@ Changelog for v2.2.10
* bug #3199 TokensAnalyzer - getClassyElements (SpacePossum)
* bug #3208 BracesFixer - Fix for instantiation in control structures (julienfalque, SpacePossum)
-* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (|) (ntzm)
+* bug #3215 BinaryOperatorSpacesFixer - Fix spaces around multiple exception catching (ntzm)
* bug #3216 AbstractLinesBeforeNamespaceFixer - add min. and max. option, not only single target count (SpacePossum)
* bug #3217 TokenizerLinter - fix lack of linting when code is cached (SpacePossum, keradus)
* minor #3200 Skip slow test when Xdebug is loaded (julienfalque)
@@ -3847,7 +4277,7 @@ Changelog for v2.2.5
* bug #2807 NoUselessElseFixer - Fix detection of conditional block (SpacePossum)
* bug #2809 Phar release - fix readme generation (SpacePossum, keradus)
* bug #2827 MethodArgumentSpaceFixer - Always remove trailing spaces (julienfalque)
-* bug #2835 SelfAcessorFixer - class property fix (mnabialek)
+* bug #2835 SelfAccessorFixer - class property fix (mnabialek)
* bug #2848 PhpdocIndentFixer - fix edge case with inline phpdoc (keradus)
* bug #2849 BracesFixer - Fix indentation issues with comments (julienfalque)
* bug #2851 Tokens - ensureWhitespaceAtIndex (GrahamCampbell, SpacePossum)
@@ -3936,7 +4366,9 @@ Changelog for v2.2.2
--------------------
Warning, this release breaks BC due to introduction of:
+
* minor #2554 Add short diff. output format (SpacePossum, keradus)
+
That PR was reverted in v2.2.3, which should be used instead of v2.2.2.
* bug #2545 RuleSet - change resolvement (SpacePossum)
@@ -4135,7 +4567,7 @@ Changelog for v2.0.1
* minor #2499 FileSpecificCodeSample - Specify class name relative to root namespace (localheinz, keradus)
* minor #2506 SCA (SpacePossum)
* minor #2515 Fix code indentation (keradus)
-* minor #2521 SCA trailing spces check - ouput lines with trailing white space (SpacePossum)
+* minor #2521 SCA trailing spces check - output lines with trailing white space (SpacePossum)
* minor #2522 Fix docs and small code issues (keradus)
Changelog for v2.0.0
@@ -4186,7 +4618,7 @@ Changelog for v2.0.0
* feature #1628 Added OrderedClassElementsFixer (gharlan)
* feature #1742 path argument is used to create an intersection with existing finder (keradus, gharlan)
* feature #1779 Added GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocAnnotationRenameFixer (keradus)
-* feature #1811 Added NoSpacesInsideOfssetFixer (phansys)
+* feature #1811 Added NoSpacesInsideOffsetFixer (phansys)
* feature #1819 Added DirConstantFixer, ModernizeTypesCastingFixer, RandomApiMigrationFixer (kalessil, SpacePossum, keradus)
* feature #1825 Added junit format (ekho)
* feature #1862 FixerFactory - Do not allow conflicting fixers (SpacePossum)
@@ -4303,7 +4735,7 @@ Changelog for v2.0.0
* minor #1846 FileFilterIterator - Corrected an iterator typehint (GrahamCampbell)
* minor #1848 DocBlock - Remove some old unused phpdoc tags (GrahamCampbell)
* minor #1856 NoDuplicateSemicolonsFixer - Remove overcomplete fixer (SpacePossum)
-* minor #1861 Fix: Ofsset should be Offset (localheinz)
+* minor #1861 Fix: Offset should be Offset (localheinz)
* minor #1867 Print non-report output to stdErr (SpacePossum, keradus)
* minor #1873 Enhancement: Show path to cache file if it exists (localheinz)
* minor #1875 renamed Composer package (fabpot)
@@ -4366,7 +4798,7 @@ Changelog for v2.0.0
* minor #2318 *TestCase - Reduce visibility of setUp() (localheinz)
* minor #2319 Code grooming (keradus)
* minor #2322 DX: use whitemessy aware assertion (keradus)
-* minor #2324 Echo|Print*Fixer - unify printing fixers (SpacePossum, keradus)
+* minor #2324 `Echo|Print*Fixer` - unify printing fixers (SpacePossum, keradus)
* minor #2337 Normalize rule naming (keradus)
* minor #2338 Drop hacks for unsupported HHVM (keradus)
* minor #2339 Add some Fixer descriptions (SpacePossum, keradus)
@@ -4444,7 +4876,7 @@ Changelog for v1.12.3
* bug #2209 LinefeedFixer - Fix in a safe way (SpacePossum)
* bug #2228 NoEmptyLinesAfterPhpdocs, SingleBlankLineBeforeNamespace - Fix priority (SpacePossum)
* bug #2230 FunctionDeclarationFixer - Fix T_USE case (SpacePossum)
-* bug #2232 Add a test for style of varaible decalration : var (daiglej)
+* bug #2232 Add a test for style of variable declaration : var (daiglej)
* bug #2246 Fix itest requirements (keradus)
* minor #2238 .gitattributes - specified line endings (keradus)
* minor #2239 IntegrationCase - no longer internal (keradus)
@@ -4733,7 +5165,7 @@ Changelog for v1.10.1
* bug #1444 OrderedUseFixer - fix next case (keradus)
* bug #1441 BracesFixer - fix next case (keradus)
* bug #1422 AlignDoubleArrowFixer - fix handling of nested array (SpacePossum)
-* bug #1425 PhpdocInlineTagFixerTest - fix case when met inalid PHPDoc (keradus)
+* bug #1425 PhpdocInlineTagFixerTest - fix case when met invalid PHPDoc (keradus)
* bug #1419 AlignDoubleArrowFixer, AlignEqualsFixer - fix priorities (keradus)
* bug #1415 BlanklineAfterOpenTagFixer - Do not add a line break if there is one already. (SpacePossum)
* bug #1410 PhpdocIndentFixer - Fix for open tag (SpacePossum)
@@ -4881,7 +5313,7 @@ Changelog for v1.5.1
--------------------
* bug #1054 VisibilityFixer - fix var with array value assigned (localheinz, keradus)
-* bug #1048 MultilineArrayTrailingCommaFixer, SingleArrayNoTrailingCommaFixer - using heredoc inside array not cousing to treat it as multiline array (keradus)
+* bug #1048 MultilineArrayTrailingCommaFixer, SingleArrayNoTrailingCommaFixer - using heredoc inside array not causing to treat it as multiline array (keradus)
* bug #1043 PhpdocToCommentFixer - also check other control structures, besides foreach (ceeram)
* bug #1045 OrderedUseFixer - fix namespace order for trailing digits (rusitschka)
* bug #1035 PhpdocToCommentFixer - Add static as valid keyword for structural element (ceeram)
@@ -4915,7 +5347,7 @@ Changelog for v1.5
* minor #957 Fix Fixers methods order (GrahamCampbell)
* minor #944 Enable caching of composer downloads on Travis (stof)
* minor #941 EncodingFixer - enhance tests (keradus)
-* minor #938 Psr0Fixer - remove unneded assignment (keradus)
+* minor #938 Psr0Fixer - remove unneeded assignment (keradus)
* minor #936 FixerTest - test description consistency (keradus)
* minor #933 NoEmptyLinesAfterPhpdocsFixer - remove unneeded code, clarify description (ceeram)
* minor #934 StdinFileInfo::getFilename - Replace phpdoc with normal comment and add back empty line before return (ceeram)
@@ -4958,7 +5390,7 @@ Changelog for v1.4
* bug #945 Skip files containing __halt_compiler() on PHP 5.3 (stof)
* bug #946 BracesFixer - fix typo in exception name (keradus)
* bug #940 Tokens::setCode - apply missing transformation (keradus)
-* bug #908 BracesFixer - fix invalide inserting brace for control structure without brace and lambda inside of it (keradus)
+* bug #908 BracesFixer - fix invalid inserting brace for control structure without brace and lambda inside of it (keradus)
* bug #903 NoEmptyLinesAfterPhpdocsFixer - fix bug with Windows style lines (GrahamCampbell)
* bug #895 [PSR-2] Preserve blank line after control structure opening brace (marcaube)
* bug #892 Fixed the double arrow multiline whitespace fixer (GrahamCampbell)
@@ -5022,7 +5454,7 @@ Changelog for v1.2
* minor #779 Fixed a docblock type (GrahamCampbell)
* minor #765 Typehinting in FileCacheManager, remove unused variable in Tokens (keradus)
* minor #764 SelfUpdateCommand - get local version only if remote version was successfully obtained (keradus)
-* minor #761 aling => (keradus)
+* minor #761 align => (keradus)
* minor #757 Some minor code simplify and extra test (keradus)
* minor #713 Download php-cs-fixer.phar without sudo (michaelsauter)
* minor #742 Various Minor Improvements (GrahamCampbell)
diff --git a/vendor/friendsofphp/php-cs-fixer/CONTRIBUTING.md b/vendor/friendsofphp/php-cs-fixer/CONTRIBUTING.md
index 8dc5ba173..f0f5a429d 100644
--- a/vendor/friendsofphp/php-cs-fixer/CONTRIBUTING.md
+++ b/vendor/friendsofphp/php-cs-fixer/CONTRIBUTING.md
@@ -1,6 +1,6 @@
# Contributions Are Welcome!
-If you need any help, don't hesitate to ask the community using [GitHub Discussions](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/categories/q-a) or [Gitter](https://gitter.im/PHP-CS-Fixer/Lobby).
+If you need any help, don't hesitate to ask the community using [GitHub Discussions](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/categories/q-a).
## Glossary
@@ -18,7 +18,10 @@ A *config* knows about the code style rules and the files and directories that m
## How to contribute
-ℹ️ **IMPORTANT**: before contributing with really significant changes that require a lot of effort or are crucial from this tool's architecture perspective, please open [RFC on GitHub Discussion](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/categories/rfc). The development effort should start only after the proposal is discussed and the approach aligned.
+> [!IMPORTANT]
+> Before contributing with _really_ significant changes that require a lot of effort or are crucial from this tool's
+> architecture perspective, please open [RFC on GitHub Discussion](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/categories/rfc).
+> The development effort should start only after the proposal is discussed and the approach aligned.
### Development
@@ -26,9 +29,9 @@ A *config* knows about the code style rules and the files and directories that m
* Create new branch on top of the latest revision of `master` branch (if you already had project locally, then make sure to update this branch before going to next steps). It's good when branch's name reflects intent of the changes, but this is not strict requirement since pull request provides description of the change. However, with good branch naming it's easier to work on multiple changes simultaneously.
* Install dependencies by running `composer update` (since project does not contain `composer.lock` it's better to ensure latest versions of packages by running `update` command instead of `install`).
* Make changes. Please remember that **all** changes have to be covered by tests.
- * if you work on a bug fix, please start with reproducing the problem by adding failing test case(s). When you have failing test case(s), you can [create pull request](#opening-a-pull-request) just to reproduce fail in the CI. Then you can provide fix _in the subsequent commits_, it will make code review easier. It's allowed to modify existing test cases in bug fix pull request, but *only if* current behavior is proved to be invalid.
- * if you work on existing fixers then don't change existing test cases, because these are contract between the maintainers and users (they ensure how tool works). Add new test cases that cover provided changes - preferred way of defining test cases is with [data provider](https://docs.phpunit.de/en/10.0/writing-tests-for-phpunit.html#data-providers) which uses `yield` with proper case description as a key (e.g. `yield 'Some specific scenario' => ['some', 'example', 'data'];`). Codebase may still contain test cases in different format, and it's totally acceptable to use `yield` approach next to existing `return` usages.
-* Update documentation: `composer docs`. This requires the highest version of PHP supported by PHP CS Fixer. If it is not installed on your system, you can run it in a Docker container instead: `docker-compose run php-8.2 php dev-tools/doc.php`.
+ * if you work on a bug fix, please start with reproducing the problem by adding failing test case(s). When you have failing test case(s), you can [create pull request](#opening-a-pull-request) just to reproduce fail in the CI. Then you can provide fix _in the subsequent commits_, it will make code review easier. It's allowed to modify existing test cases in bug fix pull request, but *only if* current behavior is proved to be invalid.
+ * if you work on existing fixers then don't change existing test cases, because these are contract between the maintainers and users (they ensure how tool works). Add new test cases that cover provided changes - preferred way of defining test cases is with [data provider](https://docs.phpunit.de/en/10.0/writing-tests-for-phpunit.html#data-providers) which uses `yield` with proper case description as a key (e.g. `yield 'Some specific scenario' => ['some', 'example', 'data'];`). Codebase may still contain test cases in different format, and it's totally acceptable to use `yield` approach next to existing `return` usages.
+* Update documentation: `composer docs`. This requires the highest version of PHP supported by PHP CS Fixer. If it is not installed on your system, you can run it in a Docker container instead: `docker compose run php-8.2 php dev-tools/doc.php`.
* Run QA suite: `composer qa`.
* Fix project itself (if needed): `composer cs:fix`.
@@ -37,43 +40,50 @@ A *config* knows about the code style rules and the files and directories that m
You can do some things to increase the chance that your pull request is accepted without communication ping-pong between you and the reviewers:
* Submit [single](https://en.wikipedia.org/wiki/Single-responsibility_principle) pull request per fix or feature.
-* Don't amend commits because it makes review rounds harder - all commits from your branch will be squashed (without commit messages) during merge, so you can treat pull request as a playground, without keeping everything tidy at any point.
-* If your changes are not up-to-date, [rebase](https://git-scm.com/docs/git-rebase) your branch onto the parent branch. Do it regularly whenever your branch is behind `master` branch, that will eliminate risk of problems after the merge.
+* Keep meaningful commit logs, don't use meaningless messages (e.g. `foo`, `more work`, `more work`, `more work`) and don't push complex PR as a single commit.
+* Don't [amend](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---amend) commits because it makes review rounds harder - all commits from your branch will be squashed (without commit messages) during the merge.
* Follow the conventions used in the project.
* Remember about tests and documentation.
* Don't bump `PhpCsFixer\Console\Application::VERSION`, it's done during release.
+> [!IMPORTANT]
+> Your pull request will have much higher chance of getting merged if you allow maintainers to push changes to your
+> branch. You can do it by ticking "Allow edits and access to secrets by maintainers" checkbox, but please keep in mind
+> this option is available only if your PR is created from a user's fork. If your fork is a part of organisation, then
+> you can add [Fixer maintainers](https://github.com/orgs/PHP-CS-Fixer/people) as members of that repository. This way
+> maintainers will be able to provide required changes or rebase your branch (only up-to-date PRs can be merged).
+
## Working With Docker
This project provides a Docker setup that allows working on it using any of the PHP versions supported by the tool.
To use it, you first need to install [Docker](https://docs.docker.com/get-docker/) ([Docker Compose](https://docs.docker.com/compose/) is a built-in plugin of the main tool).
-Next, copy [`docker-compose.override.yaml.dist`](./docker-compose.override.yaml.dist) to `docker-compose.override.yaml` and edit it to your needs. The relevant parameters that might require some tweaking have comments to help you.
+Next, copy [`compose.override.dist.yaml`](./compose.override.dist.yaml) to `compose.override.yaml` and edit it to your needs. The relevant parameters that might require some tweaking have comments to help you.
You can then build the images:
```console
-docker-compose build --parallel
+docker compose build --parallel
```
-Now you can run commands needed to work on the project. For example, say you want to run PHPUnit tests on PHP 7.4:
+Now you can run commands needed to work on the project. For example, say you want to run PHPUnit tests on PHP 8.2:
```console
-docker-compose run php-7.4 vendor/bin/phpunit
+docker compose run php-8.2 vendor/bin/phpunit
```
Sometimes it can be more convenient to have a shell inside the container:
```console
-docker-compose run php-7.4 sh
-/app vendor/bin/phpunit
+docker compose run php-7.4 sh
+/fixer vendor/bin/phpunit
```
The images come with an [`xdebug` script](github.com/julienfalque/xdebug/) that allows running any PHP command with Xdebug enabled to help debug problems.
```console
-docker-compose run php-7.4 xdebug vendor/bin/phpunit
+docker compose run php-8.2 xdebug vendor/bin/phpunit
```
If you're using PhpStorm, you need to create a [server](https://www.jetbrains.com/help/phpstorm/servers.html) with a name that matches the `PHP_IDE_CONFIG` environment variable defined in the Docker Compose configuration files, which is `php-cs-fixer` by default.
diff --git a/vendor/friendsofphp/php-cs-fixer/README.md b/vendor/friendsofphp/php-cs-fixer/README.md
index fb7f6a781..c5e0ac307 100644
--- a/vendor/friendsofphp/php-cs-fixer/README.md
+++ b/vendor/friendsofphp/php-cs-fixer/README.md
@@ -4,8 +4,7 @@
-PHP Coding Standards Fixer
-==========================
+# PHP Coding Standards Fixer
The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards;
whether you want to follow PHP coding standards as defined in the PSR-1, PSR-2, etc.,
@@ -22,9 +21,10 @@ projects. This tool does not only detect them, but also fixes them for you.
## Supported PHP Versions
* PHP 7.4
-* PHP 8.0 (except PHP 8.0.0 due to [bug in PHP tokenizer](https://bugs.php.net/bug.php?id=80462))
+* PHP 8.0
* PHP 8.1
* PHP 8.2
+* PHP 8.3
> **Note**
> Each new PHP version requires a huge effort to support the new syntax.
@@ -48,6 +48,7 @@ composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer
```
Or using the main `composer.json`:
+
```console
composer require --dev friendsofphp/php-cs-fixer
```
@@ -55,10 +56,24 @@ composer require --dev friendsofphp/php-cs-fixer
For more details and other installation methods, see
[installation instructions](./doc/installation.rst).
+### Run with Docker
+
+You can use pre-built Docker images to run ``php-cs-fixer``.
+
+```console
+docker run -v $(pwd):/code ghcr.io/php-cs-fixer/php-cs-fixer:${FIXER_VERSION:-3-php8.3} fix src
+```
+
+`$FIXER_VERSION` used in example above is an identifier of a release you want to use, which is based on Fixer and PHP versions combined. There are different tags for each Fixer's SemVer level and PHP version with syntax `-php`. For example:
+
+* `3.47.0-php7.4`
+* `3.47-php8.0`
+* `3-php8.3`
+
### Usage
Assuming you installed PHP CS Fixer as instructed above, you can run the
-following command to fix the files PHP files in the `src` directory:
+following command to fix the PHP files in the `src` directory:
```console
tools/php-cs-fixer/vendor/bin/php-cs-fixer fix src
@@ -82,11 +97,11 @@ Dedicated plugins exist for:
## Community
-The PHP CS Fixer is maintained on GitHub at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.
+The PHP CS Fixer is maintained on GitHub at .
Bug reports and ideas about new features are welcome there.
-You can reach us at https://gitter.im/PHP-CS-Fixer/Lobby about the project,
-configuration, possible improvements, ideas and questions, please visit us!
+You can reach us in the [GitHub Discussions](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/) regarding the
+project, configuration, possible improvements, ideas and questions. Please visit us there!
## Contribute
diff --git a/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md b/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md
index 00e0a9c5d..bea1ff4fb 100644
--- a/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md
+++ b/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md
@@ -1,21 +1,18 @@
-UPGRADE GUIDE FROM 2.x to 3.0
-=============================
+# UPGRADE GUIDE FROM 2.x to 3.0
This is guide for upgrade from version 2.x to 3.0 for using the CLI tool.
*Before following this guide, install [v2.19](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/tag/v2.19.0) and run in verbose mode (`php-cs-fixer fix -v`) or in future mode (`PHP_CS_FIXER_FUTURE_MODE=1 php-cs-fixer fix`) to identify deprecations and fix them first.*
-Rename of files
----------------
+## Rename of files
| 2.x | 3.0 | Description |
-| ---------------- | ------------------------ | -------------------------------------- |
+|------------------|--------------------------|----------------------------------------|
| `.php_cs` | `.php-cs-fixer.php` | Configuration file (local) |
| `.php_cs.dist` | `.php-cs-fixer.dist.php` | Configuration file (to be distributed) |
| `.php_cs.cache` | `.php-cs-fixer.cache` | Cache file |
-CLI options
------------
+## CLI options
| 2.x | 3.0 | Description | Note |
| ---------------- | --------------- | ----------------------------------------------- | -------------------------------------- |
@@ -27,94 +24,93 @@ CLI options
| --rules | --rules | Default value changed from @PSR2 to @PSR12 | |
| --config --rules | | | No longer allowed to pass both |
-Changes to rules
-----------------
+## Changes to rules
### Renamed rules
-Old name | New name | Note
--------- | -------- | ----
-`blank_line_before_return` | `blank_line_before_statement` | use configuration `['statements' => ['return']]`
-`final_static_access` | `self_static_accessor` |
-`hash_to_slash_comment` | `single_line_comment_style` | use configuration `['comment_types' => ['hash']]`
-`lowercase_constants` | `constant_case` | use configuration `['case' => 'lower']`
-`method_separation` | `class_attributes_separation` | use configuration `['elements' => ['method']]`
-`no_extra_consecutive_blank_lines` | `no_extra_blank_lines` |
-`no_multiline_whitespace_before_semicolons` | `multiline_whitespace_before_semicolons` |
-`no_short_echo_tag` | `echo_tag_syntax` | use configuration `['format' => 'long']`
-`php_unit_ordered_covers` | `phpdoc_order_by_value` | use configuration `['annotations' => [ 'covers' ]]`
-`phpdoc_inline_tag` | `general_phpdoc_tag_rename`, `phpdoc_inline_tag_normalizer` and `phpdoc_tag_type` |
-`pre_increment` | `increment_style` | use configuration `['style' => 'pre']`
-`psr0` | `psr_autoloading` | use configuration `['dir' => x ]`
-`psr4` | `psr_autoloading` |
-`silenced_deprecation_error` | `error_suppression` |
-`trailing_comma_in_multiline_array` | `trailing_comma_in_multiline` | use configuration `['elements' => ['arrays']]`
+| Old name | New name | Note |
+|--------------------------------------------|-----------------------------------------------------------------------------------|------------------------------------------------------|
+|`blank_line_before_return` | `blank_line_before_statement` | use configuration `['statements' => ['return']]` |
+|`final_static_access` | `self_static_accessor` | |
+|`hash_to_slash_comment` | `single_line_comment_style` | use configuration `['comment_types' => ['hash']]` |
+|`lowercase_constants` | `constant_case` | use configuration `['case' => 'lower']` |
+|`method_separation` | `class_attributes_separation` | use configuration `['elements' => ['method']]` |
+|`no_extra_consecutive_blank_lines` | `no_extra_blank_lines` | |
+|`no_multiline_whitespace_before_semicolons` | `multiline_whitespace_before_semicolons` | |
+|`no_short_echo_tag` | `echo_tag_syntax` | use configuration `['format' => 'long']` |
+|`php_unit_ordered_covers` | `phpdoc_order_by_value` | use configuration `['annotations' => [ 'covers' ]]` |
+|`phpdoc_inline_tag` | `general_phpdoc_tag_rename`, `phpdoc_inline_tag_normalizer` and `phpdoc_tag_type` | |
+|`pre_increment` | `increment_style` | use configuration `['style' => 'pre']` |
+|`psr0` | `psr_autoloading` | use configuration `['dir' => x ]` |
+|`psr4` | `psr_autoloading` | |
+|`silenced_deprecation_error` | `error_suppression` | |
+|`trailing_comma_in_multiline_array` | `trailing_comma_in_multiline` | use configuration `['elements' => ['arrays']]` |
### Removed rootless configuration
-Rule | Root option | Note
------------------------------------- | -------------- | ----
-`general_phpdoc_annotation_remove` | `annotations`
-`no_extra_consecutive_blank_lines` | `tokens`
-`no_spaces_around_offset` | `positions`
-`no_unneeded_control_parentheses` | `statements`
-`ordered_class_elements` | `order`
-`php_unit_construct` | `assertions`
-`php_unit_dedicate_assert` | `target` | root option works differently than rootless configuration
-`php_unit_strict` | `assertions`
-`phpdoc_no_alias_tag` | `replacements`
-`phpdoc_return_self_reference` | `replacements`
-`random_api_migration` | `replacements`
-`single_class_element_per_statement` | `elements`
-`visibility_required` | `elements`
+| Rule | Root option | Note |
+|--------------------------------------| -------------- |-----------------------------------------------------------|
+| `general_phpdoc_annotation_remove` | `annotations` | |
+| `no_extra_consecutive_blank_lines` | `tokens` | |
+| `no_spaces_around_offset` | `positions` | |
+| `no_unneeded_control_parentheses` | `statements` | |
+| `ordered_class_elements` | `order` | |
+| `php_unit_construct` | `assertions` | |
+| `php_unit_dedicate_assert` | `target` | root option works differently than rootless configuration |
+| `php_unit_strict` | `assertions` | |
+| `phpdoc_no_alias_tag` | `replacements` | |
+| `phpdoc_return_self_reference` | `replacements` | |
+| `random_api_migration` | `replacements` | |
+| `single_class_element_per_statement` | `elements` | |
+| `visibility_required` | `elements` | |
### Changed options
-Rule | Option | Change
----- | ------ | ------
-`binary_operator_spaces` | `align_double_arrow` | option was removed, use `operators` instead
-`binary_operator_spaces` | `align_equals` | option was removed use `operators` instead
-`blank_line_before_statement` | `statements: die` | option `die` was removed from `statements`, use `exit` instead
-`class_attributes_separation` | `elements` | option does no longer accept flat array as a value, use map instead
-`class_definition` | `multiLineExtendsEachSingleLine` | option was renamed to `multi_line_extends_each_single_line`
-`class_definition` | `singleItemSingleLine` | option was renamed to `single_item_single_line`
-`class_definition` | `singleLine` | option was renamed to `single_line`
-`doctrine_annotation_spaces` | `around_argument_assignments` | option was removed, use `before_argument_assignments` and `after_argument_assignments` instead
-`doctrine_annotation_spaces` | `around_array_assignments` | option was removed, use `after_array_assignments_colon`, `after_array_assignments_equals`, `before_array_assignments_colon` and `before_array_assignments_equals` instead
-`final_internal_class` | `annotation-black-list` | option was renamed, use `annotation_exclude`
-`final_internal_class` | `annotation-white-list` | option was renamed, use `annotation_include`
-`final_internal_class` | `consider-absent-docblock-as-internal-class` | option was renamed, use `consider_absent_docblock_as_internal_class`
-`header_comment` | `commentType` | option was renamed to `comment_type`
-`is_null` | `use_yoda_style` | option was removed, use `yoda_style` rule instead
-`no_extra_consecutive_blank_lines` | `tokens` | one of possible values, `useTrait`, was renamed to `use_trait`
-`ordered_class_elements` | `sortAlgorithm` | option was renamed, use `sort_algorithm` instead
-`ordered_imports` | `importsOrder` | option was renamed, use `imports_order`
-`ordered_imports` | `sortAlgorithm` | option was renamed, use `sort_algorithm`
-`php_unit_dedicate_assert` | `functions` | option was removed, use `target` instead
-`php_unit_test_annotation` | `case` | option was removed, use `php_unit_method_casing` rule instead
+| Rule | Option | Change |
+|------------------------------------|----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `binary_operator_spaces` | `align_double_arrow` | option was removed, use `operators` instead |
+| `binary_operator_spaces` | `align_equals` | option was removed use `operators` instead |
+| `blank_line_before_statement` | `statements: die` | option `die` was removed from `statements`, use `exit` instead |
+| `class_attributes_separation` | `elements` | option does no longer accept flat array as a value, use map instead |
+| `class_definition` | `multiLineExtendsEachSingleLine` | option was renamed to `multi_line_extends_each_single_line` |
+| `class_definition` | `singleItemSingleLine` | option was renamed to `single_item_single_line` |
+| `class_definition` | `singleLine` | option was renamed to `single_line` |
+| `doctrine_annotation_spaces` | `around_argument_assignments` | option was removed, use `before_argument_assignments` and `after_argument_assignments` instead |
+| `doctrine_annotation_spaces` | `around_array_assignments` | option was removed, use `after_array_assignments_colon`, `after_array_assignments_equals`, `before_array_assignments_colon` and `before_array_assignments_equals` instead |
+| `final_internal_class` | `annotation-black-list` | option was renamed, use `annotation_exclude` |
+| `final_internal_class` | `annotation-white-list` | option was renamed, use `annotation_include` |
+| `final_internal_class` | `consider-absent-docblock-as-internal-class` | option was renamed, use `consider_absent_docblock_as_internal_class` |
+| `header_comment` | `commentType` | option was renamed to `comment_type` |
+| `is_null` | `use_yoda_style` | option was removed, use `yoda_style` rule instead |
+| `no_extra_consecutive_blank_lines` | `tokens` | one of possible values, `useTrait`, was renamed to `use_trait` |
+| `ordered_class_elements` | `sortAlgorithm` | option was renamed, use `sort_algorithm` instead |
+| `ordered_imports` | `importsOrder` | option was renamed, use `imports_order` |
+| `ordered_imports` | `sortAlgorithm` | option was renamed, use `sort_algorithm` |
+| `php_unit_dedicate_assert` | `functions` | option was removed, use `target` instead |
+| `php_unit_test_annotation` | `case` | option was removed, use `php_unit_method_casing` rule instead |
### Changed default values of options
-Rule | Option | Old value | New value
----- | ---- | ---- | ----
-`array_syntax` | `syntax` | `'long'` | `'short'`
-`function_to_constant` | `functions` | `['get_class', 'php_sapi_name', 'phpversion', 'pi']` | `['get_called_class', 'get_class', 'php_sapi_name', 'phpversion', 'pi']`
-`list_syntax` | `syntax` | `'long'` | `'short'`
-`method_argument_space` | `on_multiline` | `'ignore'` | `'ensure_fully_multiline'`
-`native_constant_invocation` | `strict` | `false` | `true`
-`native_function_casing` | `include` | `'@internal'` | `'@compiler_optimized'`
-`native_function_invocation` | `include` | `'@internal'` | `'@compiler_optimized'`
-`native_function_invocation` | `strict` | `false` | `true`
-`non_printable_character` | `use_escape_sequences_in_strings` | `false` | `true` (when running on PHP 7.0 and up)
-`php_unit_dedicate_assert` | `target` | `'5.0'` | `'newest'`
-`phpdoc_align` | `tags` | `['param', 'return', 'throws', 'type', 'var']` | `['method', 'param', 'property', 'return', 'throws', 'type', 'var']`
-`phpdoc_scalar` | `types` | `['boolean', 'double', 'integer', 'real', 'str']` | `['boolean', 'callback', 'double', 'integer', 'real', 'str']`
+| Rule | Option | Old value | New value |
+|------------------------------|-----------------------------------|------------------------------------------------------|--------------------------------------------------------------------------|
+| `array_syntax` | `syntax` | `'long'` | `'short'` |
+| `function_to_constant` | `functions` | `['get_class', 'php_sapi_name', 'phpversion', 'pi']` | `['get_called_class', 'get_class', 'php_sapi_name', 'phpversion', 'pi']` |
+| `list_syntax` | `syntax` | `'long'` | `'short'` |
+| `method_argument_space` | `on_multiline` | `'ignore'` | `'ensure_fully_multiline'` |
+| `native_constant_invocation` | `strict` | `false` | `true` |
+| `native_function_casing` | `include` | `'@internal'` | `'@compiler_optimized'` |
+| `native_function_invocation` | `include` | `'@internal'` | `'@compiler_optimized'` |
+| `native_function_invocation` | `strict` | `false` | `true` |
+| `non_printable_character` | `use_escape_sequences_in_strings` | `false` | `true` (when running on PHP 7.0 and up) |
+| `php_unit_dedicate_assert` | `target` | `'5.0'` | `'newest'` |
+| `phpdoc_align` | `tags` | `['param', 'return', 'throws', 'type', 'var']` | `['method', 'param', 'property', 'return', 'throws', 'type', 'var']` |
+| `phpdoc_scalar` | `types` | `['boolean', 'double', 'integer', 'real', 'str']` | `['boolean', 'callback', 'double', 'integer', 'real', 'str']` |
### Removed rule sets
-Rule set | Note
--------- | ----
-`@PHP56Migration` | was empty
+| Rule set | Note |
+|-------------------|------------|
+| `@PHP56Migration` | was empty |
### Rule behavior changes
@@ -124,8 +120,7 @@ Rule set | Note
- `udiff` output now includes the file name in the output (if applicable)
-Code BC changes
-===============
+## Code BC changes
### Removed; various
@@ -138,11 +133,11 @@ Code BC changes
- `MethodArgumentSpaceFixer` deprecated methods have been removed
- `NoMixedEchoPrintFixer` the property `$defaultConfig` has been removed
- class `Tokens`, the following methods has been removed:
- - `current()`
- - `key()`
- - `next()`
- - `rewind()`
- - `valid()`
+ - `current()`
+ - `key()`
+ - `next()`
+ - `rewind()`
+ - `valid()`
- namespace `PhpCsFixer\Test\` and each class in it has been removed, as it served pure development purpose and should not be part of production code - reach out to community if you are willing to help building dev package
### Interface changes
diff --git a/vendor/friendsofphp/php-cs-fixer/ci-integration.sh b/vendor/friendsofphp/php-cs-fixer/ci-integration.sh
index 6ede4fd53..39d999559 100644
--- a/vendor/friendsofphp/php-cs-fixer/ci-integration.sh
+++ b/vendor/friendsofphp/php-cs-fixer/ci-integration.sh
@@ -5,4 +5,4 @@ IFS='
'
CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "${COMMIT_RANGE}")
if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi
-vendor/bin/php-cs-fixer check --config=.php-cs-fixer.dist.php -v --stop-on-violation --using-cache=no ${EXTRA_ARGS}
+vendor/bin/php-cs-fixer check --config=.php-cs-fixer.dist.php -v --show-progress=dots --stop-on-violation --using-cache=no ${EXTRA_ARGS}
diff --git a/vendor/friendsofphp/php-cs-fixer/composer.json b/vendor/friendsofphp/php-cs-fixer/composer.json
index ec122c6e1..0434e8760 100644
--- a/vendor/friendsofphp/php-cs-fixer/composer.json
+++ b/vendor/friendsofphp/php-cs-fixer/composer.json
@@ -21,36 +21,36 @@
],
"require": {
"php": "^7.4 || ^8.0",
+ "ext-filter": "*",
"ext-json": "*",
"ext-tokenizer": "*",
- "composer/semver": "^3.3",
+ "composer/semver": "^3.4",
"composer/xdebug-handler": "^3.0.3",
- "sebastian/diff": "^4.0 || ^5.0",
- "symfony/console": "^5.4 || ^6.0",
- "symfony/event-dispatcher": "^5.4 || ^6.0",
- "symfony/filesystem": "^5.4 || ^6.0",
- "symfony/finder": "^5.4 || ^6.0",
- "symfony/options-resolver": "^5.4 || ^6.0",
- "symfony/polyfill-mbstring": "^1.27",
- "symfony/polyfill-php80": "^1.27",
- "symfony/polyfill-php81": "^1.27",
- "symfony/process": "^5.4 || ^6.0",
- "symfony/stopwatch": "^5.4 || ^6.0"
+ "sebastian/diff": "^4.0 || ^5.0 || ^6.0",
+ "symfony/console": "^5.4 || ^6.0 || ^7.0",
+ "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0",
+ "symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
+ "symfony/finder": "^5.4 || ^6.0 || ^7.0",
+ "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0",
+ "symfony/polyfill-mbstring": "^1.28",
+ "symfony/polyfill-php80": "^1.28",
+ "symfony/polyfill-php81": "^1.28",
+ "symfony/process": "^5.4 || ^6.0 || ^7.0",
+ "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
},
"require-dev": {
"facile-it/paraunit": "^1.3 || ^2.0",
+ "infection/infection": "^0.27.11",
"justinrainbow/json-schema": "^5.2",
- "keradus/cli-executor": "^2.0",
+ "keradus/cli-executor": "^2.1",
"mikey179/vfsstream": "^1.6.11",
- "php-coveralls/php-coveralls": "^2.5.3",
+ "php-coveralls/php-coveralls": "^2.7",
"php-cs-fixer/accessible-object": "^1.1",
- "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2",
- "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1",
- "phpspec/prophecy": "^1.16",
- "phpspec/prophecy-phpunit": "^2.0",
- "phpunit/phpunit": "^9.5",
- "symfony/phpunit-bridge": "^6.2.3",
- "symfony/yaml": "^5.4 || ^6.0"
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4",
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4",
+ "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2",
+ "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
+ "symfony/yaml": "^5.4 || ^6.0 || ^7.0"
},
"suggest": {
"ext-dom": "For handling output formats in XML",
@@ -85,10 +85,11 @@
"Composer\\Config::disableProcessTimeout",
"paraunit run --testsuite auto-review"
],
- "cs:check": "@php php-cs-fixer check --diff",
+ "cs:check": "@php php-cs-fixer check --verbose --diff",
"cs:fix": "@php php-cs-fixer fix",
"cs:fix:parallel": "echo '🔍 Will run in batches of 50 files.'; if [[ -f .php-cs-fixer.php ]]; then FIXER_CONFIG=.php-cs-fixer.php; else FIXER_CONFIG=.php-cs-fixer.dist.php; fi; php php-cs-fixer list-files --config=$FIXER_CONFIG | xargs -n 50 -P 8 php php-cs-fixer fix --config=$FIXER_CONFIG --path-mode intersection 2> /dev/null",
"docs": "@php dev-tools/doc.php",
+ "infection": "@test:mutation",
"install-tools": "@composer --working-dir=dev-tools install",
"mess-detector": "@php dev-tools/vendor/bin/phpmd . ansi dev-tools/mess-detector/phpmd.xml --exclude vendor/*,dev-tools/vendor/*,dev-tools/phpstan/*,tests/Fixtures/*",
"normalize": [
@@ -111,6 +112,7 @@
"./dev-tools/check_file_permissions.sh",
"./dev-tools/check_trailing_spaces.sh",
"@normalize",
+ "@unused-deps",
"@require-checker",
"@auto-review"
],
@@ -126,12 +128,20 @@
],
"test:coverage": [
"Composer\\Config::disableProcessTimeout",
- "paraunit coverage --testsuite unit --exclude-group covers-nothing"
+ "@composer show facile-it/paraunit ^2 && (paraunit coverage --testsuite unit --pass-through=--exclude-group=covers-nothing) || (paraunit coverage --testsuite unit --exclude-group covers-nothing)"
],
"test:integration": [
"Composer\\Config::disableProcessTimeout",
"paraunit run --testsuite integration"
],
+ "test:mutation": [
+ "Composer\\Config::disableProcessTimeout",
+ "infection --threads=max --only-covered --min-covered-msi=80"
+ ],
+ "test:short-open-tag": [
+ "Composer\\Config::disableProcessTimeout",
+ "@php -d short_open_tag=1 ./vendor/bin/phpunit --do-not-cache-result --testsuite short-open-tag"
+ ],
"test:smoke": [
"Composer\\Config::disableProcessTimeout",
"paraunit run --testsuite smoke"
@@ -139,7 +149,8 @@
"test:unit": [
"Composer\\Config::disableProcessTimeout",
"paraunit run --testsuite unit"
- ]
+ ],
+ "unused-deps": "@php dev-tools/vendor/bin/composer-unused --excludePackage=composer/xdebug-handler"
},
"scripts-descriptions": {
"auto-review": "Execute Auto-review",
@@ -147,6 +158,7 @@
"cs:fix": "Fix coding standards",
"cs:fix:parallel": "Fix coding standards in naive parallel mode (using xargs)",
"docs": "Regenerate docs",
+ "infection": "Alias for 'test:mutation'",
"install-tools": "Install DEV tools",
"mess-detector": "Analyse code with Mess Detector",
"normalize": "Run normalization for composer.json files",
@@ -163,7 +175,10 @@
"test:all": "Run Unit and Integration tests (but *NOT* Smoke tests)",
"test:coverage": "Run tests that provide code coverage",
"test:integration": "Run Integration tests",
+ "test:mutation": "Run mutation tests",
+ "test:short-open-tag": "Run tests with \"short_open_tag\" enabled",
"test:smoke": "Run Smoke tests",
- "test:unit": "Run Unit tests"
+ "test:unit": "Run Unit tests",
+ "unused-deps": "Verifies if app has dependencies that are not used"
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/logo.md b/vendor/friendsofphp/php-cs-fixer/logo.md
index c2877f718..68e03a582 100644
--- a/vendor/friendsofphp/php-cs-fixer/logo.md
+++ b/vendor/friendsofphp/php-cs-fixer/logo.md
@@ -1,3 +1,3 @@
The logo is © 2010+ Sensio Labs.
-Original resolution can be found at https://github.com/PHP-CS-Fixer/logo .
+Original resolution can be found at .
diff --git a/vendor/friendsofphp/php-cs-fixer/php-cs-fixer b/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
index e29468be5..402b49ae6 100755
--- a/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
+++ b/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
@@ -28,8 +28,8 @@ set_error_handler(static function ($severity, $message, $file, $line) {
exit(1);
}
- if (\PHP_VERSION_ID < 70400 || \PHP_VERSION_ID >= 80300) {
- fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.2.*.\n");
+ if (\PHP_VERSION_ID < 70400 || \PHP_VERSION_ID >= 80400) {
+ fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.3.*.\n");
fwrite(STDERR, 'Current PHP version: '.PHP_VERSION.".\n");
if (getenv('PHP_CS_FIXER_IGNORE_ENV')) {
diff --git a/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php
index 97a92deff..dfddeb516 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php
@@ -43,7 +43,7 @@ public function isRisky(): bool
* Looks up Tokens sequence for suitable candidates and delivers boundaries information,
* which can be supplied by other methods in this abstract class.
*
- * @return null|int[] returns $functionName, $openParenthesis, $closeParenthesis packed into array
+ * @return ?array{int, int, int} returns $functionName, $openParenthesis, $closeParenthesis packed into array
*/
protected function find(string $functionNameToSearch, Tokens $tokens, int $start = 0, ?int $end = null): ?array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php
index 48cd7763e..b45be5acd 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php
@@ -93,7 +93,7 @@ protected function isSuperfluousElse(Tokens $tokens, int $index): bool
*
* @param int $index T_IF, T_ELSE, T_ELSEIF
*
- * @return int[]
+ * @return array{int, int}
*/
private function getPreviousBlock(Tokens $tokens, int $index): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php
index e9d706393..4e50a6789 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php
@@ -29,10 +29,12 @@
/**
* @internal
+ *
+ * @phpstan-type _CommonTypeInfo array{commonType: string, isNullable: bool}
*/
abstract class AbstractPhpdocToTypeDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface
{
- private const REGEX_CLASS = '(?:\\\\?+'.TypeExpression::REGEX_IDENTIFIER
+ private const REGEX_CLASS = '(?:\\\?+'.TypeExpression::REGEX_IDENTIFIER
.'(\\\\'.TypeExpression::REGEX_IDENTIFIER.')*+)';
/**
@@ -75,6 +77,10 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
->setAllowedTypes(['bool'])
->setDefault(true)
->getOption(),
+ (new FixerOptionBuilder('union_types', 'Fix also union types; turned on by default on PHP >= 8.0.0.'))
+ ->setAllowedTypes(['bool'])
+ ->setDefault(\PHP_VERSION_ID >= 8_00_00)
+ ->getOption(),
]);
}
@@ -103,7 +109,7 @@ protected function findFunctionDocComment(Tokens $tokens, int $index): ?int
}
/**
- * @return Annotation[]
+ * @return list
*/
protected function getAnnotationsFromDocComment(string $name, Tokens $tokens, int $docCommentIndex): array
{
@@ -123,7 +129,7 @@ protected function getAnnotationsFromDocComment(string $name, Tokens $tokens, in
}
/**
- * @return Token[]
+ * @return list
*/
protected function createTypeDeclarationTokens(string $type, bool $isNullable): array
{
@@ -166,7 +172,7 @@ protected function createTypeDeclarationTokens(string $type, bool $isNullable):
abstract protected function createTokensFromRawType(string $type): Tokens;
/**
- * @return null|array{string, bool}
+ * @return ?_CommonTypeInfo
*/
protected function getCommonTypeInfo(TypeExpression $typesExpression, bool $isReturnType): ?array
{
@@ -201,7 +207,7 @@ protected function getCommonTypeInfo(TypeExpression $typesExpression, bool $isRe
return null;
}
- return [$commonType, $isNullable];
+ return ['commonType' => $commonType, 'isNullable' => $isNullable];
}
protected function getUnionTypes(TypeExpression $typesExpression, bool $isReturnType): ?string
@@ -214,6 +220,10 @@ protected function getUnionTypes(TypeExpression $typesExpression, bool $isReturn
return null;
}
+ if (false === $this->configuration['union_types']) {
+ return null;
+ }
+
$types = $typesExpression->getTypes();
$isNullable = $typesExpression->allowsNull();
$unionTypes = [];
@@ -236,7 +246,7 @@ protected function getUnionTypes(TypeExpression $typesExpression, bool $isReturn
$typeExpression = new TypeExpression($type, null, []);
$commonType = $typeExpression->getCommonType();
- if (!$containsOtherThanIterableType && !\in_array($commonType, ['array', 'Traversable', 'iterable'], true)) {
+ if (!$containsOtherThanIterableType && !\in_array($commonType, ['array', \Traversable::class, 'iterable'], true)) {
$containsOtherThanIterableType = true;
}
if ($isReturnType && !$containsOtherThanEmptyType && !\in_array($commonType, ['null', 'void', 'never'], true)) {
diff --git a/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php
index c7266c6d2..82b8e57f4 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php
@@ -16,6 +16,7 @@
use PhpCsFixer\DocBlock\Annotation;
use PhpCsFixer\DocBlock\DocBlock;
+use PhpCsFixer\DocBlock\TypeExpression;
use PhpCsFixer\Tokenizer\Token;
use PhpCsFixer\Tokenizer\Tokens;
@@ -31,7 +32,7 @@ abstract class AbstractPhpdocTypesFixer extends AbstractFixer
/**
* The annotation tags search inside.
*
- * @var string[]
+ * @var list
*/
protected array $tags;
@@ -93,26 +94,30 @@ private function fixTypes(Annotation $annotation): void
}
/**
- * @param string[] $types
+ * @param list $types
*
- * @return string[]
+ * @return list
*/
private function normalizeTypes(array $types): array
{
- foreach ($types as $index => $type) {
- $types[$index] = $this->normalizeType($type);
- }
-
- return $types;
- }
-
- /**
- * Prepare the type and normalize it.
- */
- private function normalizeType(string $type): string
- {
- return str_ends_with($type, '[]')
- ? $this->normalizeType(substr($type, 0, -2)).'[]'
- : $this->normalize($type);
+ return array_map(
+ function (string $type): string {
+ $typeExpression = new TypeExpression($type, null, []);
+
+ $typeExpression->walkTypes(function (TypeExpression $type): void {
+ if (!$type->isUnionType()) {
+ $value = $this->normalize($type->toString());
+
+ // TODO TypeExpression should be immutable and walkTypes method should be changed to mapTypes method
+ \Closure::bind(static function () use ($type, $value): void {
+ $type->value = $value;
+ }, null, TypeExpression::class)();
+ }
+ });
+
+ return $typeExpression->toString();
+ },
+ $types
+ );
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php
index d312bae9f..96eab156a 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php
@@ -100,7 +100,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
/**
- * @return FixerInterface[]
+ * @return list
*/
abstract protected function createProxyFixers(): array;
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php
index dfa70634a..1f53fd2ba 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php
@@ -75,7 +75,7 @@ public function toJson(): string
'hashes' => $this->hashes,
]);
- if (JSON_ERROR_NONE !== json_last_error()) {
+ if (JSON_ERROR_NONE !== json_last_error() || false === $json) {
throw new \UnexpectedValueException(sprintf(
'Cannot encode cache signature to JSON, error: "%s". If you have non-UTF8 chars in your signature, like in license for `header_comment`, consider enabling `ext-mbstring` or install `symfony/polyfill-mbstring`.',
json_last_error_msg()
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php
index 4e82d0c9c..b9fb2ff63 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php
@@ -24,4 +24,6 @@ interface CacheManagerInterface
public function needFixing(string $file, string $fileContent): bool;
public function setFile(string $file, string $fileContent): void;
+
+ public function setFileHash(string $file, string $hash): void;
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php
index 1e3f64dc1..d81e91c16 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php
@@ -14,6 +14,8 @@
namespace PhpCsFixer\Cache;
+use PhpCsFixer\Tokenizer\CodeHasher;
+
/**
* Class supports caching information about state of fixing files.
*
@@ -101,9 +103,12 @@ public function needFixing(string $file, string $fileContent): bool
public function setFile(string $file, string $fileContent): void
{
- $file = $this->cacheDirectory->getRelativePathTo($file);
+ $this->setFileHash($file, $this->calcHash($fileContent));
+ }
- $hash = $this->calcHash($fileContent);
+ public function setFileHash(string $file, string $hash): void
+ {
+ $file = $this->cacheDirectory->getRelativePathTo($file);
if ($this->isDryRun && $this->cache->has($file) && $this->cache->get($file) !== $hash) {
$this->cache->clear($file);
@@ -136,6 +141,6 @@ private function writeCache(): void
private function calcHash(string $content): string
{
- return md5($content);
+ return CodeHasher::calculateCodeHash($content);
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php
index ff0b6fed7..3a5fe9914 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php
@@ -16,6 +16,7 @@
/**
* @author Andreas Möller
+ * @author Dariusz Rumiński
*
* @internal
*/
@@ -27,4 +28,6 @@ public function needFixing(string $file, string $fileContent): bool
}
public function setFile(string $file, string $fileContent): void {}
+
+ public function setFileHash(string $file, string $hash): void {}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Config.php b/vendor/friendsofphp/php-cs-fixer/src/Config.php
index 6ed9f5cb0..59e5462cf 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Config.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Config.php
@@ -26,7 +26,7 @@ class Config implements ConfigInterface
private string $cacheFile = '.php-cs-fixer.cache';
/**
- * @var FixerInterface[]
+ * @var list
*/
private array $customFixers = [];
@@ -57,13 +57,20 @@ class Config implements ConfigInterface
*
* @var array|bool>
*/
- private array $rules = ['@PSR12' => true];
+ private array $rules;
private bool $usingCache = true;
public function __construct(string $name = 'default')
{
- $this->name = $name;
+ // @TODO 4.0 cleanup
+ if (Utils::isFutureModeEnabled()) {
+ $this->name = $name.' (future mode)';
+ $this->rules = ['@PER-CS' => true];
+ } else {
+ $this->name = $name;
+ $this->rules = ['@PSR12' => true];
+ }
}
public function getCacheFile(): string
@@ -81,9 +88,7 @@ public function getCustomFixers(): array
*/
public function getFinder(): iterable
{
- if (null === $this->finder) {
- $this->finder = new Finder();
- }
+ $this->finder ??= new Finder();
return $this->finder;
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php b/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php
index b46b191b0..5308f860a 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php
@@ -32,7 +32,7 @@ public function getCacheFile(): ?string;
/**
* Returns the custom fixers to use.
*
- * @return FixerInterface[]
+ * @return list
*/
public function getCustomFixers(): array;
@@ -92,7 +92,7 @@ public function getUsingCache(): bool;
*
* Name of custom fixer should follow `VendorName/rule_name` convention.
*
- * @param FixerInterface[]|iterable|\Traversable $fixers
+ * @param iterable $fixers
*/
public function registerCustomFixers(iterable $fixers): self;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php
index 39fcc5879..34f6696c7 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php
@@ -40,14 +40,15 @@
*/
final class Application extends BaseApplication
{
- public const VERSION = '3.38.2';
- public const VERSION_CODENAME = 'CI Marathon';
+ public const NAME = 'PHP CS Fixer';
+ public const VERSION = '3.56.1';
+ public const VERSION_CODENAME = '15 Keys Accelerate';
private ToolInfo $toolInfo;
public function __construct()
{
- parent::__construct('PHP CS Fixer', self::VERSION);
+ parent::__construct(self::NAME, self::VERSION);
$this->toolInfo = new ToolInfo();
@@ -109,8 +110,13 @@ public function doRun(InputInterface $input, OutputInterface $output): int
return $result;
}
- public function getLongVersion(): string
+ /**
+ * @internal
+ */
+ public static function getAbout(bool $decorated = false): string
{
+ $longVersion = sprintf('%s %s', self::NAME, self::VERSION);
+
$commit = '@git-commit@';
$versionCommit = '';
@@ -118,13 +124,36 @@ public function getLongVersion(): string
$versionCommit = substr($commit, 0, 7);
}
- return implode('', [
- parent::getLongVersion(),
+ $about = implode('', [
+ $longVersion,
$versionCommit ? sprintf(' (%s)', $versionCommit) : '', // @phpstan-ignore-line to avoid `Ternary operator condition is always true|false.`
self::VERSION_CODENAME ? sprintf(' %s', self::VERSION_CODENAME) : '', // @phpstan-ignore-line to avoid `Ternary operator condition is always true|false.`
- ' by Fabien Potencier and Dariusz Ruminski.',
- "\nPHP runtime: ".PHP_VERSION.'',
+ ' by Fabien Potencier, Dariusz Ruminski and contributors.',
]);
+
+ if (false === $decorated) {
+ return strip_tags($about);
+ }
+
+ return $about;
+ }
+
+ /**
+ * @internal
+ */
+ public static function getAboutWithRuntime(bool $decorated = false): string
+ {
+ $about = self::getAbout(true)."\nPHP runtime: ".PHP_VERSION.'';
+ if (false === $decorated) {
+ return strip_tags($about);
+ }
+
+ return $about;
+ }
+
+ public function getLongVersion(): string
+ {
+ return self::getAboutWithRuntime(true);
}
protected function getDefaultCommands(): array
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php
index d5c83b72c..1e7d7537f 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php
@@ -27,7 +27,10 @@
#[AsCommand(name: 'check', description: 'Checks if configured files/directories comply with configured rules.')]
final class CheckCommand extends FixCommand
{
+ /** @var string */
protected static $defaultName = 'check';
+
+ /** @var string */
protected static $defaultDescription = 'Checks if configured files/directories comply with configured rules.';
public function __construct(ToolInfoInterface $toolInfo)
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php
index 2b5f9c3b5..b8c3ba6ce 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php
@@ -15,11 +15,14 @@
namespace PhpCsFixer\Console\Command;
use PhpCsFixer\Config;
+use PhpCsFixer\Console\Application;
use PhpCsFixer\Console\ConfigurationResolver;
use PhpCsFixer\Differ\DiffConsoleFormatter;
use PhpCsFixer\Differ\FullDiffer;
+use PhpCsFixer\Documentation\FixerDocumentGenerator;
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
use PhpCsFixer\Fixer\DeprecatedFixerInterface;
+use PhpCsFixer\Fixer\ExperimentalFixerInterface;
use PhpCsFixer\Fixer\FixerInterface;
use PhpCsFixer\FixerConfiguration\AliasedFixerOption;
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
@@ -52,10 +55,11 @@
#[AsCommand(name: 'describe')]
final class DescribeCommand extends Command
{
+ /** @var string */
protected static $defaultName = 'describe';
/**
- * @var string[]
+ * @var ?list
*/
private $setNames;
@@ -93,9 +97,9 @@ protected function configure(): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
- if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity() && $output instanceof ConsoleOutputInterface) {
+ if ($output instanceof ConsoleOutputInterface) {
$stdErr = $output->getErrorOutput();
- $stdErr->writeln($this->getApplication()->getLongVersion());
+ $stdErr->writeln(Application::getAboutWithRuntime(true));
}
$resolver = new ConfigurationResolver(
@@ -150,24 +154,28 @@ private function describeRule(OutputInterface $output, string $name): void
$definition = $fixer->getDefinition();
- $summary = $definition->getSummary();
+ $output->writeln(sprintf('Description of the `%s` rule.>', $name));
+ $output->writeln('');
+
+ if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
+ $output->writeln(sprintf('Fixer class: %s.', \get_class($fixer)));
+ $output->writeln('');
+ }
if ($fixer instanceof DeprecatedFixerInterface) {
$successors = $fixer->getSuccessorsNames();
$message = [] === $successors
- ? 'will be removed in the next major version'
+ ? sprintf('it will be removed in version %d.0', Application::getMajorVersion() + 1)
: sprintf('use %s instead', Utils::naturalLanguageJoinWithBackticks($successors));
- $message = Preg::replace('/(`.+?`)/', '$1', $message);
- $summary .= sprintf(' DEPRECATED: %s.', $message);
- }
-
- $output->writeln(sprintf('Description of %s rule.', $name));
- if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
- $output->writeln(sprintf('Fixer class: %s.', \get_class($fixer)));
+ $endMessage = '. '.ucfirst($message);
+ Utils::triggerDeprecation(new \RuntimeException(str_replace('`', '"', "Rule \"{$name}\" is deprecated{$endMessage}.")));
+ $message = Preg::replace('/(`[^`]+`)/', '$1', $message);
+ $output->writeln(sprintf('DEPRECATED: %s.', $message));
+ $output->writeln('');
}
- $output->writeln($summary);
+ $output->writeln($definition->getSummary());
$description = $definition->getDescription();
@@ -177,8 +185,15 @@ private function describeRule(OutputInterface $output, string $name): void
$output->writeln('');
+ if ($fixer instanceof ExperimentalFixerInterface) {
+ $output->writeln('Fixer applying this rule is EXPERIMENTAL..');
+ $output->writeln('It is not covered with backward compatibility promise and may produce unstable or unexpected results.');
+
+ $output->writeln('');
+ }
+
if ($fixer->isRisky()) {
- $output->writeln('Fixer applying this rule is risky.');
+ $output->writeln('Fixer applying this rule is RISKY.');
$riskyDescription = $definition->getRiskyDescription();
@@ -242,7 +257,7 @@ private function describeRule(OutputInterface $output, string $name): void
$output->writeln('');
}
- /** @var CodeSampleInterface[] $codeSamples */
+ /** @var list $codeSamples */
$codeSamples = array_filter($definition->getCodeSamples(), static function (CodeSampleInterface $codeSample): bool {
if ($codeSample instanceof VersionSpecificCodeSampleInterface) {
return $codeSample->isSuitableFor(\PHP_VERSION_ID);
@@ -251,9 +266,14 @@ private function describeRule(OutputInterface $output, string $name): void
return true;
});
- if (0 === \count($codeSamples)) {
+ if (0 === \count($definition->getCodeSamples())) {
$output->writeln([
- 'Fixing examples cannot be demonstrated on the current PHP version.',
+ 'Fixing examples are not available for this rule.',
+ '',
+ ]);
+ } elseif (0 === \count($codeSamples)) {
+ $output->writeln([
+ 'Fixing examples cannot be demonstrated on the current PHP version.',
'',
]);
} else {
@@ -300,6 +320,24 @@ private function describeRule(OutputInterface $output, string $name): void
$output->writeln([$diffFormatter->format($diff, ' %s'), '']);
}
}
+
+ $ruleSetConfigs = FixerDocumentGenerator::getSetsOfRule($name);
+
+ if ([] !== $ruleSetConfigs) {
+ ksort($ruleSetConfigs);
+ $plural = 1 !== \count($ruleSetConfigs) ? 's' : '';
+ $output->writeln("Fixer is part of the following rule set{$plural}:");
+
+ foreach ($ruleSetConfigs as $set => $config) {
+ if (null !== $config) {
+ $output->writeln(sprintf('* %s with config: %s', $set, Utils::toString($config)));
+ } else {
+ $output->writeln(sprintf('* %s with default config', $set));
+ }
+ }
+
+ $output->writeln('');
+ }
}
private function describeSet(OutputInterface $output, string $name): void
@@ -311,15 +349,17 @@ private function describeSet(OutputInterface $output, string $name): void
$ruleSetDefinitions = RuleSets::getSetDefinitions();
$fixers = $this->getFixers();
- $output->writeln(sprintf('Description of the %s set.', $ruleSetDefinitions[$name]->getName()));
+ $output->writeln(sprintf('Description of the `%s` set.>', $ruleSetDefinitions[$name]->getName()));
+ $output->writeln('');
+
$output->writeln($this->replaceRstLinks($ruleSetDefinitions[$name]->getDescription()));
+ $output->writeln('');
if ($ruleSetDefinitions[$name]->isRisky()) {
- $output->writeln('This set contains risky rules.');
+ $output->writeln('This set contains risky rules.');
+ $output->writeln('');
}
- $output->writeln('');
-
$help = '';
foreach ($ruleSetDefinitions[$name]->getRules() as $rule => $config) {
@@ -373,7 +413,7 @@ private function getFixers(): array
}
/**
- * @return string[]
+ * @return list
*/
private function getSetNames(): array
{
@@ -391,23 +431,25 @@ private function getSetNames(): array
*/
private function describeList(OutputInterface $output, string $type): void
{
- if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE) {
- $describe = [
- 'sets' => $this->getSetNames(),
- 'rules' => $this->getFixers(),
- ];
- } elseif ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
- $describe = 'set' === $type ? ['sets' => $this->getSetNames()] : ['rules' => $this->getFixers()];
- } else {
+ if ($output->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE) {
return;
}
- /** @var string[] $items */
- foreach ($describe as $list => $items) {
- $output->writeln(sprintf('Defined %s:', $list));
+ if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE || 'set' === $type) {
+ $output->writeln('Defined sets:');
+
+ $items = $this->getSetNames();
+ foreach ($items as $item) {
+ $output->writeln(sprintf('* %s', $item));
+ }
+ }
+
+ if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE || 'rule' === $type) {
+ $output->writeln('Defined rules:');
- foreach ($items as $name => $item) {
- $output->writeln(sprintf('* %s', \is_string($name) ? $name : $item));
+ $items = array_keys($this->getFixers());
+ foreach ($items as $item) {
+ $output->writeln(sprintf('* %s', $item));
}
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php
index 18c5c317b..e1adc9872 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php
@@ -16,7 +16,6 @@
use PhpCsFixer\Documentation\DocumentationLocator;
use PhpCsFixer\Documentation\FixerDocumentGenerator;
-use PhpCsFixer\Documentation\ListDocumentGenerator;
use PhpCsFixer\Documentation\RuleSetDocumentationGenerator;
use PhpCsFixer\FixerFactory;
use PhpCsFixer\RuleSet\RuleSets;
@@ -34,8 +33,17 @@
#[AsCommand(name: 'documentation')]
final class DocumentationCommand extends Command
{
+ /** @var string */
protected static $defaultName = 'documentation';
+ private Filesystem $filesystem;
+
+ public function __construct(Filesystem $filesystem)
+ {
+ parent::__construct();
+ $this->filesystem = $filesystem;
+ }
+
protected function configure(): void
{
$this
@@ -46,7 +54,6 @@ protected function configure(): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
- $filesystem = new Filesystem();
$locator = new DocumentationLocator();
$fixerFactory = new FixerFactory();
@@ -57,7 +64,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$fixerDocumentGenerator = new FixerDocumentGenerator($locator);
$ruleSetDocumentationGenerator = new RuleSetDocumentationGenerator($locator);
- $listDocumentGenerator = new ListDocumentGenerator($locator);
// Array of existing fixer docs.
// We first override existing files, and then we will delete files that are no longer needed.
@@ -67,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
foreach ($fixers as $fixer) {
$docForFixerRelativePaths[] = $locator->getFixerDocumentationFileRelativePath($fixer);
- $filesystem->dumpFile(
+ $this->filesystem->dumpFile(
$locator->getFixerDocumentationFilePath($fixer),
$fixerDocumentGenerator->generateFixerDocumentation($fixer)
);
@@ -79,12 +85,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
->in($locator->getFixersDocumentationDirectoryPath())
->notPath($docForFixerRelativePaths) as $file
) {
- $filesystem->remove($file->getPathname());
+ $this->filesystem->remove($file->getPathname());
}
// Fixer doc. index
- $filesystem->dumpFile(
+ $this->filesystem->dumpFile(
$locator->getFixersDocumentationIndexFilePath(),
$fixerDocumentGenerator->generateFixersDocumentationIndex($fixers)
);
@@ -93,31 +99,24 @@ protected function execute(InputInterface $input, OutputInterface $output): int
/** @var SplFileInfo $file */
foreach ((new Finder())->files()->in($locator->getRuleSetsDocumentationDirectoryPath()) as $file) {
- $filesystem->remove($file->getPathname());
+ $this->filesystem->remove($file->getPathname());
}
$paths = [];
foreach ($setDefinitions as $name => $definition) {
$path = $locator->getRuleSetsDocumentationFilePath($name);
- $paths[$name] = $path;
- $filesystem->dumpFile($path, $ruleSetDocumentationGenerator->generateRuleSetsDocumentation($definition, $fixers));
+ $paths[$path] = $definition;
+ $this->filesystem->dumpFile($path, $ruleSetDocumentationGenerator->generateRuleSetsDocumentation($definition, $fixers));
}
// RuleSet doc. index
- $filesystem->dumpFile(
+ $this->filesystem->dumpFile(
$locator->getRuleSetsDocumentationIndexFilePath(),
$ruleSetDocumentationGenerator->generateRuleSetsDocumentationIndex($paths)
);
- // List file / Appendix
-
- $filesystem->dumpFile(
- $locator->getListingFilePath(),
- $listDocumentGenerator->generateListingDocumentation($fixers)
- );
-
$output->writeln('Docs updated.');
return 0;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php
index 65c408fde..7db27641e 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php
@@ -17,6 +17,7 @@
use PhpCsFixer\Config;
use PhpCsFixer\ConfigInterface;
use PhpCsFixer\ConfigurationException\InvalidConfigurationException;
+use PhpCsFixer\Console\Application;
use PhpCsFixer\Console\ConfigurationResolver;
use PhpCsFixer\Console\Output\ErrorOutput;
use PhpCsFixer\Console\Output\OutputContext;
@@ -50,7 +51,10 @@
#[AsCommand(name: 'fix', description: 'Fixes a directory or a file.')]
/* final */ class FixCommand extends Command
{
+ /** @var string */
protected static $defaultName = 'fix';
+
+ /** @var string */
protected static $defaultDescription = 'Fixes a directory or a file.';
private EventDispatcherInterface $eventDispatcher;
@@ -157,8 +161,9 @@ public function getHelp(): string
* none: disables progress output;
* dots: multiline progress output with number of files and percentage on each line.
+ * bar: single line progress output with number of files and calculated percentage.
- If the option is not provided, it defaults to dots unless a config file that disables output is used, in which case it defaults to none. This option has no effect if the verbosity of the command is less than verbose.
+ If the option is not provided, it defaults to bar unless a config file that disables output is used, in which case it defaults to none. This option has no effect if the verbosity of the command is less than verbose.
$ php %command.full_name% --verbose --show-progress=dots
@@ -250,9 +255,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
: ('txt' === $reporter->getFormat() ? $output : null);
if (null !== $stdErr) {
- if (OutputInterface::VERBOSITY_VERBOSE <= $verbosity) {
- $stdErr->writeln($this->getApplication()->getLongVersion());
- }
+ $stdErr->writeln(Application::getAboutWithRuntime(true));
$configFile = $resolver->getConfigFile();
$stdErr->writeln(sprintf('Loaded config %s%s.', $resolver->getConfig()->getName(), null === $configFile ? '' : ' from "'.$configFile.'"'));
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php
index 6dace362d..192c735de 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php
@@ -32,6 +32,7 @@
#[AsCommand(name: 'help')]
final class HelpCommand extends BaseHelpCommand
{
+ /** @var string */
protected static $defaultName = 'help';
/**
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php
index 935491167..dcfabd093 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php
@@ -33,6 +33,7 @@
#[AsCommand(name: 'list-files')]
final class ListFilesCommand extends Command
{
+ /** @var string */
protected static $defaultName = 'list-files';
private ConfigInterface $defaultConfig;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php
index 4279c59ac..c1fe5f796 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php
@@ -36,6 +36,7 @@
#[AsCommand(name: 'list-sets')]
final class ListSetsCommand extends Command
{
+ /** @var string */
protected static $defaultName = 'list-sets';
protected function configure(): void
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php
index 5e4bddc9d..2be3adbcd 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php
@@ -14,6 +14,7 @@
namespace PhpCsFixer\Console\Command;
+use PhpCsFixer\Console\Application;
use PhpCsFixer\Console\SelfUpdate\NewVersionCheckerInterface;
use PhpCsFixer\PharCheckerInterface;
use PhpCsFixer\Preg;
@@ -36,6 +37,7 @@
#[AsCommand(name: 'self-update')]
final class SelfUpdateCommand extends Command
{
+ /** @var string */
protected static $defaultName = 'self-update';
private NewVersionCheckerInterface $versionChecker;
@@ -81,9 +83,9 @@ protected function configure(): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
- if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity() && $output instanceof ConsoleOutputInterface) {
+ if ($output instanceof ConsoleOutputInterface) {
$stdErr = $output->getErrorOutput();
- $stdErr->writeln($this->getApplication()->getLongVersion());
+ $stdErr->writeln(Application::getAboutWithRuntime(true));
}
if (!$this->toolInfo->isInstalledAsPhar()) {
@@ -134,7 +136,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$remoteTag = $latestVersionOfCurrentMajor;
}
- $localFilename = realpath($_SERVER['argv'][0]) ?: $_SERVER['argv'][0];
+ $localFilename = $_SERVER['argv'][0];
+ $realPath = realpath($localFilename);
+ if (false !== $realPath) {
+ $localFilename = $realPath;
+ }
if (!is_writable($localFilename)) {
$output->writeln(sprintf('No permission to update "%s" file.', $localFilename));
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php b/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php
index 5b2a398f8..2a8953714 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php
@@ -42,7 +42,6 @@
use PhpCsFixer\Utils;
use PhpCsFixer\WhitespacesFixerConfig;
use PhpCsFixer\WordMatcher;
-use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder as SymfonyFinder;
@@ -95,7 +94,7 @@ final class ConfigurationResolver
private $isDryRun;
/**
- * @var null|FixerInterface[]
+ * @var null|list
*/
private $fixers;
@@ -315,7 +314,7 @@ public function getDirectory(): DirectoryInterface
}
/**
- * @return FixerInterface[] An array of FixerInterface
+ * @return list
*/
public function getFixers(): array
{
@@ -356,7 +355,7 @@ public function getLinter(): LinterInterface
/**
* Returns path.
*
- * @return string[]
+ * @return list
*/
public function getPath(): array
{
@@ -402,18 +401,18 @@ static function (string $rawPath) use ($cwd, $filesystem): string {
public function getProgressType(): string
{
if (null === $this->progress) {
- if (OutputInterface::VERBOSITY_VERBOSE <= $this->options['verbosity'] && 'txt' === $this->getFormat()) {
+ if ('txt' === $this->getFormat()) {
$progressType = $this->options['show-progress'];
if (null === $progressType) {
$progressType = $this->getConfig()->getHideProgress()
? ProgressOutputType::NONE
- : ProgressOutputType::DOTS;
- } elseif (!\in_array($progressType, ProgressOutputType::AVAILABLE, true)) {
+ : ProgressOutputType::BAR;
+ } elseif (!\in_array($progressType, ProgressOutputType::all(), true)) {
throw new InvalidConfigurationException(sprintf(
'The progress type "%s" is not defined, supported are %s.',
$progressType,
- Utils::naturalLanguageJoin(ProgressOutputType::AVAILABLE)
+ Utils::naturalLanguageJoin(ProgressOutputType::all())
));
}
@@ -480,7 +479,7 @@ public function getUsingCache(): bool
}
}
- $this->usingCache = $this->usingCache && ($this->toolInfo->isInstalledAsPhar() || $this->toolInfo->isInstalledByComposer());
+ $this->usingCache = $this->usingCache && $this->isCachingAllowedForRuntime();
return $this->usingCache;
}
@@ -531,7 +530,7 @@ public function configFinderIsOverridden(): bool
/**
* Compute file candidates for config file.
*
- * @return string[]
+ * @return list
*/
private function computeConfigFiles(): array
{
@@ -555,7 +554,7 @@ private function computeConfigFiles(): array
$configDir = $path[0];
} else {
$dirName = pathinfo($path[0], PATHINFO_DIRNAME);
- $configDir = $dirName ?: $path[0];
+ $configDir = is_dir($dirName) ? $dirName : $path[0];
}
$candidates = [
@@ -631,7 +630,7 @@ private function iterableToTraversable(iterable $iterable): \Traversable
}
/**
- * @return array
+ * @return array
*/
private function parseRules(): array
{
@@ -674,7 +673,7 @@ private function parseRules(): array
}
/**
- * @param array $rules
+ * @param array $rules
*
* @throws InvalidConfigurationException
*/
@@ -833,10 +832,10 @@ private function resolveFinder(): iterable
$isIntersectionPathMode = self::PATH_MODE_INTERSECTION === $this->options['path-mode'];
- $paths = array_filter(array_map(
+ $paths = array_map(
static fn (string $path) => realpath($path),
$this->getPath()
- ));
+ );
if (0 === \count($paths)) {
if ($isIntersectionPathMode) {
@@ -950,4 +949,12 @@ private static function separatedContextLessInclude(string $path): ConfigInterfa
return $config;
}
+
+ private function isCachingAllowedForRuntime(): bool
+ {
+ return $this->toolInfo->isInstalledAsPhar()
+ || $this->toolInfo->isInstalledByComposer()
+ || $this->toolInfo->isRunInsideDocker()
+ || filter_var(getenv('PHP_CS_FIXER_ENFORCE_CACHE'), FILTER_VALIDATE_BOOL);
+ }
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php
index 5cb8adb3c..79bb57b73 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php
@@ -17,6 +17,7 @@
use PhpCsFixer\Differ\DiffConsoleFormatter;
use PhpCsFixer\Error\Error;
use PhpCsFixer\Linter\LintingException;
+use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Output\OutputInterface;
@@ -39,7 +40,7 @@ public function __construct(OutputInterface $output)
}
/**
- * @param Error[] $errors
+ * @param list $errors
*/
public function listErrors(string $process, array $errors): void
{
@@ -86,7 +87,7 @@ public function listErrors(string $process, array $errors): void
$this->output->writeln('');
$stackTrace = $e->getTrace();
foreach ($stackTrace as $trace) {
- if (isset($trace['class']) && \Symfony\Component\Console\Command\Command::class === $trace['class'] && 'run' === $trace['function']) {
+ if (isset($trace['class']) && Command::class === $trace['class'] && 'run' === $trace['function']) {
$this->output->writeln(' [ ... ]');
break;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php
index 4df85f819..0e47ae5f1 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php
@@ -65,7 +65,7 @@ public function __construct(OutputContext $context)
*/
public function __sleep(): array
{
- throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
+ throw new \BadMethodCallException('Cannot serialize '.self::class);
}
/**
@@ -76,7 +76,7 @@ public function __sleep(): array
*/
public function __wakeup(): void
{
- throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
+ throw new \BadMethodCallException('Cannot unserialize '.self::class);
}
public function onFixerFileProcessed(FixerFileProcessedEvent $event): void
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php
new file mode 100644
index 000000000..369bed1d4
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php
@@ -0,0 +1,76 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Console\Output\Progress;
+
+use PhpCsFixer\Console\Output\OutputContext;
+use PhpCsFixer\FixerFileProcessedEvent;
+use Symfony\Component\Console\Helper\ProgressBar;
+
+/**
+ * Output writer to show the progress of a FixCommand using progress bar (percentage).
+ *
+ * @internal
+ */
+final class PercentageBarOutput implements ProgressOutputInterface
+{
+ /** @readonly */
+ private OutputContext $context;
+
+ private ProgressBar $progressBar;
+
+ public function __construct(OutputContext $context)
+ {
+ $this->context = $context;
+
+ $this->progressBar = new ProgressBar($context->getOutput(), $this->context->getFilesCount());
+ $this->progressBar->setBarCharacter('▓'); // dark shade character \u2593
+ $this->progressBar->setEmptyBarCharacter('░'); // light shade character \u2591
+ $this->progressBar->setProgressCharacter('');
+ $this->progressBar->setFormat('normal');
+
+ $this->progressBar->start();
+ }
+
+ /**
+ * This class is not intended to be serialized,
+ * and cannot be deserialized (see __wakeup method).
+ */
+ public function __sleep(): array
+ {
+ throw new \BadMethodCallException('Cannot serialize '.self::class);
+ }
+
+ /**
+ * Disable the deserialization of the class to prevent attacker executing
+ * code by leveraging the __destruct method.
+ *
+ * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection
+ */
+ public function __wakeup(): void
+ {
+ throw new \BadMethodCallException('Cannot unserialize '.self::class);
+ }
+
+ public function onFixerFileProcessed(FixerFileProcessedEvent $event): void
+ {
+ $this->progressBar->advance(1);
+
+ if ($this->progressBar->getProgress() === $this->progressBar->getMaxSteps()) {
+ $this->context->getOutput()->write("\n\n");
+ }
+ }
+
+ public function printLegend(): void {}
+}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php
index 703170fd0..b1102e8fa 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php
@@ -21,6 +21,15 @@
*/
final class ProgressOutputFactory
{
+ /**
+ * @var array>
+ */
+ private static array $outputTypeMap = [
+ ProgressOutputType::NONE => NullOutput::class,
+ ProgressOutputType::DOTS => DotsOutput::class,
+ ProgressOutputType::BAR => PercentageBarOutput::class,
+ ];
+
public function create(string $outputType, OutputContext $context): ProgressOutputInterface
{
if (null === $context->getOutput()) {
@@ -36,16 +45,11 @@ public function create(string $outputType, OutputContext $context): ProgressOutp
);
}
- return ProgressOutputType::NONE === $outputType
- ? new NullOutput()
- : new DotsOutput($context);
+ return new self::$outputTypeMap[$outputType]($context);
}
private function isBuiltInType(string $outputType): bool
{
- return \in_array($outputType, [
- ProgressOutputType::NONE,
- ProgressOutputType::DOTS,
- ], true);
+ return \in_array($outputType, ProgressOutputType::all(), true);
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php
index 4c005f89d..6f427a46d 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php
@@ -21,9 +21,17 @@ final class ProgressOutputType
{
public const NONE = 'none';
public const DOTS = 'dots';
+ public const BAR = 'bar';
- public const AVAILABLE = [
- self::NONE,
- self::DOTS,
- ];
+ /**
+ * @return list
+ */
+ public static function all(): array
+ {
+ return [
+ self::BAR,
+ self::DOTS,
+ self::NONE,
+ ];
+ }
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php
index a6770f600..48daf7b2f 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php
@@ -14,6 +14,7 @@
namespace PhpCsFixer\Console\Report\FixReport;
+use PhpCsFixer\Console\Application;
use Symfony\Component\Console\Formatter\OutputFormatter;
/**
@@ -35,7 +36,10 @@ public function generate(ReportSummary $reportSummary): string
}
$dom = new \DOMDocument('1.0', 'UTF-8');
+
+ /** @var \DOMElement $checkstyles */
$checkstyles = $dom->appendChild($dom->createElement('checkstyle'));
+ $checkstyles->setAttribute('version', Application::getAbout());
foreach ($reportSummary->getChanged() as $filePath => $fixResult) {
/** @var \DOMElement $file */
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php
index 0e6c18813..23aad2e83 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php
@@ -14,7 +14,9 @@
namespace PhpCsFixer\Console\Report\FixReport;
+use PhpCsFixer\Console\Application;
use SebastianBergmann\Diff\Chunk;
+use SebastianBergmann\Diff\Diff;
use SebastianBergmann\Diff\Parser;
use Symfony\Component\Console\Formatter\OutputFormatter;
@@ -46,24 +48,20 @@ public function getFormat(): string
*/
public function generate(ReportSummary $reportSummary): string
{
+ $about = Application::getAbout();
+
$report = [];
foreach ($reportSummary->getChanged() as $fileName => $change) {
- $diffs = $this->diffParser->parse($change['diff']);
- $firstChunk = isset($diffs[0]) ? $diffs[0]->getChunks() : [];
- $firstChunk = array_shift($firstChunk);
foreach ($change['appliedFixers'] as $fixerName) {
$report[] = [
- 'check_name' => $fixerName,
- 'description' => $fixerName,
+ 'check_name' => 'PHP-CS-Fixer.'.$fixerName,
+ 'description' => 'PHP-CS-Fixer.'.$fixerName.' by '.$about,
'categories' => ['Style'],
'fingerprint' => md5($fileName.$fixerName),
'severity' => 'minor',
'location' => [
'path' => $fileName,
- 'lines' => [
- 'begin' => $firstChunk instanceof Chunk ? $firstChunk->getStart() : 0,
- 'end' => $firstChunk instanceof Chunk ? $firstChunk->getStartRange() : 0,
- ],
+ 'lines' => self::getLines($this->diffParser->parse($change['diff'])),
],
];
}
@@ -73,4 +71,24 @@ public function generate(ReportSummary $reportSummary): string
return $reportSummary->isDecoratedOutput() ? OutputFormatter::escape($jsonString) : $jsonString;
}
+
+ /**
+ * @param list $diffs
+ *
+ * @return array{begin: int, end: int}
+ */
+ private static function getLines(array $diffs): array
+ {
+ if (isset($diffs[0])) {
+ $firstDiff = $diffs[0];
+
+ $firstChunk = \Closure::bind(static fn (Diff $diff) => array_shift($diff->chunks), null, $firstDiff)($firstDiff);
+
+ if ($firstChunk instanceof Chunk) {
+ return \Closure::bind(static fn (Chunk $chunk): array => ['begin' => $chunk->start, 'end' => $chunk->startRange], null, $firstChunk)($firstChunk);
+ }
+ }
+
+ return ['begin' => 0, 'end' => 0];
+ }
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php
index 2bb5b95a6..0dc01dba4 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php
@@ -14,6 +14,7 @@
namespace PhpCsFixer\Console\Report\FixReport;
+use PhpCsFixer\Console\Application;
use Symfony\Component\Console\Formatter\OutputFormatter;
/**
@@ -47,11 +48,12 @@ public function generate(ReportSummary $reportSummary): string
}
$json = [
+ 'about' => Application::getAbout(),
'files' => $jsonFiles,
'time' => [
- 'total' => round($reportSummary->getTime() / 1000, 3),
+ 'total' => round($reportSummary->getTime() / 1_000, 3),
],
- 'memory' => round($reportSummary->getMemory() / 1024 / 1024, 3),
+ 'memory' => round($reportSummary->getMemory() / 1_024 / 1_024, 3),
];
$json = json_encode($json, JSON_THROW_ON_ERROR);
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php
index 631b28e97..0334bee60 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php
@@ -14,6 +14,7 @@
namespace PhpCsFixer\Console\Report\FixReport;
+use PhpCsFixer\Console\Application;
use PhpCsFixer\Preg;
use Symfony\Component\Console\Formatter\OutputFormatter;
@@ -42,6 +43,13 @@ public function generate(ReportSummary $reportSummary): string
$testsuite = $testsuites->appendChild($dom->createElement('testsuite'));
$testsuite->setAttribute('name', 'PHP CS Fixer');
+ $properties = $dom->createElement('properties');
+ $property = $dom->createElement('property');
+ $property->setAttribute('name', 'about');
+ $property->setAttribute('value', Application::getAbout());
+ $properties->appendChild($property);
+ $testsuite->appendChild($properties);
+
if (\count($reportSummary->getChanged()) > 0) {
$this->createFailedTestCases($dom, $testsuite, $reportSummary);
} else {
@@ -53,7 +61,7 @@ public function generate(ReportSummary $reportSummary): string
'time',
sprintf(
'%.3f',
- $reportSummary->getTime() / 1000
+ $reportSummary->getTime() / 1_000
)
);
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php
index e4efd9907..86855df25 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php
@@ -37,7 +37,7 @@ public function registerBuiltInReporters(): self
foreach (SymfonyFinder::create()->files()->name('*Reporter.php')->in(__DIR__) as $file) {
$relativeNamespace = $file->getRelativePath();
$builtInReporters[] = sprintf(
- '%s\\%s%s',
+ '%s\%s%s',
__NAMESPACE__,
'' !== $relativeNamespace ? $relativeNamespace.'\\' : '',
$file->getBasename('.php')
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php
index f53947427..31f11f359 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php
@@ -95,8 +95,8 @@ private function getFooter(int $time, int $identifiedFiles, int $files, int $mem
$identifiedFiles,
$files,
$isDryRun ? 'files that can be fixed' : 'files',
- $time / 1000,
- $memory / 1024 / 1024
+ $time / 1_000,
+ $memory / 1_024 / 1_024
);
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php
index 28236827b..595620705 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php
@@ -14,6 +14,7 @@
namespace PhpCsFixer\Console\Report\FixReport;
+use PhpCsFixer\Console\Application;
use Symfony\Component\Console\Formatter\OutputFormatter;
/**
@@ -39,6 +40,8 @@ public function generate(ReportSummary $reportSummary): string
$root = $dom->createElement('report');
$dom->appendChild($root);
+ $root->appendChild($this->createAboutElement($dom, Application::getAbout()));
+
$filesXML = $dom->createElement('files');
$root->appendChild($filesXML);
@@ -99,7 +102,7 @@ private function createDiffElement(\DOMDocument $dom, string $diff): \DOMElement
private function createTimeElement(float $time, \DOMDocument $dom): \DOMElement
{
- $time = round($time / 1000, 3);
+ $time = round($time / 1_000, 3);
$timeXML = $dom->createElement('time');
$timeXML->setAttribute('unit', 's');
@@ -112,7 +115,7 @@ private function createTimeElement(float $time, \DOMDocument $dom): \DOMElement
private function createMemoryElement(float $memory, \DOMDocument $dom): \DOMElement
{
- $memory = round($memory / 1024 / 1024, 3);
+ $memory = round($memory / 1_024 / 1_024, 3);
$memoryXML = $dom->createElement('memory');
$memoryXML->setAttribute('value', (string) $memory);
@@ -120,4 +123,12 @@ private function createMemoryElement(float $memory, \DOMDocument $dom): \DOMElem
return $memoryXML;
}
+
+ private function createAboutElement(\DOMDocument $dom, string $about): \DOMElement
+ {
+ $XML = $dom->createElement('about');
+ $XML->setAttribute('value', $about);
+
+ return $XML;
+ }
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php
index 956fb1312..ceebd89e3 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php
@@ -32,7 +32,7 @@ public function generate(ReportSummary $reportSummary): string
{
$sets = $reportSummary->getSets();
- usort($sets, static fn (RuleSetDescriptionInterface $a, RuleSetDescriptionInterface $b): int => strcmp($a->getName(), $b->getName()));
+ usort($sets, static fn (RuleSetDescriptionInterface $a, RuleSetDescriptionInterface $b): int => $a->getName() <=> $b->getName());
$json = ['sets' => []];
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php
index 45f2a26f2..0d0ae6da8 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php
@@ -39,7 +39,7 @@ public function registerBuiltInReporters(): self
foreach (SymfonyFinder::create()->files()->name('*Reporter.php')->in(__DIR__) as $file) {
$relativeNamespace = $file->getRelativePath();
$builtInReporters[] = sprintf(
- '%s\\%s%s',
+ '%s\%s%s',
__NAMESPACE__,
'' !== $relativeNamespace ? $relativeNamespace.'\\' : '',
$file->getBasename('.php')
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php
index 7804b93b2..9c851ef36 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php
@@ -32,7 +32,7 @@ public function generate(ReportSummary $reportSummary): string
{
$sets = $reportSummary->getSets();
- usort($sets, static fn (RuleSetDescriptionInterface $a, RuleSetDescriptionInterface $b): int => strcmp($a->getName(), $b->getName()));
+ usort($sets, static fn (RuleSetDescriptionInterface $a, RuleSetDescriptionInterface $b): int => $a->getName() <=> $b->getName());
$output = '';
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php b/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php
index e2268d7f6..10995cfbc 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php
@@ -19,12 +19,12 @@
*/
final class GithubClient implements GithubClientInterface
{
+ private string $url = 'https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/tags';
+
public function getTags(): array
{
- $url = 'https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/tags';
-
$result = @file_get_contents(
- $url,
+ $this->url,
false,
stream_context_create([
'http' => [
@@ -34,18 +34,29 @@ public function getTags(): array
);
if (false === $result) {
- throw new \RuntimeException(sprintf('Failed to load tags at "%s".', $url));
+ throw new \RuntimeException(sprintf('Failed to load tags at "%s".', $this->url));
}
+ /**
+ * @var list
+ */
$result = json_decode($result, true);
if (JSON_ERROR_NONE !== json_last_error()) {
throw new \RuntimeException(sprintf(
'Failed to read response from "%s" as JSON: %s.',
- $url,
+ $this->url,
json_last_error_msg()
));
}
- return $result;
+ return array_map(
+ static fn (array $tagData): string => $tagData['name'],
+ $result
+ );
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php b/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php
index 38178a22f..27728327f 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php
@@ -20,12 +20,7 @@
interface GithubClientInterface
{
/**
- * @return list
+ * @return list
*/
public function getTags(): array;
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php b/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php
index 06bd1229b..fc28677cf 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php
@@ -28,7 +28,7 @@ final class NewVersionChecker implements NewVersionCheckerInterface
private VersionParser $versionParser;
/**
- * @var null|string[]
+ * @var null|list
*/
private $availableVersions;
@@ -82,9 +82,7 @@ private function retrieveAvailableVersions(): void
return;
}
- foreach ($this->githubClient->getTags() as $tag) {
- $version = $tag['name'];
-
+ foreach ($this->githubClient->getTags() as $version) {
try {
$this->versionParser->normalize($version);
@@ -96,6 +94,9 @@ private function retrieveAvailableVersions(): void
}
}
- $this->availableVersions = Semver::rsort($this->availableVersions);
+ $versions = Semver::rsort($this->availableVersions);
+ \assert(array_is_list($versions)); // Semver::rsort provides soft `array` type, let's validate and ensure proper type for SCA
+
+ $this->availableVersions = $versions;
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php b/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php
index dac182b8f..a58a0bede 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php
@@ -27,7 +27,7 @@ final class WarningsDetector
private ToolInfoInterface $toolInfo;
/**
- * @var string[]
+ * @var list
*/
private array $warnings = [];
@@ -60,7 +60,7 @@ public function detectOldVendor(): void
}
/**
- * @return string[]
+ * @return list
*/
public function getWarnings(): array
{
@@ -68,9 +68,9 @@ public function getWarnings(): array
return [];
}
- return array_unique(array_merge(
+ return array_values(array_unique(array_merge(
$this->warnings,
- ['If you need help while solving warnings, ask at https://gitter.im/PHP-CS-Fixer, we will help you!']
- ));
+ ['If you need help while solving warnings, ask at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/, we will help you!']
+ )));
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php
index c4a0444c7..7c331a525 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php
@@ -29,7 +29,7 @@ final class Annotation
/**
* All the annotation tag names with types.
*
- * @var string[]
+ * @var list
*/
private static array $tags = [
'method',
@@ -46,7 +46,7 @@ final class Annotation
/**
* The lines that make up the annotation.
*
- * @var Line[]
+ * @var array
*/
private array $lines;
@@ -81,7 +81,7 @@ final class Annotation
/**
* The cached types.
*
- * @var null|string[]
+ * @var null|list
*/
private $types;
@@ -91,16 +91,16 @@ final class Annotation
private $namespace;
/**
- * @var NamespaceUseAnalysis[]
+ * @var list
*/
private array $namespaceUses;
/**
* Create a new line instance.
*
- * @param Line[] $lines
- * @param null|NamespaceAnalysis $namespace
- * @param NamespaceUseAnalysis[] $namespaceUses
+ * @param array $lines
+ * @param null|NamespaceAnalysis $namespace
+ * @param list $namespaceUses
*/
public function __construct(array $lines, $namespace = null, array $namespaceUses = [])
{
@@ -108,10 +108,8 @@ public function __construct(array $lines, $namespace = null, array $namespaceUse
$this->namespace = $namespace;
$this->namespaceUses = $namespaceUses;
- $keys = array_keys($lines);
-
- $this->start = $keys[0];
- $this->end = end($keys);
+ $this->start = array_key_first($lines);
+ $this->end = array_key_last($lines);
}
/**
@@ -125,7 +123,7 @@ public function __toString(): string
/**
* Get all the annotation tag names with types.
*
- * @return string[]
+ * @return list
*/
public static function getTagsWithTypes(): array
{
@@ -192,7 +190,7 @@ public function getVariableName()
/**
* Get the types associated with this annotation.
*
- * @return string[]
+ * @return list
*/
public function getTypes(): array
{
@@ -209,7 +207,7 @@ public function getTypes(): array
/**
* Set the types associated with this annotation.
*
- * @param string[] $types
+ * @param list $types
*/
public function setTypes(array $types): void
{
@@ -223,7 +221,7 @@ public function setTypes(array $types): void
/**
* Get the normalized types associated with this annotation, so they can easily be compared.
*
- * @return string[]
+ * @return list
*/
public function getNormalizedTypes(): array
{
@@ -290,7 +288,7 @@ private function getTypesContent(): ?string
}
$matchingResult = Preg::match(
- '{^(?:\s*\*|/\*\*)[\s\*]*@'.$name.'\s+'.TypeExpression::REGEX_TYPES.'(?:(?:[*\h\v]|\&?[\.\$]).*)?\r?$}is',
+ '{^(?:\h*\*|/\*\*)[\h*]*@'.$name.'\h+'.TypeExpression::REGEX_TYPES.'(?:(?:[*\h\v]|\&?[\.\$]).*)?\r?$}is',
$this->lines[0]->getContent(),
$matches
);
diff --git a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php
index 1e6fa5b94..9ef4a0874 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php
@@ -59,7 +59,7 @@ public function getContent(): string
*/
public function containsUsefulContent(): bool
{
- return Preg::match('/\\*\s*\S+/', $this->content) && '' !== trim(str_replace(['/', '*'], ' ', $this->content));
+ return Preg::match('/\*\s*\S+/', $this->content) && '' !== trim(str_replace(['/', '*'], ' ', $this->content));
}
/**
@@ -69,7 +69,7 @@ public function containsUsefulContent(): bool
*/
public function containsATag(): bool
{
- return Preg::match('/\\*\s*@/', $this->content);
+ return Preg::match('/\*\s*@/', $this->content);
}
/**
diff --git a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php
index 578fd3a76..c5a3a8963 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php
@@ -28,6 +28,8 @@ final class TagComparator
/**
* Groups of tags that should be allowed to immediately follow each other.
*
+ * @var list>
+ *
* @internal
*/
public const DEFAULT_GROUPS = [
@@ -40,7 +42,7 @@ final class TagComparator
/**
* Should the given tags be kept together, or kept apart?
*
- * @param string[][] $groups
+ * @param list> $groups
*/
public static function shouldBeTogether(Tag $first, Tag $second, array $groups = self::DEFAULT_GROUPS): bool
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php
index 505e0b3d3..4bb744647 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php
@@ -20,6 +20,8 @@
use PhpCsFixer\Utils;
/**
+ * @author Michael Vorisek
+ *
* @internal
*/
final class TypeExpression
@@ -44,6 +46,11 @@ final class TypeExpression
)*+
)';
+ /**
+ * Based on:
+ * - https://github.com/phpstan/phpdoc-parser/blob/1.26.0/doc/grammars/type.abnf fuzzing grammar
+ * - and https://github.com/phpstan/phpdoc-parser/blob/1.26.0/src/Parser/PhpDocParser.php parser impl.
+ */
private const REGEX_TYPE = '(?(?x) # single type
(?\??\h*)
(?:
@@ -51,20 +58,45 @@ final class TypeExpression
(?(?i)(?:array|list|object)(?-i)\h*\{\h*)
(?
(?
- (?(?:(?&constant)|(?&identifier))\h*\??\h*:\h*|)
+ (?(?:(?&constant)|(?&identifier)|(?&name))\h*\??\h*:\h*|)
(?(?&types_inner))
)
(?:
\h*,\h*
(?&array_shape_inner)
- )*
+ )*+
(?:\h*,\h*)?
|)
\h*\}
)
|
- (? # callable syntax, e.g. `callable(string, int...): bool`
- (?(?&name)\h*\(\h*)
+ (? # callable syntax, e.g. `callable(string, int...): bool`, `\Closure(T, int): T`
+ (?(?&name))
+ (?
+ (?\h*<\h*)
+ (?
+ (?
+ (?
+ (?&identifier)
+ )
+ (? # template bound
+ \h+(?i)(?of|as)(?-i)\h+
+ (?(?&types_inner))
+ |)
+ (? # template default
+ \h*=\h*
+ (?(?&types_inner))
+ |)
+ )
+ (?:
+ \h*,\h*
+ (?&callable_template_inner)
+ )*+
+ )
+ \h*>
+ (?=\h*\()
+ |)
+ (?\h*\(\h*)
(?
(?
(?(?&types_inner))
@@ -76,7 +108,7 @@ final class TypeExpression
(?:
\h*,\h*
(?&callable_argument)
- )*
+ )*+
(?:\h*,\h*)?
|)
\h*\)
@@ -93,7 +125,7 @@ final class TypeExpression
(?:
\h*,\h*
(?&types_inner)
- )*
+ )*+
(?:\h*,\h*)?
)
\h*>
@@ -115,8 +147,8 @@ final class TypeExpression
(?:\.(?&constant_digits)|(?<=\d)\.)?+
(?:e[+-]?(?&constant_digits))?+
)
- | \'(?:[^\'\\\\]|\\\\.)*+\'
- | "(?:[^"\\\\]|\\\\.)*+"
+ | \'(?:[^\'\\\]|\\\.)*+\'
+ | "(?:[^"\\\]|\\\.)*+"
(?-i)
)
|
@@ -127,7 +159,7 @@ final class TypeExpression
)
|
(? # full name, e.g.: `int`, `\DateTime`, `\Foo\Bar`, `positive-int`
- \\\\?+
+ \\\?+
(?'.self::REGEX_IDENTIFIER.')
(?:[\\\\\-](?&identifier))*+
)
@@ -164,13 +196,13 @@ final class TypeExpression
(\h*\[\h*\])*
)
(?:(?=1)0
- (?
+ (?(?>
(?&type)
(?:
\h*[|&]\h*
(?&type)
)*+
- )
+ ))
|)
)';
@@ -188,12 +220,12 @@ final class TypeExpression
private ?NamespaceAnalysis $namespace;
/**
- * @var NamespaceUseAnalysis[]
+ * @var list
*/
private array $namespaceUses;
/**
- * @param NamespaceUseAnalysis[] $namespaceUses
+ * @param list $namespaceUses
*/
public function __construct(string $value, ?NamespaceAnalysis $namespace, array $namespaceUses)
{
@@ -210,7 +242,7 @@ public function toString(): string
}
/**
- * @return string[]
+ * @return list
*/
public function getTypes(): array
{
@@ -239,7 +271,7 @@ public function getTypesGlue(): string
*/
public function walkTypes(\Closure $callback): void
{
- foreach ($this->innerTypeExpressions as [
+ foreach (array_reverse($this->innerTypeExpressions) as [
'start_index' => $startIndex,
'expression' => $inner,
]) {
@@ -375,8 +407,16 @@ private function parse(): void
$matches['generic_types'][0]
);
} elseif ('' !== ($matches['callable'][0] ?? '') && $matches['callable'][1] === $nullableLength) {
+ $this->parseCallableTemplateInnerTypes(
+ $index + \strlen($matches['callable_name'][0])
+ + \strlen($matches['callable_template_start'][0]),
+ $matches['callable_template_inners'][0]
+ );
+
$this->parseCallableArgumentTypes(
- $index + \strlen($matches['callable_start'][0]),
+ $index + \strlen($matches['callable_name'][0])
+ + \strlen($matches['callable_template'][0])
+ + \strlen($matches['callable_start'][0]),
$matches['callable_arguments'][0]
);
@@ -452,6 +492,49 @@ private function parseCommaSeparatedInnerTypes(int $startIndex, string $value):
}
}
+ private function parseCallableTemplateInnerTypes(int $startIndex, string $value): void
+ {
+ $index = 0;
+ while (\strlen($value) !== $index) {
+ Preg::match(
+ '{\G(?:(?=1)0'.self::REGEX_TYPES.'|(?<_callable_template_inner>(?&callable_template_inner))(?:\h*,\h*|$))}',
+ $value,
+ $prematches,
+ 0,
+ $index
+ );
+ $consumedValue = $prematches['_callable_template_inner'];
+ $consumedValueLength = \strlen($consumedValue);
+ $consumedCommaLength = \strlen($prematches[0]) - $consumedValueLength;
+
+ $addedPrefix = 'Closure<';
+ Preg::match(
+ '{^'.self::REGEX_TYPES.'$}',
+ $addedPrefix.$consumedValue.'>(): void',
+ $matches,
+ PREG_OFFSET_CAPTURE
+ );
+
+ if ('' !== $matches['callable_template_inner_b'][0]) {
+ $this->innerTypeExpressions[] = [
+ 'start_index' => $startIndex + $index + $matches['callable_template_inner_b_types'][1]
+ - \strlen($addedPrefix),
+ 'expression' => $this->inner($matches['callable_template_inner_b_types'][0]),
+ ];
+ }
+
+ if ('' !== $matches['callable_template_inner_d'][0]) {
+ $this->innerTypeExpressions[] = [
+ 'start_index' => $startIndex + $index + $matches['callable_template_inner_d_types'][1]
+ - \strlen($addedPrefix),
+ 'expression' => $this->inner($matches['callable_template_inner_d_types'][0]),
+ ];
+ }
+
+ $index += $consumedValueLength + $consumedCommaLength;
+ }
+ }
+
private function parseCallableArgumentTypes(int $startIndex, string $value): void
{
$index = 0;
@@ -508,7 +591,8 @@ private function parseArrayShapeInnerTypes(int $startIndex, string $value): void
);
$this->innerTypeExpressions[] = [
- 'start_index' => $startIndex + $index + $matches['array_shape_inner_value'][1] - \strlen($addedPrefix),
+ 'start_index' => $startIndex + $index + $matches['array_shape_inner_value'][1]
+ - \strlen($addedPrefix),
'expression' => $this->inner($matches['array_shape_inner_value'][0]),
];
@@ -594,7 +678,7 @@ private function normalize(string $type): string
}
/**
- * @return array
+ * @return array
*/
private function getAliases(): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php b/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php
index b451d00bf..ef1878ea2 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php
@@ -75,7 +75,7 @@ final class DocLexer
private int $peek = 0;
- private ?string $regex;
+ private ?string $regex = null;
public function setInput(string $input): void
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php b/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php
index 314df6b24..56cb83e47 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php
@@ -66,7 +66,7 @@ public function getPosition(): int
/**
* Returns whether the token type is one of the given types.
*
- * @param int|int[] $types
+ * @param int|list $types
*/
public function isType($types): bool
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php b/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php
index a388cf4c6..96f61e3ef 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php
@@ -14,7 +14,6 @@
namespace PhpCsFixer\Doctrine\Annotation;
-use PhpCsFixer\Doctrine\Annotation\Token as AnnotationToken;
use PhpCsFixer\Preg;
use PhpCsFixer\Tokenizer\Token as PhpToken;
@@ -28,7 +27,7 @@
final class Tokens extends \SplFixedArray
{
/**
- * @param string[] $ignoredTags
+ * @param list $ignoredTags
*
* @throws \InvalidArgumentException
*/
@@ -101,14 +100,14 @@ public static function createFromDocComment(PhpToken $input, array $ignoredTags
}
$lastTokenEndIndex = 0;
- foreach (\array_slice($scannedTokens, 0, $nbScannedTokensToUse) as $token) {
- if ($token->isType(DocLexer::T_STRING)) {
- $token = new AnnotationToken(
- $token->getType(),
- '"'.str_replace('"', '""', $token->getContent()).'"',
- $token->getPosition()
- );
- }
+ foreach (\array_slice($scannedTokens, 0, $nbScannedTokensToUse) as $scannedToken) {
+ $token = $scannedToken->isType(DocLexer::T_STRING)
+ ? new Token(
+ $scannedToken->getType(),
+ '"'.str_replace('"', '""', $scannedToken->getContent()).'"',
+ $scannedToken->getPosition()
+ )
+ : $scannedToken;
$missingTextLength = $token->getPosition() - $lastTokenEndIndex;
if ($missingTextLength > 0) {
@@ -139,8 +138,8 @@ public static function createFromDocComment(PhpToken $input, array $ignoredTags
/**
* Create token collection from array.
*
- * @param Token[] $array the array to import
- * @param ?bool $saveIndices save the numeric indices used in the original array, default is yes
+ * @param array $array the array to import
+ * @param ?bool $saveIndices save the numeric indices used in the original array, default is yes
*/
public static function fromArray($array, $saveIndices = null): self
{
@@ -247,7 +246,7 @@ public function insertAt(int $index, Token $token): void
public function offsetSet($index, $token): void
{
if (null === $token) {
- throw new \InvalidArgumentException('Token must be an instance of PhpCsFixer\\Doctrine\\Annotation\\Token, "null" given.');
+ throw new \InvalidArgumentException('Token must be an instance of PhpCsFixer\Doctrine\Annotation\Token, "null" given.');
}
if (!$token instanceof Token) {
@@ -257,7 +256,7 @@ public function offsetSet($index, $token): void
$type = \get_class($token);
}
- throw new \InvalidArgumentException(sprintf('Token must be an instance of PhpCsFixer\\Doctrine\\Annotation\\Token, "%s" given.', $type));
+ throw new \InvalidArgumentException(sprintf('Token must be an instance of PhpCsFixer\Doctrine\Annotation\Token, "%s" given.', $type));
}
parent::offsetSet($index, $token);
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php b/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php
index f384e48cd..3769c4fde 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php
@@ -43,7 +43,7 @@ public function getFixersDocumentationIndexFilePath(): string
public function getFixerDocumentationFilePath(FixerInterface $fixer): string
{
return $this->getFixersDocumentationDirectoryPath().'/'.Preg::replaceCallback(
- '/^.*\\\\(.+)\\\\(.+)Fixer$/',
+ '/^.*\\\(.+)\\\(.+)Fixer$/',
static fn (array $matches): string => Utils::camelCaseToUnderscore($matches[1]).'/'.Utils::camelCaseToUnderscore($matches[2]),
\get_class($fixer)
).'.rst';
@@ -73,11 +73,6 @@ public function getRuleSetsDocumentationFilePath(string $name): string
return $this->getRuleSetsDocumentationDirectoryPath().'/'.str_replace(':risky', 'Risky', ucfirst(substr($name, 1))).'.rst';
}
- public function getListingFilePath(): string
- {
- return $this->path.'/list.rst';
- }
-
public function getUsageFilePath(): string
{
return $this->path.'/usage.rst';
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php b/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php
index f5540d462..6fd40467c 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php
@@ -18,6 +18,7 @@
use PhpCsFixer\Differ\FullDiffer;
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
use PhpCsFixer\Fixer\DeprecatedFixerInterface;
+use PhpCsFixer\Fixer\ExperimentalFixerInterface;
use PhpCsFixer\Fixer\FixerInterface;
use PhpCsFixer\FixerConfiguration\AliasedFixerOption;
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
@@ -89,6 +90,19 @@ public function generateFixerDocumentation(FixerInterface $fixer): string
}
}
+ $experimentalDescription = '';
+
+ if ($fixer instanceof ExperimentalFixerInterface) {
+ $experimentalDescriptionRaw = RstUtils::toRst('Rule is not covered with backward compatibility promise, use it at your own risk. Rule\'s behaviour may be changed at any point, including rule\'s name; its options\' names, availability and allowed values; its default configuration. Rule may be even removed without prior notice. Feel free to provide feedback and help with determining final state of the rule.', 0);
+ $experimentalDescription = <<getRiskyDescription();
@@ -111,12 +125,16 @@ public function generateFixerDocumentation(FixerInterface $fixer): string
}
$warningsHeaderLine = str_repeat('-', \strlen($warningsHeader));
- $doc .= "\n\n".implode("\n", array_filter([
- $warningsHeader,
- $warningsHeaderLine,
- $deprecationDescription,
- $riskyDescription,
- ]));
+ $doc .= "\n\n".implode("\n", array_filter(
+ [
+ $warningsHeader,
+ $warningsHeaderLine,
+ $deprecationDescription,
+ $experimentalDescription,
+ $riskyDescription,
+ ],
+ static fn (string $text): bool => '' !== $text
+ ));
}
if ($fixer instanceof ConfigurableFixerInterface) {
@@ -203,15 +221,7 @@ public function generateFixerDocumentation(FixerInterface $fixer): string
}
}
- $ruleSetConfigs = [];
-
- foreach (RuleSets::getSetDefinitionNames() as $set) {
- $ruleSet = new RuleSet([$set => true]);
-
- if ($ruleSet->hasRule($name)) {
- $ruleSetConfigs[$set] = $ruleSet->getRuleConfiguration($name);
- }
- }
+ $ruleSetConfigs = self::getSetsOfRule($name);
if ([] !== $ruleSetConfigs) {
$plural = 1 !== \count($ruleSetConfigs) ? 's' : '';
@@ -243,21 +253,50 @@ public function generateFixerDocumentation(FixerInterface $fixer): string
$fileName = $reflectionObject->getFileName();
$fileName = str_replace('\\', '/', $fileName);
$fileName = substr($fileName, strrpos($fileName, '/src/Fixer/') + 1);
- $fileName = "`{$className} <./../{$fileName}>`_";
+ $fileName = "`{$className} <./../../../{$fileName}>`_";
+
+ $testFileName = Preg::replace('~.*\K/src/(?=Fixer/)~', '/tests/', $fileName);
+ $testFileName = Preg::replace('~PhpCsFixer\\\\\\\\\K(?=Fixer\\\\\\\)~', 'Tests\\\\\\\\', $testFileName);
+ $testFileName = Preg::replace('~(?= <|\.php>)~', 'Test', $testFileName);
$doc .= <<', $doc);
+
return "{$doc}\n";
}
/**
- * @param FixerInterface[] $fixers
+ * @internal
+ *
+ * @return array>
+ */
+ public static function getSetsOfRule(string $ruleName): array
+ {
+ $ruleSetConfigs = [];
+
+ foreach (RuleSets::getSetDefinitionNames() as $set) {
+ $ruleSet = new RuleSet([$set => true]);
+
+ if ($ruleSet->hasRule($ruleName)) {
+ $ruleSetConfigs[$set] = $ruleSet->getRuleConfiguration($ruleName);
+ }
+ }
+
+ return $ruleSetConfigs;
+ }
+
+ /**
+ * @param list $fixers
*/
public function generateFixersDocumentationIndex(array $fixers): string
{
@@ -267,7 +306,7 @@ public function generateFixersDocumentationIndex(array $fixers): string
'Phpdoc' => 'PHPDoc',
];
- usort($fixers, static fn (FixerInterface $a, FixerInterface $b): int => strcmp(\get_class($a), \get_class($b)));
+ usort($fixers, static fn (FixerInterface $a, FixerInterface $b): int => \get_class($a) <=> \get_class($b));
$documentation = <<<'RST'
=======================
@@ -278,7 +317,7 @@ public function generateFixersDocumentationIndex(array $fixers): string
$currentGroup = null;
foreach ($fixers as $fixer) {
- $namespace = Preg::replace('/^.*\\\\(.+)\\\\.+Fixer$/', '$1', \get_class($fixer));
+ $namespace = Preg::replace('/^.*\\\(.+)\\\.+Fixer$/', '$1', \get_class($fixer));
$group = $overrideGroups[$namespace] ?? Preg::replace('/(?<=[[:lower:]])(?=[[:upper:]])/', ' ', $namespace);
if ($group !== $currentGroup) {
@@ -296,6 +335,10 @@ public function generateFixersDocumentationIndex(array $fixers): string
$attributes[] = 'deprecated';
}
+ if ($fixer instanceof ExperimentalFixerInterface) {
+ $attributes[] = 'experimental';
+ }
+
if ($fixer->isRisky()) {
$attributes[] = 'risky';
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Documentation/ListDocumentGenerator.php b/vendor/friendsofphp/php-cs-fixer/src/Documentation/ListDocumentGenerator.php
deleted file mode 100644
index 51637ecb3..000000000
--- a/vendor/friendsofphp/php-cs-fixer/src/Documentation/ListDocumentGenerator.php
+++ /dev/null
@@ -1,170 +0,0 @@
-
- * Dariusz Rumiński
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
-
-namespace PhpCsFixer\Documentation;
-
-use PhpCsFixer\Console\Command\HelpCommand;
-use PhpCsFixer\Fixer\ConfigurableFixerInterface;
-use PhpCsFixer\Fixer\DeprecatedFixerInterface;
-use PhpCsFixer\Fixer\FixerInterface;
-use PhpCsFixer\FixerConfiguration\AliasedFixerOption;
-use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
-use PhpCsFixer\FixerConfiguration\DeprecatedFixerOptionInterface;
-use PhpCsFixer\RuleSet\RuleSet;
-use PhpCsFixer\RuleSet\RuleSets;
-use PhpCsFixer\Utils;
-
-/**
- * @internal
- */
-final class ListDocumentGenerator
-{
- private DocumentationLocator $locator;
-
- public function __construct(DocumentationLocator $locator)
- {
- $this->locator = $locator;
- }
-
- /**
- * @param FixerInterface[] $fixers
- */
- public function generateListingDocumentation(array $fixers): string
- {
- usort(
- $fixers,
- static fn (FixerInterface $fixer1, FixerInterface $fixer2): int => strnatcasecmp($fixer1->getName(), $fixer2->getName())
- );
-
- $documentation = <<<'RST'
- =======================
- List of Available Rules
- =======================
-
- RST;
- foreach ($fixers as $fixer) {
- $name = $fixer->getName();
- $definition = $fixer->getDefinition();
- $path = './rules/'.$this->locator->getFixerDocumentationFileRelativePath($fixer);
-
- $documentation .= "\n- `{$name} <{$path}>`_\n";
- $documentation .= "\n ".str_replace('`', '``', $definition->getSummary())."\n";
-
- $description = $definition->getDescription();
-
- if (null !== $description) {
- $documentation .= "\n ".RstUtils::toRst($description, 3)."\n";
- }
-
- if ($fixer instanceof DeprecatedFixerInterface) {
- $documentation .= "\n *warning deprecated*";
- $alternatives = $fixer->getSuccessorsNames();
-
- if (0 !== \count($alternatives)) {
- $documentation .= RstUtils::toRst(sprintf(
- ' Use %s instead.',
- Utils::naturalLanguageJoinWithBackticks($alternatives)
- ), 3);
- }
-
- $documentation .= "\n";
- }
-
- if ($fixer->isRisky()) {
- $documentation .= "\n *warning risky* ".RstUtils::toRst($definition->getRiskyDescription(), 3)."\n";
- }
-
- if ($fixer instanceof ConfigurableFixerInterface) {
- $documentation .= "\n Configuration options:\n";
- $configurationDefinition = $fixer->getConfigurationDefinition();
-
- foreach ($configurationDefinition->getOptions() as $option) {
- $documentation .= "\n - | ``{$option->getName()}``";
- $documentation .= "\n | ".RstUtils::ensureProperInlineCode($option->getDescription());
-
- if ($option instanceof DeprecatedFixerOptionInterface) {
- $deprecationMessage = RstUtils::toRst($option->getDeprecationMessage(), 3);
- $documentation .= "\n | warning:: This option is deprecated and will be removed in the next major version. {$deprecationMessage}";
- }
-
- if ($option instanceof AliasedFixerOption) {
- $documentation .= "\n | note:: The previous name of this option was ``{$option->getAlias()}`` but it is now deprecated and will be removed in the next major version.";
- }
-
- $allowed = HelpCommand::getDisplayableAllowedValues($option);
-
- if (null === $allowed) {
- $allowedKind = 'Allowed types';
- $allowed = array_map(
- static fn ($value): string => '``'.$value.'``',
- $option->getAllowedTypes(),
- );
- } else {
- $allowedKind = 'Allowed values';
- $allowed = array_map(static fn ($value): string => $value instanceof AllowedValueSubset
- ? 'a subset of ``'.Utils::toString($value->getAllowedValues()).'``'
- : '``'.Utils::toString($value).'``', $allowed);
- }
-
- $allowed = Utils::naturalLanguageJoin($allowed, '');
- $documentation .= "\n | {$allowedKind}: {$allowed}";
-
- if ($option->hasDefault()) {
- $default = Utils::toString($option->getDefault());
- $documentation .= "\n | Default value: ``{$default}``";
- } else {
- $documentation .= "\n | This option is required.";
- }
- }
-
- $documentation .= "\n\n";
- }
-
- $ruleSetConfigs = [];
-
- foreach (RuleSets::getSetDefinitionNames() as $set) {
- $ruleSet = new RuleSet([$set => true]);
-
- if ($ruleSet->hasRule($name)) {
- $ruleSetConfigs[$set] = $ruleSet->getRuleConfiguration($name);
- }
- }
-
- if ([] !== $ruleSetConfigs) {
- $plural = 1 !== \count($ruleSetConfigs) ? 's' : '';
-
- $documentation .= "\n Part of rule set{$plural} ";
-
- foreach ($ruleSetConfigs as $set => $config) {
- $ruleSetPath = $this->locator->getRuleSetsDocumentationFilePath($set);
- $ruleSetPath = substr($ruleSetPath, strrpos($ruleSetPath, '/'));
-
- $documentation .= "`{$set} <./ruleSets{$ruleSetPath}>`_ ";
- }
-
- $documentation = rtrim($documentation)."\n";
- }
-
- $reflectionObject = new \ReflectionObject($fixer);
- $className = str_replace('\\', '\\\\', $reflectionObject->getName());
- $fileName = $reflectionObject->getFileName();
- $fileName = str_replace('\\', '/', $fileName);
- $fileName = substr($fileName, strrpos($fileName, '/src/Fixer/') + 1);
- $fileName = "Source: `{$className} <./../{$fileName}>`_";
- $documentation .= "\n ".$fileName;
- }
-
- return $documentation."\n";
- }
-}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Documentation/RuleSetDocumentationGenerator.php b/vendor/friendsofphp/php-cs-fixer/src/Documentation/RuleSetDocumentationGenerator.php
index f74a1a93b..c87808c82 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Documentation/RuleSetDocumentationGenerator.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Documentation/RuleSetDocumentationGenerator.php
@@ -16,6 +16,7 @@
use PhpCsFixer\Fixer\FixerInterface;
use PhpCsFixer\Preg;
+use PhpCsFixer\RuleSet\DeprecatedRuleSetDescriptionInterface;
use PhpCsFixer\RuleSet\RuleSetDescriptionInterface;
use PhpCsFixer\Utils;
@@ -32,7 +33,7 @@ public function __construct(DocumentationLocator $locator)
}
/**
- * @param FixerInterface[] $fixers
+ * @param list $fixers
*/
public function generateRuleSetsDocumentation(RuleSetDescriptionInterface $definition, array $fixers): string
{
@@ -46,8 +47,52 @@ public function generateRuleSetsDocumentation(RuleSetDescriptionInterface $defin
$titleLine = str_repeat('=', \strlen($title));
$doc = "{$titleLine}\n{$title}\n{$titleLine}\n\n".$definition->getDescription();
+ $warnings = [];
+ if ($definition instanceof DeprecatedRuleSetDescriptionInterface) {
+ $deprecationDescription = <<<'RST'
+
+ This rule set is deprecated and will be removed in the next major version
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RST;
+ $alternatives = $definition->getSuccessorsNames();
+
+ if (0 !== \count($alternatives)) {
+ $deprecationDescription .= RstUtils::toRst(
+ sprintf(
+ "\n\nYou should use %s instead.",
+ Utils::naturalLanguageJoinWithBackticks($alternatives)
+ ),
+ 0
+ );
+ } else {
+ $deprecationDescription .= 'No replacement available.';
+ }
+
+ $warnings[] = $deprecationDescription;
+ }
+
if ($definition->isRisky()) {
- $doc .= ' This set contains rules that are risky.';
+ $warnings[] = <<<'RST'
+
+ This set contains rules that are risky
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Using this rule set may lead to changes in your code's logic and behaviour. Use it with caution and review changes before incorporating them into your code base.
+ RST;
+ }
+
+ if ([] !== $warnings) {
+ $warningsHeader = 1 === \count($warnings) ? 'Warning' : 'Warnings';
+
+ $warningsHeaderLine = str_repeat('-', \strlen($warningsHeader));
+ $doc .= "\n\n".implode(
+ "\n",
+ [
+ $warningsHeader,
+ $warningsHeaderLine,
+ ...$warnings,
+ ]
+ );
}
$rules = $definition->getRules();
@@ -96,7 +141,7 @@ public function generateRuleSetsDocumentation(RuleSetDescriptionInterface $defin
}
/**
- * @param array $setDefinitions
+ * @param array $setDefinitions
*/
public function generateRuleSetsDocumentationIndex(array $setDefinitions): string
{
@@ -105,9 +150,21 @@ public function generateRuleSetsDocumentationIndex(array $setDefinitions): strin
List of Available Rule sets
===========================
RST;
- foreach ($setDefinitions as $name => $path) {
+
+ foreach ($setDefinitions as $path => $definition) {
$path = substr($path, strrpos($path, '/'));
- $documentation .= "\n- `{$name} <.{$path}>`_";
+
+ $attributes = [];
+
+ if ($definition instanceof DeprecatedRuleSetDescriptionInterface) {
+ $attributes[] = 'deprecated';
+ }
+
+ $attributes = 0 === \count($attributes)
+ ? ''
+ : ' *('.implode(', ', $attributes).')*';
+
+ $documentation .= "\n- `{$definition->getName()} <.{$path}>`_{$attributes}";
}
return $documentation."\n";
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php b/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php
index 3d787a3f4..d1d9e0cfc 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php
@@ -24,14 +24,14 @@
final class ErrorsManager
{
/**
- * @var Error[]
+ * @var list
*/
private array $errors = [];
/**
* Returns errors reported during linting before fixing.
*
- * @return Error[]
+ * @return list
*/
public function getInvalidErrors(): array
{
@@ -41,7 +41,7 @@ public function getInvalidErrors(): array
/**
* Returns errors reported during fixing.
*
- * @return Error[]
+ * @return list
*/
public function getExceptionErrors(): array
{
@@ -51,7 +51,7 @@ public function getExceptionErrors(): array
/**
* Returns errors reported during linting after fixing.
*
- * @return Error[]
+ * @return list
*/
public function getLintErrors(): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php b/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php
new file mode 100644
index 000000000..003398e49
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php
@@ -0,0 +1,58 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+/**
+ * @author Dariusz Rumiński
+ *
+ * @internal
+ */
+final class ExecutorWithoutErrorHandler
+{
+ private function __construct() {}
+
+ /**
+ * @template T
+ *
+ * @param callable(): T $callback
+ *
+ * @return T
+ *
+ * @throws ExecutorWithoutErrorHandlerException
+ */
+ public static function execute(callable $callback)
+ {
+ /** @var ?string */
+ $error = null;
+
+ set_error_handler(static function (int $errorNumber, string $errorString, string $errorFile, int $errorLine) use (&$error): bool {
+ $error = $errorString;
+
+ return true;
+ });
+
+ try {
+ $result = $callback();
+ } finally {
+ restore_error_handler();
+ }
+
+ if (null !== $error) {
+ throw new ExecutorWithoutErrorHandlerException($error);
+ }
+
+ return $result;
+ }
+}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php b/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php
new file mode 100644
index 000000000..750352a26
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php
@@ -0,0 +1,22 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+/**
+ * @author Dariusz Rumiński
+ *
+ * @internal
+ */
+final class ExecutorWithoutErrorHandlerException extends \RuntimeException {}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php b/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php
index dce4d9246..148a4c5e1 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php
@@ -47,7 +47,7 @@ public function __destruct()
*/
public function __sleep(): array
{
- throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
+ throw new \BadMethodCallException('Cannot serialize '.self::class);
}
/**
@@ -58,7 +58,7 @@ public function __sleep(): array
*/
public function __wakeup(): void
{
- throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
+ throw new \BadMethodCallException('Cannot unserialize '.self::class);
}
/**
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php
index 9d90aba13..f322f4c5a 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php
@@ -18,6 +18,8 @@
use PhpCsFixer\DocBlock\DocBlock;
use PhpCsFixer\DocBlock\Line;
use PhpCsFixer\Indicator\PhpUnitTestCaseIndicator;
+use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer;
+use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer;
use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer;
use PhpCsFixer\Tokenizer\CT;
use PhpCsFixer\Tokenizer\Token;
@@ -28,7 +30,7 @@
*/
abstract class AbstractPhpUnitFixer extends AbstractFixer
{
- final public function isCandidate(Tokens $tokens): bool
+ public function isCandidate(Tokens $tokens): bool
{
return $tokens->isAllTokenKindsFound([T_CLASS, T_STRING]);
}
@@ -68,16 +70,22 @@ final protected function getDocBlockIndex(Tokens $tokens, int $index): int
}
/**
- * @param array $preventingAnnotations
+ * @param list $preventingAnnotations
+ * @param list $preventingAttributes
*/
- final protected function ensureIsDockBlockWithAnnotation(
+ final protected function ensureIsDocBlockWithAnnotation(
Tokens $tokens,
int $index,
string $annotation,
- array $preventingAnnotations
+ array $preventingAnnotations,
+ array $preventingAttributes
): void {
$docBlockIndex = $this->getDocBlockIndex($tokens, $index);
+ if (self::isPreventedByAttribute($tokens, $index, $preventingAttributes)) {
+ return;
+ }
+
if ($this->isPHPDoc($tokens, $docBlockIndex)) {
$this->updateDocBlockIfNeeded($tokens, $docBlockIndex, $annotation, $preventingAnnotations);
} else {
@@ -115,7 +123,7 @@ private function createDocBlock(Tokens $tokens, int $docBlockIndex, string $anno
}
/**
- * @param array $preventingAnnotations
+ * @param list $preventingAnnotations
*/
private function updateDocBlockIfNeeded(
Tokens $tokens,
@@ -137,7 +145,57 @@ private function updateDocBlockIfNeeded(
}
/**
- * @return array
+ * @param list $preventingAttributes
+ */
+ private static function isPreventedByAttribute(Tokens $tokens, int $index, array $preventingAttributes): bool
+ {
+ if ([] === $preventingAttributes) {
+ return false;
+ }
+
+ $attributeIndex = $tokens->getPrevMeaningfulToken($index);
+ if (!$tokens[$attributeIndex]->isGivenKind(CT::T_ATTRIBUTE_CLOSE)) {
+ return false;
+ }
+ $attributeIndex = $tokens->findBlockStart(Tokens::BLOCK_TYPE_ATTRIBUTE, $attributeIndex);
+
+ foreach (AttributeAnalyzer::collect($tokens, $attributeIndex) as $attributeAnalysis) {
+ foreach ($attributeAnalysis->getAttributes() as $attribute) {
+ if (\in_array(self::getFullyQualifiedName($tokens, $attribute['name']), $preventingAttributes, true)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private static function getFullyQualifiedName(Tokens $tokens, string $name): string
+ {
+ $name = strtolower($name);
+
+ $names = [];
+ foreach ((new NamespaceUsesAnalyzer())->getDeclarationsFromTokens($tokens) as $namespaceUseAnalysis) {
+ $names[strtolower($namespaceUseAnalysis->getShortName())] = strtolower($namespaceUseAnalysis->getFullName());
+ }
+
+ foreach ($names as $shortName => $fullName) {
+ if ($name === $shortName) {
+ return $fullName;
+ }
+
+ if (!str_starts_with($name, $shortName.'\\')) {
+ continue;
+ }
+
+ return $fullName.substr($name, \strlen($shortName));
+ }
+
+ return $name;
+ }
+
+ /**
+ * @return list
*/
private function addInternalAnnotation(DocBlock $docBlock, Tokens $tokens, int $docBlockIndex, string $annotation): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/BacktickToShellExecFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/BacktickToShellExecFixer.php
index 351cdad72..f2197705a 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/BacktickToShellExecFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/BacktickToShellExecFixer.php
@@ -53,7 +53,7 @@ public function getDefinition(): FixerDefinitionInterface
/**
* {@inheritdoc}
*
- * Must run before EscapeImplicitBackslashesFixer, ExplicitStringVariableFixer, NativeFunctionInvocationFixer, SingleQuoteFixer.
+ * Must run before EscapeImplicitBackslashesFixer, ExplicitStringVariableFixer, NativeFunctionInvocationFixer, SingleQuoteFixer, StringImplicitBackslashesFixer.
*/
public function getPriority(): int
{
@@ -95,9 +95,8 @@ private function fixBackticks(Tokens $tokens, array $backtickTokens): void
{
// Track indices for final override
ksort($backtickTokens);
- $openingBacktickIndex = key($backtickTokens);
- end($backtickTokens);
- $closingBacktickIndex = key($backtickTokens);
+ $openingBacktickIndex = array_key_first($backtickTokens);
+ $closingBacktickIndex = array_key_last($backtickTokens);
// Strip enclosing backticks
array_shift($backtickTokens);
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/EregToPregFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/EregToPregFixer.php
index c93662942..396658c38 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/EregToPregFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/EregToPregFixer.php
@@ -188,6 +188,6 @@ private function getBestDelimiter(string $pattern): string
return $a[0] <=> $b[0];
});
- return key($delimiters);
+ return array_key_first($delimiters);
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/MbStrFunctionsFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/MbStrFunctionsFixer.php
index 6dd62f498..1cbbd8742 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/MbStrFunctionsFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/MbStrFunctionsFixer.php
@@ -69,6 +69,16 @@ public function __construct()
{
parent::__construct();
+ if (\PHP_VERSION_ID >= 8_03_00) {
+ self::$functionsMap['str_pad'] = ['alternativeName' => 'mb_str_pad', 'argumentCount' => [1, 2, 3, 4]];
+ }
+
+ if (\PHP_VERSION_ID >= 8_04_00) {
+ self::$functionsMap['trim'] = ['alternativeName' => 'mb_trim', 'argumentCount' => [1, 2]];
+ self::$functionsMap['ltrim'] = ['alternativeName' => 'mb_ltrim', 'argumentCount' => [1, 2]];
+ self::$functionsMap['rtrim'] = ['alternativeName' => 'mb_rtrim', 'argumentCount' => [1, 2]];
+ }
+
$this->functions = array_filter(
self::$functionsMap,
static fn (array $mapping): bool => (new \ReflectionFunction($mapping['alternativeName']))->isInternal()
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasFunctionsFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasFunctionsFixer.php
index b56d0c405..2a3d231d0 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasFunctionsFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoAliasFunctionsFixer.php
@@ -156,7 +156,7 @@ final class NoAliasFunctionsFixer extends AbstractFixer implements ConfigurableF
];
/**
- * @var array|string> stores alias (key) - master (value) functions mapping
+ * @var array stores alias (key) - master (value) functions mapping
*/
private array $aliases = [];
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoMixedEchoPrintFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoMixedEchoPrintFixer.php
index ff5e666c7..e8b1af95c 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoMixedEchoPrintFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/NoMixedEchoPrintFixer.php
@@ -32,26 +32,15 @@
final class NoMixedEchoPrintFixer extends AbstractFixer implements ConfigurableFixerInterface
{
/**
- * @var string
+ * @var T_ECHO|T_PRINT
*/
- private $callBack;
-
- /**
- * @var int T_ECHO or T_PRINT
- */
- private $candidateTokenType;
+ private int $candidateTokenType;
public function configure(array $configuration): void
{
parent::configure($configuration);
- if ('echo' === $this->configuration['use']) {
- $this->candidateTokenType = T_PRINT;
- $this->callBack = 'fixPrintToEcho';
- } else {
- $this->candidateTokenType = T_ECHO;
- $this->callBack = 'fixEchoToPrint';
- }
+ $this->candidateTokenType = 'echo' === $this->configuration['use'] ? T_PRINT : T_ECHO;
}
public function getDefinition(): FixerDefinitionInterface
@@ -82,10 +71,13 @@ public function isCandidate(Tokens $tokens): bool
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
{
- $callBack = $this->callBack;
foreach ($tokens as $index => $token) {
if ($token->isGivenKind($this->candidateTokenType)) {
- $this->{$callBack}($tokens, $index);
+ if (T_PRINT === $this->candidateTokenType) {
+ $this->fixPrintToEcho($tokens, $index);
+ } else {
+ $this->fixEchoToPrint($tokens, $index);
+ }
}
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/PowToExponentiationFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/PowToExponentiationFixer.php
index a56385e68..84e680906 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/PowToExponentiationFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/PowToExponentiationFixer.php
@@ -97,7 +97,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
/**
- * @return array
+ * @return list
*/
private function findPowCalls(Tokens $tokens): array
{
@@ -205,7 +205,7 @@ private function isParenthesisNeeded(Tokens $tokens, int $argumentStartIndex, in
}
/**
- * @return int[]
+ * @return list
*/
private function getAllowedKinds(): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/SetTypeToCastFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/SetTypeToCastFixer.php
index 2c807eb52..2127e33dd 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/SetTypeToCastFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Alias/SetTypeToCastFixer.php
@@ -126,7 +126,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
// --- Test type ------------------------------
- $type = strtolower(trim($tokens[$secondArgumentStart]->getContent(), '"\'"'));
+ $type = strtolower(trim($tokens[$secondArgumentStart]->getContent(), '"\''));
if ('null' !== $type && !isset($map[$type])) {
continue; // we don't know how to map
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ArraySyntaxFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ArraySyntaxFixer.php
index a7b0b20f6..ea418f5e7 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ArraySyntaxFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/ArraySyntaxFixer.php
@@ -34,21 +34,15 @@
final class ArraySyntaxFixer extends AbstractFixer implements ConfigurableFixerInterface
{
/**
- * @var null|int
+ * @var CT::T_ARRAY_SQUARE_BRACE_OPEN|T_ARRAY
*/
private $candidateTokenKind;
- /**
- * @var null|string
- */
- private $fixCallback;
-
public function configure(array $configuration): void
{
parent::configure($configuration);
$this->resolveCandidateTokenKind();
- $this->resolveFixCallback();
}
public function getDefinition(): FixerDefinitionInterface
@@ -84,11 +78,13 @@ public function isCandidate(Tokens $tokens): bool
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
{
- $callback = $this->fixCallback;
-
for ($index = $tokens->count() - 1; 0 <= $index; --$index) {
if ($tokens[$index]->isGivenKind($this->candidateTokenKind)) {
- $this->{$callback}($tokens, $index);
+ if ('short' === $this->configuration['syntax']) {
+ $this->fixToShortArraySyntax($tokens, $index);
+ } else {
+ $this->fixToLongArraySyntax($tokens, $index);
+ }
}
}
}
@@ -124,11 +120,6 @@ private function fixToShortArraySyntax(Tokens $tokens, int $index): void
$tokens->clearTokenAndMergeSurroundingWhitespace($index);
}
- private function resolveFixCallback(): void
- {
- $this->fixCallback = sprintf('fixTo%sArraySyntax', ucfirst($this->configuration['syntax']));
- }
-
private function resolveCandidateTokenKind(): void
{
$this->candidateTokenKind = 'long' === $this->configuration['syntax'] ? CT::T_ARRAY_SQUARE_BRACE_OPEN : T_ARRAY;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php
index a9c7d0516..ed4ef90d6 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixer.php
@@ -83,7 +83,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
if (!$tokens[$i + 1]->isWhitespace()) {
$tokensToInsert[$i + 1] = new Token([T_WHITESPACE, ' ']);
} elseif (
- $this->configuration['ensure_single_space']
+ true === $this->configuration['ensure_single_space']
&& ' ' !== $tokens[$i + 1]->getContent()
&& Preg::match('/^\h+$/', $tokens[$i + 1]->getContent())
&& (!$tokens[$i + 2]->isComment() || Preg::match('/^\h+$/', $tokens[$i + 3]->getContent()))
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php
index 7df614fcd..021d1cd16 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ArrayNotation/YieldFromArrayToYieldsFixer.php
@@ -118,7 +118,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
/**
- * @return iterable>
+ * @return iterable
*/
private function getYieldsFromToUnpack(Tokens $tokens): iterable
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php
new file mode 100644
index 000000000..5382deb48
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/AttributeNotation/OrderedAttributesFixer.php
@@ -0,0 +1,310 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Fixer\AttributeNotation;
+
+use PhpCsFixer\AbstractFixer;
+use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException;
+use PhpCsFixer\Fixer\ConfigurableFixerInterface;
+use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
+use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
+use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
+use PhpCsFixer\FixerDefinition\FixerDefinition;
+use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
+use PhpCsFixer\FixerDefinition\VersionSpecification;
+use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample;
+use PhpCsFixer\Tokenizer\Analyzer\Analysis\AttributeAnalysis;
+use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceAnalysis;
+use PhpCsFixer\Tokenizer\Analyzer\Analysis\NamespaceUseAnalysis;
+use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer;
+use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer;
+use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer;
+use PhpCsFixer\Tokenizer\Token;
+use PhpCsFixer\Tokenizer\Tokens;
+use Symfony\Component\OptionsResolver\Options;
+
+/**
+ * @author HypeMC
+ *
+ * @phpstan-import-type _AttributeItems from AttributeAnalysis
+ */
+final class OrderedAttributesFixer extends AbstractFixer implements ConfigurableFixerInterface
+{
+ public const ORDER_ALPHA = 'alpha';
+ public const ORDER_CUSTOM = 'custom';
+
+ private const SUPPORTED_SORT_ALGORITHMS = [
+ self::ORDER_ALPHA,
+ self::ORDER_CUSTOM,
+ ];
+
+ public function getDefinition(): FixerDefinitionInterface
+ {
+ return new FixerDefinition(
+ 'Sorts attributes using the configured sort algorithm.',
+ [
+ new VersionSpecificCodeSample(
+ <<<'EOL'
+ self::ORDER_CUSTOM, 'order' => ['A\B\Qux', 'A\B\Bar', 'A\B\Corge']],
+ ),
+ ],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * Must run after FullyQualifiedStrictTypesFixer.
+ */
+ public function getPriority(): int
+ {
+ return 0;
+ }
+
+ public function isCandidate(Tokens $tokens): bool
+ {
+ return \defined('T_ATTRIBUTE') && $tokens->isTokenKindFound(T_ATTRIBUTE);
+ }
+
+ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface
+ {
+ $fixerName = $this->getName();
+
+ return new FixerConfigurationResolver([
+ (new FixerOptionBuilder('sort_algorithm', 'How the attributes should be sorted.'))
+ ->setAllowedValues(self::SUPPORTED_SORT_ALGORITHMS)
+ ->setDefault(self::ORDER_ALPHA)
+ ->setNormalizer(static function (Options $options, string $value) use ($fixerName): string {
+ if (self::ORDER_CUSTOM === $value && [] === $options['order']) {
+ throw new InvalidFixerConfigurationException(
+ $fixerName,
+ 'The custom order strategy requires providing `order` option with a list of attributes\'s FQNs.'
+ );
+ }
+
+ return $value;
+ })
+ ->getOption(),
+ (new FixerOptionBuilder('order', 'A list of FQCNs of attributes defining the desired order used when custom sorting algorithm is configured.'))
+ ->setAllowedTypes(['string[]'])
+ ->setDefault([])
+ ->setNormalizer(static function (Options $options, array $value) use ($fixerName): array {
+ if ($value !== array_unique($value)) {
+ throw new InvalidFixerConfigurationException($fixerName, 'The list includes attributes that are not unique.');
+ }
+
+ return array_flip(array_values(
+ array_map(static fn (string $attribute): string => ltrim($attribute, '\\'), $value),
+ ));
+ })
+ ->getOption(),
+ ]);
+ }
+
+ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
+ {
+ $index = 0;
+
+ while (null !== $index = $tokens->getNextTokenOfKind($index, [[T_ATTRIBUTE]])) {
+ /** @var list $elements */
+ $elements = array_map(function (AttributeAnalysis $attributeAnalysis) use ($tokens): array {
+ return [
+ 'name' => $this->sortAttributes($tokens, $attributeAnalysis->getStartIndex(), $attributeAnalysis->getAttributes()),
+ 'start' => $attributeAnalysis->getStartIndex(),
+ 'end' => $attributeAnalysis->getEndIndex(),
+ ];
+ }, AttributeAnalyzer::collect($tokens, $index));
+
+ $endIndex = end($elements)['end'];
+
+ try {
+ if (1 === \count($elements)) {
+ continue;
+ }
+
+ $sortedElements = $this->sortElements($elements);
+
+ if ($elements === $sortedElements) {
+ continue;
+ }
+
+ $this->sortTokens($tokens, $index, $endIndex, $sortedElements);
+ } finally {
+ $index = $endIndex;
+ }
+ }
+ }
+
+ /**
+ * @param _AttributeItems $attributes
+ */
+ private function sortAttributes(Tokens $tokens, int $index, array $attributes): string
+ {
+ if (1 === \count($attributes)) {
+ return $this->getAttributeName($tokens, $attributes[0]['name'], $attributes[0]['start']);
+ }
+
+ foreach ($attributes as &$attribute) {
+ $attribute['name'] = $this->getAttributeName($tokens, $attribute['name'], $attribute['start']);
+ }
+
+ $sortedElements = $this->sortElements($attributes);
+
+ if ($attributes === $sortedElements) {
+ return $attributes[0]['name'];
+ }
+
+ $this->sortTokens($tokens, $index + 1, end($attributes)['end'], $sortedElements, new Token(','));
+
+ return $sortedElements[0]['name'];
+ }
+
+ private function getAttributeName(Tokens $tokens, string $name, int $index): string
+ {
+ if (self::ORDER_CUSTOM === $this->configuration['sort_algorithm']) {
+ $name = $this->determineAttributeFullyQualifiedName($tokens, $name, $index);
+ }
+
+ return ltrim($name, '\\');
+ }
+
+ private function determineAttributeFullyQualifiedName(Tokens $tokens, string $name, int $index): string
+ {
+ if ('\\' === $name[0]) {
+ return $name;
+ }
+
+ if (!$tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR])) {
+ $index = $tokens->getNextTokenOfKind($index, [[T_STRING], [T_NS_SEPARATOR]]);
+ }
+
+ [$namespaceAnalysis, $namespaceUseAnalyses] = $this->collectNamespaceAnalysis($tokens, $index);
+ $namespace = $namespaceAnalysis->getFullName();
+ $firstTokenOfName = $tokens[$index]->getContent();
+ $namespaceUseAnalysis = $namespaceUseAnalyses[$firstTokenOfName] ?? false;
+
+ if ($namespaceUseAnalysis instanceof NamespaceUseAnalysis) {
+ $namespace = $namespaceUseAnalysis->getFullName();
+
+ if ($name === $firstTokenOfName) {
+ return $namespace;
+ }
+
+ $name = substr(strstr($name, '\\'), 1);
+ }
+
+ return $namespace.'\\'.$name;
+ }
+
+ /**
+ * @param list $elements
+ *
+ * @return list
+ */
+ private function sortElements(array $elements): array
+ {
+ usort($elements, function (array $a, array $b): int {
+ $sortAlgorithm = $this->configuration['sort_algorithm'];
+
+ if (self::ORDER_ALPHA === $sortAlgorithm) {
+ return $a['name'] <=> $b['name'];
+ }
+
+ if (self::ORDER_CUSTOM === $sortAlgorithm) {
+ return
+ ($this->configuration['order'][$a['name']] ?? PHP_INT_MAX)
+ <=>
+ ($this->configuration['order'][$b['name']] ?? PHP_INT_MAX);
+ }
+
+ throw new \InvalidArgumentException(sprintf('Invalid sort algorithm "%s" provided.', $sortAlgorithm));
+ });
+
+ return $elements;
+ }
+
+ /**
+ * @param list $elements
+ */
+ private function sortTokens(Tokens $tokens, int $startIndex, int $endIndex, array $elements, ?Token $delimiter = null): void
+ {
+ $replaceTokens = [];
+
+ foreach ($elements as $pos => $element) {
+ for ($i = $element['start']; $i <= $element['end']; ++$i) {
+ $replaceTokens[] = clone $tokens[$i];
+ }
+ if (null !== $delimiter && $pos !== \count($elements) - 1) {
+ $replaceTokens[] = clone $delimiter;
+ }
+ }
+
+ $tokens->overrideRange($startIndex, $endIndex, $replaceTokens);
+ }
+
+ /**
+ * @return array{NamespaceAnalysis, array}
+ */
+ private function collectNamespaceAnalysis(Tokens $tokens, int $startIndex): array
+ {
+ $namespaceAnalysis = (new NamespacesAnalyzer())->getNamespaceAt($tokens, $startIndex);
+ $namespaceUseAnalyses = (new NamespaceUsesAnalyzer())->getDeclarationsInNamespace($tokens, $namespaceAnalysis);
+
+ $uses = [];
+ foreach ($namespaceUseAnalyses as $use) {
+ if (!$use->isClass()) {
+ continue;
+ }
+
+ $uses[$use->getShortName()] = $use;
+ }
+
+ return [$namespaceAnalysis, $uses];
+ }
+}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php
index a5b3916be..19a57988a 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesFixer.php
@@ -51,9 +51,9 @@ final class BracesFixer extends AbstractProxyFixer implements ConfigurableFixerI
public const LINE_SAME = 'same';
/**
- * @var null|CurlyBracesPositionFixer
+ * @var null|BracesPositionFixer
*/
- private $curlyBracesPositionFixer;
+ private $bracesPositionFixer;
/**
* @var null|ControlStructureContinuationPositionFixer
@@ -152,11 +152,11 @@ public function getSuccessorsNames(): array
return array_keys($this->proxyFixers);
}
- public function configure(array $configuration = null): void
+ public function configure(array $configuration): void
{
parent::configure($configuration);
- $this->getCurlyBracesPositionFixer()->configure([
+ $this->getBracesPositionFixer()->configure([
'control_structures_opening_brace' => $this->translatePositionOption($this->configuration['position_after_control_structures']),
'functions_opening_brace' => $this->translatePositionOption($this->configuration['position_after_functions_and_oop_constructs']),
'anonymous_functions_opening_brace' => $this->translatePositionOption($this->configuration['position_after_anonymous_constructs']),
@@ -217,7 +217,7 @@ protected function createProxyFixers(): array
$singleSpaceAroundConstructFixer,
new ControlStructureBracesFixer(),
$noExtraBlankLinesFixer,
- $this->getCurlyBracesPositionFixer(),
+ $this->getBracesPositionFixer(),
$this->getControlStructureContinuationPositionFixer(),
new DeclareParenthesesFixer(),
new NoMultipleStatementsPerLineFixer(),
@@ -225,13 +225,13 @@ protected function createProxyFixers(): array
];
}
- private function getCurlyBracesPositionFixer(): CurlyBracesPositionFixer
+ private function getBracesPositionFixer(): BracesPositionFixer
{
- if (null === $this->curlyBracesPositionFixer) {
- $this->curlyBracesPositionFixer = new CurlyBracesPositionFixer();
+ if (null === $this->bracesPositionFixer) {
+ $this->bracesPositionFixer = new BracesPositionFixer();
}
- return $this->curlyBracesPositionFixer;
+ return $this->bracesPositionFixer;
}
private function getControlStructureContinuationPositionFixer(): ControlStructureContinuationPositionFixer
@@ -246,7 +246,7 @@ private function getControlStructureContinuationPositionFixer(): ControlStructur
private function translatePositionOption(string $option): string
{
return self::LINE_NEXT === $option
- ? CurlyBracesPositionFixer::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END
- : CurlyBracesPositionFixer::SAME_LINE;
+ ? BracesPositionFixer::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END
+ : BracesPositionFixer::SAME_LINE;
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php
index 4812308a8..710448a4d 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/BracesPositionFixer.php
@@ -165,7 +165,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
$openBraceIndex = $tokens->getNextTokenOfKind($index, ['{']);
if ($tokensAnalyzer->isAnonymousClass($index)) {
- $allowSingleLineIfEmpty = $this->configuration['allow_single_line_empty_anonymous_classes'];
+ $allowSingleLineIfEmpty = true === $this->configuration['allow_single_line_empty_anonymous_classes'];
$positionOption = 'anonymous_classes_opening_brace';
} else {
$positionOption = 'classes_opening_brace';
@@ -178,7 +178,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
if ($tokensAnalyzer->isLambda($index)) {
- $allowSingleLine = $this->configuration['allow_single_line_anonymous_functions'];
+ $allowSingleLine = true === $this->configuration['allow_single_line_anonymous_functions'];
$positionOption = 'anonymous_functions_opening_brace';
} else {
$positionOption = 'functions_opening_brace';
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php
index 610299b3f..2c8e08576 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NoTrailingCommaInSinglelineFixer.php
@@ -95,7 +95,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
private function shouldBeCleared(Tokens $tokens, int $openIndex): bool
{
- /** @var string[] $elements */
+ /** @var list $elements */
$elements = $this->configuration['elements'];
if ($tokens[$openIndex]->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) {
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php
index 318c9fa67..cb885d143 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NonPrintableCharacterFixer.php
@@ -34,12 +34,12 @@
final class NonPrintableCharacterFixer extends AbstractFixer implements ConfigurableFixerInterface
{
/**
- * @var array
+ * @var array
*/
private array $symbolsReplace;
/**
- * @var int[]
+ * @var list
*/
private static array $tokens = [
T_STRING_VARNAME,
@@ -116,7 +116,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
$content = $token->getContent();
if (
- $this->configuration['use_escape_sequences_in_strings']
+ true === $this->configuration['use_escape_sequences_in_strings']
&& $token->isGivenKind([T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE])
) {
if (!Preg::match('/'.implode('|', array_keys($escapeSequences)).'/', $content)) {
@@ -144,7 +144,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
if ($stringTypeChanged) {
- $content = Preg::replace('/(\\\\{1,2})/', '\\\\\\\\', $content);
+ $content = Preg::replace('/(\\\{1,2})/', '\\\\\\\\', $content);
$content = str_replace('$', '\$', $content);
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php
new file mode 100644
index 000000000..79d52e624
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/NumericLiteralSeparatorFixer.php
@@ -0,0 +1,217 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Fixer\Basic;
+
+use PhpCsFixer\AbstractFixer;
+use PhpCsFixer\Fixer\ConfigurableFixerInterface;
+use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
+use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
+use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
+use PhpCsFixer\FixerDefinition\CodeSample;
+use PhpCsFixer\FixerDefinition\FixerDefinition;
+use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
+use PhpCsFixer\Preg;
+use PhpCsFixer\Tokenizer\Token;
+use PhpCsFixer\Tokenizer\Tokens;
+
+/**
+ * Let's you add underscores to numeric literals.
+ *
+ * Inspired by:
+ * - {@link https://github.com/kubawerlos/php-cs-fixer-custom-fixers/blob/main/src/Fixer/NumericLiteralSeparatorFixer.php}
+ * - {@link https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/rules/numeric-separators-style.js}
+ *
+ * @author Marvin Heilemann
+ * @author Greg Korba
+ */
+final class NumericLiteralSeparatorFixer extends AbstractFixer implements ConfigurableFixerInterface
+{
+ public const STRATEGY_USE_SEPARATOR = 'use_separator';
+ public const STRATEGY_NO_SEPARATOR = 'no_separator';
+
+ public function getDefinition(): FixerDefinitionInterface
+ {
+ return new FixerDefinition(
+ 'Adds separators to numeric literals of any kind.',
+ [
+ new CodeSample(
+ <<<'PHP'
+ self::STRATEGY_NO_SEPARATOR],
+ ),
+ new CodeSample(
+ <<<'PHP'
+ self::STRATEGY_USE_SEPARATOR],
+ ),
+ new CodeSample(
+ " true]
+ ),
+ ]
+ );
+ }
+
+ public function isCandidate(Tokens $tokens): bool
+ {
+ return $tokens->isAnyTokenKindsFound([T_DNUMBER, T_LNUMBER]);
+ }
+
+ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface
+ {
+ return new FixerConfigurationResolver([
+ (new FixerOptionBuilder(
+ 'override_existing',
+ 'Whether literals already containing underscores should be reformatted.'
+ ))
+ ->setAllowedTypes(['bool'])
+ ->setDefault(false)
+ ->getOption(),
+ (new FixerOptionBuilder(
+ 'strategy',
+ 'Whether numeric literal should be separated by underscores or not.'
+ ))
+ ->setAllowedValues([self::STRATEGY_USE_SEPARATOR, self::STRATEGY_NO_SEPARATOR])
+ ->setDefault(self::STRATEGY_USE_SEPARATOR)
+ ->getOption(),
+ ]);
+ }
+
+ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
+ {
+ foreach ($tokens as $index => $token) {
+ if (!$token->isGivenKind([T_DNUMBER, T_LNUMBER])) {
+ continue;
+ }
+
+ $content = $token->getContent();
+
+ $newContent = $this->formatValue($content);
+
+ if ($content === $newContent) {
+ // Skip Token override if its the same content, like when it
+ // already got a valid literal separator structure.
+ continue;
+ }
+
+ $tokens[$index] = new Token([$token->getId(), $newContent]);
+ }
+ }
+
+ private function formatValue(string $value): string
+ {
+ if (self::STRATEGY_NO_SEPARATOR === $this->configuration['strategy']) {
+ return str_contains($value, '_') ? str_replace('_', '', $value) : $value;
+ }
+
+ if (true === $this->configuration['override_existing']) {
+ $value = str_replace('_', '', $value);
+ } elseif (str_contains($value, '_')) {
+ // Keep already underscored literals untouched.
+ return $value;
+ }
+
+ $lowerValue = strtolower($value);
+
+ if (str_starts_with($lowerValue, '0b')) {
+ // Binary
+ return $this->insertEveryRight($value, 8, 2);
+ }
+
+ if (str_starts_with($lowerValue, '0x')) {
+ // Hexadecimal
+ return $this->insertEveryRight($value, 2, 2);
+ }
+
+ if (str_starts_with($lowerValue, '0o')) {
+ // Octal
+ return $this->insertEveryRight($value, 3, 2);
+ }
+ if (str_starts_with($lowerValue, '0') && !str_contains($lowerValue, '.')) {
+ // Octal notation prior PHP 8.1 but still valid
+ return $this->insertEveryRight($value, 3, 1);
+ }
+
+ // All other types
+
+ /** If its a negative value we need an offset */
+ $negativeOffset = static fn ($v) => str_contains($v, '-') ? 1 : 0;
+
+ Preg::matchAll('/([0-9-_]+)?((\.)([0-9_]*))?((e)([0-9-_]+))?/i', $value, $result);
+
+ $integer = $result[1][0];
+ $joinedValue = $this->insertEveryRight($integer, 3, $negativeOffset($integer));
+
+ $dot = $result[3][0];
+ if ('' !== $dot) {
+ $integer = $result[4][0];
+ $decimal = $this->insertEveryLeft($integer, 3, $negativeOffset($integer));
+ $joinedValue = $joinedValue.$dot.$decimal;
+ }
+
+ $tim = $result[6][0];
+ if ('' !== $tim) {
+ $integer = $result[7][0];
+ $times = $this->insertEveryRight($integer, 3, $negativeOffset($integer));
+ $joinedValue = $joinedValue.$tim.$times;
+ }
+
+ return $joinedValue;
+ }
+
+ private function insertEveryRight(string $value, int $length, int $offset = 0): string
+ {
+ $position = $length * -1;
+ while ($position > -(\strlen($value) - $offset)) {
+ $value = substr_replace($value, '_', $position, 0);
+ $position -= $length + 1;
+ }
+
+ return $value;
+ }
+
+ private function insertEveryLeft(string $value, int $length, int $offset = 0): string
+ {
+ $position = $length;
+ while ($position < \strlen($value)) {
+ $value = substr_replace($value, '_', $position, $offset);
+ $position += $length + 1;
+ }
+
+ return $value;
+ }
+}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php
index 2f31f540f..db42b6971 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Basic/PsrAutoloadingFixer.php
@@ -127,7 +127,7 @@ public function supports(\SplFileInfo $file): bool
}
// ignore stubs/fixtures, since they typically contain invalid files for various reasons
- return !Preg::match('{[/\\\\](stub|fixture)s?[/\\\\]}i', $file->getRealPath());
+ return !Preg::match('{[/\\\](stub|fixture)s?[/\\\]}i', $file->getRealPath());
}
protected function createConfigurationDefinition(): FixerConfigurationResolverInterface
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ClassReferenceNameCasingFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ClassReferenceNameCasingFixer.php
index 83b0f979f..20b951d11 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ClassReferenceNameCasingFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ClassReferenceNameCasingFixer.php
@@ -84,6 +84,10 @@ private function getClassReference(Tokens $tokens, NamespaceAnalysis $namespace)
T_TRAIT,
];
+ if (\defined('T_NULLSAFE_OBJECT_OPERATOR')) { // @TODO: drop condition when PHP 8.0+ is required
+ $notBeforeKinds[] = T_NULLSAFE_OBJECT_OPERATOR;
+ }
+
if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required
$notBeforeKinds[] = T_ENUM;
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ConstantCaseFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ConstantCaseFixer.php
index 14501aaf4..ab3738f0a 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ConstantCaseFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/ConstantCaseFixer.php
@@ -88,9 +88,12 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
continue;
}
+ $nextIndex = $tokens->getNextMeaningfulToken($index);
+
if (
$this->isNeighbourAccepted($tokens, $tokens->getPrevMeaningfulToken($index))
- && $this->isNeighbourAccepted($tokens, $tokens->getNextMeaningfulToken($index))
+ && $this->isNeighbourAccepted($tokens, $nextIndex)
+ && !$tokens[$nextIndex]->equals('=')
&& !$this->isEnumCaseName($tokens, $index)
) {
$tokens[$index] = new Token([$token->getId(), $fixFunction($token->getContent())]);
@@ -106,7 +109,6 @@ private function isNeighbourAccepted(Tokens $tokens, int $index): bool
$forbiddenTokens = [
T_AS,
T_CLASS,
- T_CONST,
T_EXTENDS,
T_IMPLEMENTS,
T_INSTANCEOF,
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseKeywordsFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseKeywordsFixer.php
index 120e4cde9..f11b9988d 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseKeywordsFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseKeywordsFixer.php
@@ -29,7 +29,7 @@
final class LowercaseKeywordsFixer extends AbstractFixer
{
/**
- * @var int[]
+ * @var list
*/
private static array $excludedTokens = [T_HALT_COMPILER];
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseStaticReferenceFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseStaticReferenceFixer.php
index 325264b22..7615b296b 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseStaticReferenceFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/LowercaseStaticReferenceFixer.php
@@ -84,7 +84,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
$prevIndex = $tokens->getPrevMeaningfulToken($index);
- if ($tokens[$prevIndex]->isGivenKind([T_CONST, T_DOUBLE_COLON, T_FUNCTION, T_NAMESPACE, T_NS_SEPARATOR]) || $tokens[$prevIndex]->isObjectOperator()) {
+ if ($tokens[$prevIndex]->isGivenKind([T_CONST, T_DOUBLE_COLON, T_FUNCTION, T_NAMESPACE, T_NS_SEPARATOR, T_STATIC, T_STRING, CT::T_ARRAY_TYPEHINT, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE]) || $tokens[$prevIndex]->isObjectOperator()) {
continue;
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicConstantCasingFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicConstantCasingFixer.php
index f4902b777..b8de332eb 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicConstantCasingFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicConstantCasingFixer.php
@@ -77,7 +77,7 @@ private function getMagicConstants(): array
}
/**
- * @return array
+ * @return list
*/
private function getMagicConstantTokens(): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicMethodCasingFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicMethodCasingFixer.php
index 4a2039064..544d2cbb9 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicMethodCasingFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/MagicMethodCasingFixer.php
@@ -24,7 +24,7 @@
final class MagicMethodCasingFixer extends AbstractFixer
{
/**
- * @var array
+ * @var array
*/
private static array $magicNames = [
'__call' => '__call',
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeTypeDeclarationCasingFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeTypeDeclarationCasingFixer.php
index c0e8aa321..e46f10df1 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeTypeDeclarationCasingFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Casing/NativeTypeDeclarationCasingFixer.php
@@ -119,15 +119,15 @@ final class NativeTypeDeclarationCasingFixer extends AbstractFixer
private FunctionsAnalyzer $functionsAnalyzer;
/**
- * @var list>
+ * @var list
*/
- private array $propertyTypeModifiers;
+ private array $beforePropertyTypeTokens;
public function __construct()
{
parent::__construct();
- $this->propertyTypeModifiers = [[T_PRIVATE], [T_PROTECTED], [T_PUBLIC]];
+ $this->beforePropertyTypeTokens = ['{', ';', [T_PRIVATE], [T_PROTECTED], [T_PUBLIC], [T_VAR]];
$this->functionTypeHints = [
'array' => true,
@@ -152,7 +152,7 @@ public function __construct()
if (\PHP_VERSION_ID >= 8_01_00) {
$this->functionTypeHints['never'] = true;
- $this->propertyTypeModifiers[] = [T_READONLY];
+ $this->beforePropertyTypeTokens[] = [T_READONLY];
}
if (\PHP_VERSION_ID >= 8_02_00) {
@@ -296,7 +296,7 @@ private function getConstNameIndex(Tokens $tokens, int $index): int
private function getNativeTypeHintCandidatesForProperty(Tokens $tokens, int $index): iterable
{
$propertyNameIndex = $index;
- $index = $tokens->getPrevTokenOfKind($index, $this->propertyTypeModifiers);
+ $index = $tokens->getPrevTokenOfKind($index, $this->beforePropertyTypeTokens);
$index = $this->getFirstIndexOfType($tokens, $index);
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php
index aa0fe130e..a0c4f720c 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php
@@ -37,6 +37,14 @@
* Make sure there is one blank line above and below class elements.
*
* The exception is when an element is the first or last item in a 'classy'.
+ *
+ * @phpstan-type _Class array{
+ * index: int,
+ * open: int,
+ * close: int,
+ * elements: non-empty-list<_Element>
+ * }
+ * @phpstan-type _Element array{token: Token, type: string, index: int, start?: int, end?: int}
*/
final class ClassAttributesSeparationFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
{
@@ -239,12 +247,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
* Deals with comments, PHPDocs and spaces above the element with respect to the position of the
* element within the class, interface or trait.
*
- * @param array{
- * index: int,
- * open: int,
- * close: int,
- * elements: non-empty-list
- * } $class
+ * @param _Class $class
*/
private function fixSpaceAboveClassElement(Tokens $tokens, array $class, int $elementIndex): void
{
@@ -315,6 +318,9 @@ private function fixSpaceAboveClassElement(Tokens $tokens, array $class, int $el
$this->correctLineBreaks($tokens, $nonWhiteAbove, $element['start'], $this->determineRequiredLineCount($tokens, $class, $elementIndex));
}
+ /**
+ * @param _Class $class
+ */
private function determineRequiredLineCount(Tokens $tokens, array $class, int $elementIndex): int
{
$type = $class['elements'][$elementIndex]['type'];
@@ -350,12 +356,7 @@ private function determineRequiredLineCount(Tokens $tokens, array $class, int $e
}
/**
- * @param array{
- * index: int,
- * open: int,
- * close: int,
- * elements: non-empty-list
- * } $class
+ * @param _Class $class
*/
private function fixSpaceBelowClassElement(Tokens $tokens, array $class): void
{
@@ -458,12 +459,7 @@ private function findCommentBlockStart(Tokens $tokens, int $start, int $elementA
/**
* @TODO Introduce proper DTO instead of an array
*
- * @return \Generator
- * }>
+ * @return \Generator<_Class>
*/
private function getElementsByClass(Tokens $tokens): \Generator
{
@@ -509,6 +505,12 @@ private function getElementsByClass(Tokens $tokens): \Generator
}
}
+ /**
+ * including trailing single line comments if belonging to the class element.
+ *
+ * @param _Class $class
+ * @param _Element $element
+ */
private function getFirstTokenIndexOfClassElement(Tokens $tokens, array $class, array $element): int
{
$modifierTypes = [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_ABSTRACT, T_FINAL, T_STATIC, T_STRING, T_NS_SEPARATOR, T_VAR, CT::T_NULLABLE_TYPE, CT::T_ARRAY_TYPEHINT, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE];
@@ -532,7 +534,12 @@ private function getFirstTokenIndexOfClassElement(Tokens $tokens, array $class,
return $firstElementAttributeIndex;
}
- // including trailing single line comments if belonging to the class element
+ /**
+ * including trailing single line comments if belonging to the class element.
+ *
+ * @param _Class $class
+ * @param _Element $element
+ */
private function getLastTokenIndexOfClassElement(Tokens $tokens, array $class, array $element, TokensAnalyzer $tokensAnalyzer): int
{
// find last token of the element
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassDefinitionFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassDefinitionFixer.php
index 6be1745b1..1ca054e5d 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassDefinitionFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ClassDefinitionFixer.php
@@ -23,12 +23,16 @@
use PhpCsFixer\FixerDefinition\CodeSample;
use PhpCsFixer\FixerDefinition\FixerDefinition;
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
+use PhpCsFixer\Tokenizer\CT;
use PhpCsFixer\Tokenizer\Token;
use PhpCsFixer\Tokenizer\Tokens;
use PhpCsFixer\Tokenizer\TokensAnalyzer;
/**
* Fixer for part of the rules defined in PSR2 ¶4.1 Extends and Implements and PSR12 ¶8. Anonymous Classes.
+ *
+ * @phpstan-type _ClassExtendsInfo array{start: int, numberOfExtends: int, multiLine: bool}
+ * @phpstan-type _ClassImplementsInfo array{start: int, numberOfImplements: int, multiLine: bool}
*/
final class ClassDefinitionFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
{
@@ -189,7 +193,7 @@ private function fixClassyDefinition(Tokens $tokens, int $classyIndex): void
$end = $tokens->getPrevNonWhitespace($classDefInfo['open']);
}
- if ($classDefInfo['anonymousClass'] && !$this->configuration['inline_constructor_arguments']) {
+ if ($classDefInfo['anonymousClass'] && false === $this->configuration['inline_constructor_arguments']) {
if (!$tokens[$end]->equals(')')) { // anonymous class with `extends` and/or `implements`
$start = $tokens->getPrevMeaningfulToken($end);
$this->makeClassyDefinitionSingleLine($tokens, $start, $end);
@@ -207,6 +211,11 @@ private function fixClassyDefinition(Tokens $tokens, int $classyIndex): void
$this->sortClassModifiers($tokens, $classDefInfo);
}
+ /**
+ * @param _ClassExtendsInfo $classExtendsInfo
+ *
+ * @return _ClassExtendsInfo
+ */
private function fixClassyDefinitionExtends(Tokens $tokens, int $classOpenIndex, array $classExtendsInfo): array
{
$endIndex = $tokens->getPrevNonWhitespace($classOpenIndex);
@@ -225,6 +234,11 @@ private function fixClassyDefinitionExtends(Tokens $tokens, int $classOpenIndex,
return $classExtendsInfo;
}
+ /**
+ * @param _ClassImplementsInfo $classImplementsInfo
+ *
+ * @return _ClassImplementsInfo
+ */
private function fixClassyDefinitionImplements(Tokens $tokens, int $classOpenIndex, array $classImplementsInfo): array
{
$endIndex = $tokens->getPrevNonWhitespace($classOpenIndex);
@@ -243,6 +257,19 @@ private function fixClassyDefinitionImplements(Tokens $tokens, int $classOpenInd
return $classImplementsInfo;
}
+ /**
+ * @param array{
+ * start: int,
+ * classy: int,
+ * open: int,
+ * extends: false|_ClassExtendsInfo,
+ * implements: false|_ClassImplementsInfo,
+ * anonymousClass: bool,
+ * final: false|int,
+ * abstract: false|int,
+ * readonly: false|int,
+ * } $classDefInfo
+ */
private function fixClassyDefinitionOpenSpacing(Tokens $tokens, array $classDefInfo): int
{
if ($classDefInfo['anonymousClass']) {
@@ -281,8 +308,8 @@ private function fixClassyDefinitionOpenSpacing(Tokens $tokens, array $classDefI
* start: int,
* classy: int,
* open: int,
- * extends: false|array{start: int, numberOfExtends: int, multiLine: bool},
- * implements: false|array{start: int, numberOfImplements: int, multiLine: bool},
+ * extends: false|_ClassExtendsInfo,
+ * implements: false|_ClassImplementsInfo,
* anonymousClass: bool,
* final: false|int,
* abstract: false|int,
@@ -306,11 +333,11 @@ private function getClassyDefinitionInfo(Tokens $tokens, int $classyIndex): arra
if (!$tokens[$classyIndex]->isGivenKind(T_TRAIT)) {
$extends = $tokens->findGivenKind(T_EXTENDS, $classyIndex, $openIndex);
- $def['extends'] = [] !== $extends ? $this->getClassyInheritanceInfo($tokens, key($extends), 'numberOfExtends') : false;
+ $def['extends'] = [] !== $extends ? $this->getClassyInheritanceInfo($tokens, array_key_first($extends), 'numberOfExtends') : false;
if (!$tokens[$classyIndex]->isGivenKind(T_INTERFACE)) {
$implements = $tokens->findGivenKind(T_IMPLEMENTS, $classyIndex, $openIndex);
- $def['implements'] = [] !== $implements ? $this->getClassyInheritanceInfo($tokens, key($implements), 'numberOfImplements') : false;
+ $def['implements'] = [] !== $implements ? $this->getClassyInheritanceInfo($tokens, array_key_first($implements), 'numberOfImplements') : false;
$def['anonymousClass'] = $tokensAnalyzer->isAnonymousClass($classyIndex);
}
}
@@ -336,6 +363,9 @@ private function getClassyDefinitionInfo(Tokens $tokens, int $classyIndex): arra
return $def;
}
+ /**
+ * @return array|array{start: int, multiLine: bool}
+ */
private function getClassyInheritanceInfo(Tokens $tokens, int $startIndex, string $label): array
{
$implementsInfo = ['start' => $startIndex, $label => 1, 'multiLine' => false];
@@ -362,15 +392,37 @@ private function makeClassyDefinitionSingleLine(Tokens $tokens, int $startIndex,
{
for ($i = $endIndex; $i >= $startIndex; --$i) {
if ($tokens[$i]->isWhitespace()) {
- if ($tokens[$i - 1]->isComment() || $tokens[$i + 1]->isComment()) {
+ if (str_contains($tokens[$i]->getContent(), "\n")) {
+ if (\defined('T_ATTRIBUTE')) { // @TODO: drop condition and else when PHP 8.0+ is required
+ if ($tokens[$i - 1]->isGivenKind(CT::T_ATTRIBUTE_CLOSE) || $tokens[$i + 1]->isGivenKind(T_ATTRIBUTE)) {
+ continue;
+ }
+ } else {
+ if (($tokens[$i - 1]->isComment() && str_ends_with($tokens[$i - 1]->getContent(), ']'))
+ || ($tokens[$i + 1]->isComment() && str_starts_with($tokens[$i + 1]->getContent(), '#['))
+ ) {
+ continue;
+ }
+ }
+
+ if ($tokens[$i - 1]->isGivenKind(T_DOC_COMMENT) || $tokens[$i + 1]->isGivenKind(T_DOC_COMMENT)) {
+ continue;
+ }
+ }
+
+ if ($tokens[$i - 1]->isComment()) {
$content = $tokens[$i - 1]->getContent();
+ if (!str_starts_with($content, '//') && !str_starts_with($content, '#')) {
+ $tokens[$i] = new Token([T_WHITESPACE, ' ']);
+ }
- if (!('#' === $content || str_starts_with($content, '//'))) {
- $content = $tokens[$i + 1]->getContent();
+ continue;
+ }
- if (!('#' === $content || str_starts_with($content, '//'))) {
- $tokens[$i] = new Token([T_WHITESPACE, ' ']);
- }
+ if ($tokens[$i + 1]->isComment()) {
+ $content = $tokens[$i + 1]->getContent();
+ if (!str_starts_with($content, '//')) {
+ $tokens[$i] = new Token([T_WHITESPACE, ' ']);
}
continue;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalInternalClassFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalInternalClassFixer.php
index 4764dcbcb..cfd45f029 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalInternalClassFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/FinalInternalClassFixer.php
@@ -58,7 +58,7 @@ public function __construct()
{
parent::__construct();
- $this->checkAttributes = \PHP_VERSION_ID >= 80000;
+ $this->checkAttributes = \PHP_VERSION_ID >= 8_00_00;
}
public function configure(array $configuration): void
@@ -249,7 +249,7 @@ private function isClassCandidate(TokensAnalyzer $tokensAnalyzer, Tokens $tokens
}
return \in_array(true, $decisions, true)
- || ([] === $decisions && $this->configuration['consider_absent_docblock_as_internal_class']);
+ || ([] === $decisions && true === $this->configuration['consider_absent_docblock_as_internal_class']);
}
private function isClassCandidateBasedOnPhpDoc(Tokens $tokens, int $index): ?bool
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php
index be59a15ea..6547cc624 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php
@@ -290,7 +290,7 @@ private function fixInfiniteRecursion(Tokens $tokens, int $start, int $end): voi
* @param int $startIndex function/method start index
* @param int $bodyIndex function/method body index
*
- * @return array an array containing the sequence and case sensitiveness [ 0 => $seq, 1 => $case ]
+ * @return array{list>, array{3: false}}
*/
private function getWrapperMethodSequence(Tokens $tokens, string $method, int $startIndex, int $bodyIndex): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedClassElementsFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedClassElementsFixer.php
index 4337889c2..bd352d260 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedClassElementsFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedClassElementsFixer.php
@@ -25,9 +25,21 @@
use PhpCsFixer\Tokenizer\CT;
use PhpCsFixer\Tokenizer\Token;
use PhpCsFixer\Tokenizer\Tokens;
+use PhpCsFixer\Utils;
/**
* @author Gregor Harlan
+ *
+ * @phpstan-type _ClassElement array{
+ * start: int,
+ * visibility: string,
+ * abstract: bool,
+ * static: bool,
+ * readonly: bool,
+ * type: string,
+ * name: string,
+ * end: int,
+ * }
*/
final class OrderedClassElementsFixer extends AbstractFixer implements ConfigurableFixerInterface
{
@@ -103,10 +115,10 @@ public function configure(array $configuration): void
parent::configure($configuration);
$this->typePosition = [];
- $pos = 0;
+ $position = 0;
foreach ($this->configuration['order'] as $type) {
- $this->typePosition[$type] = $pos++;
+ $this->typePosition[$type] = $position++;
}
foreach (self::$typeHierarchy as $type => $parents) {
@@ -320,16 +332,7 @@ static function (array $values) use ($builtIns): bool {
}
/**
- * @return list
+ * @return list<_ClassElement>
*/
private function getElements(Tokens $tokens, int $startIndex): array
{
@@ -407,7 +410,7 @@ private function getElements(Tokens $tokens, int $startIndex): array
}
/**
- * @return array|string type or array of type and name
+ * @return list|string type or array of type and name
*/
private function detectElementType(Tokens $tokens, int $index)
{
@@ -475,17 +478,9 @@ private function findElementEnd(Tokens $tokens, int $index): int
}
/**
- * @return list
+ * @param list<_ClassElement> $elements
+ *
+ * @return list<_ClassElement>
*/
private function sortElements(array $elements): array
{
@@ -502,24 +497,22 @@ private function sortElements(array $elements): array
'doteardown' => 10,
];
- foreach ($elements as &$element) {
+ $getPositionType = function (array $element) use ($phpunitPositions): int {
$type = $element['type'];
if (\in_array($type, ['method', 'magic', 'phpunit'], true) && isset($this->typePosition["method:{$element['name']}"])) {
- $element['position'] = $this->typePosition["method:{$element['name']}"];
-
- continue;
+ return $this->typePosition["method:{$element['name']}"];
}
if (\array_key_exists($type, self::$specialTypes)) {
if (isset($this->typePosition[$type])) {
- $element['position'] = $this->typePosition[$type];
+ $position = $this->typePosition[$type];
if ('phpunit' === $type) {
- $element['position'] += $phpunitPositions[$element['name']];
+ $position += $phpunitPositions[$element['name']];
}
- continue;
+ return $position;
}
$type = 'method';
@@ -541,51 +534,34 @@ private function sortElements(array $elements): array
}
}
- $element['position'] = $this->typePosition[$type];
- }
-
- unset($element);
-
- usort($elements, function (array $a, array $b): int {
- if ($a['position'] === $b['position']) {
- return $this->sortGroupElements($a, $b);
- }
-
- return $a['position'] <=> $b['position'];
- });
-
- return $elements;
+ return $this->typePosition[$type];
+ };
+
+ return Utils::stableSort(
+ $elements,
+ /**
+ * @return array{element: _ClassElement, position: int}
+ */
+ static fn (array $element): array => ['element' => $element, 'position' => $getPositionType($element)],
+ /**
+ * @param array{element: _ClassElement, position: int} $a
+ * @param array{element: _ClassElement, position: int} $b
+ *
+ * @return -1|0|1
+ */
+ fn (array $a, array $b): int => ($a['position'] === $b['position']) ? $this->sortGroupElements($a['element'], $b['element']) : $a['position'] <=> $b['position'],
+ );
}
/**
- * @param array{
- * start: int,
- * visibility: string,
- * abstract: bool,
- * static: bool,
- * readonly: bool,
- * type: string,
- * name: string,
- * end: int,
- * position: int,
- * } $a
- * @param array{
- * start: int,
- * visibility: string,
- * abstract: bool,
- * static: bool,
- * readonly: bool,
- * type: string,
- * name: string,
- * end: int,
- * position: int,
- * } $b
+ * @param _ClassElement $a
+ * @param _ClassElement $b
*/
private function sortGroupElements(array $a, array $b): int
{
if (self::SORT_ALPHA === $this->configuration['sort_algorithm']) {
- return $this->configuration['case_sensitive']
- ? strcmp($a['name'], $b['name'])
+ return true === $this->configuration['case_sensitive']
+ ? $a['name'] <=> $b['name']
: strcasecmp($a['name'], $b['name']);
}
@@ -593,17 +569,7 @@ private function sortGroupElements(array $a, array $b): int
}
/**
- * @param list $elements
+ * @param list<_ClassElement> $elements
*/
private function sortTokens(Tokens $tokens, int $startIndex, int $endIndex, array $elements): void
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php
index 87647397f..e5179425b 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedInterfacesFixer.php
@@ -51,7 +51,7 @@ final class OrderedInterfacesFixer extends AbstractFixer implements Configurable
/**
* Array of supported directions in configuration.
*
- * @var string[]
+ * @var list
*/
private const SUPPORTED_DIRECTION_OPTIONS = [
self::DIRECTION_ASCEND,
@@ -61,7 +61,7 @@ final class OrderedInterfacesFixer extends AbstractFixer implements Configurable
/**
* Array of supported orders in configuration.
*
- * @var string[]
+ * @var list
*/
private const SUPPORTED_ORDER_OPTIONS = [
self::ORDER_ALPHA,
@@ -108,6 +108,16 @@ public function getDefinition(): FixerDefinitionInterface
);
}
+ /**
+ * {@inheritdoc}
+ *
+ * Must run after FullyQualifiedStrictTypesFixer.
+ */
+ public function getPriority(): int
+ {
+ return 0;
+ }
+
public function isCandidate(Tokens $tokens): bool
{
return $tokens->isTokenKindFound(T_IMPLEMENTS)
@@ -132,7 +142,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
$implementsStart = $index + 1;
- $implementsEnd = $tokens->getPrevNonWhitespace($tokens->getNextTokenOfKind($implementsStart, ['{']));
+ $implementsEnd = $tokens->getPrevMeaningfulToken($tokens->getNextTokenOfKind($implementsStart, ['{']));
$interfaces = $this->getInterfaces($tokens, $implementsStart, $implementsEnd);
@@ -141,7 +151,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
foreach ($interfaces as $interfaceIndex => $interface) {
- $interfaceTokens = Tokens::fromArray($interface, false);
+ $interfaceTokens = Tokens::fromArray($interface);
$normalized = '';
$actualInterfaceIndex = $interfaceTokens->getNextMeaningfulToken(-1);
@@ -167,8 +177,8 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
$score = self::ORDER_LENGTH === $this->configuration[self::OPTION_ORDER]
? \strlen($first['normalized']) - \strlen($second['normalized'])
: (
- $this->configuration['case_sensitive']
- ? strcmp($first['normalized'], $second['normalized'])
+ true === $this->configuration['case_sensitive']
+ ? $first['normalized'] <=> $second['normalized']
: strcasecmp($first['normalized'], $second['normalized'])
);
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php
index a46689b3d..417eb1269 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTraitsFixer.php
@@ -185,8 +185,8 @@ private function sort(Tokens $tokens, array $elements): void
$sortedElements = $elements;
uasort(
$sortedElements,
- fn (Tokens $useA, Tokens $useB): int => $this->configuration['case_sensitive']
- ? strcmp($toTraitName($useA), $toTraitName($useB))
+ fn (Tokens $useA, Tokens $useB): int => true === $this->configuration['case_sensitive']
+ ? $toTraitName($useA) <=> $toTraitName($useB)
: strcasecmp($toTraitName($useA), $toTraitName($useB))
);
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php
index f1fe0bae9..df89754a6 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/OrderedTypesFixer.php
@@ -74,7 +74,7 @@ public function bar(null|string|int $foo): string|int;
public function foo(\Stringable&\Countable $obj): int;
}
',
- new VersionSpecification(80100),
+ new VersionSpecification(8_01_00),
['null_adjustment' => 'always_last']
),
new VersionSpecificCodeSample(
@@ -84,7 +84,7 @@ interface Bar
public function bar(null|string|int $foo): string|int;
}
',
- new VersionSpecification(80000),
+ new VersionSpecification(8_00_00),
[
'sort_algorithm' => 'none',
'null_adjustment' => 'always_last',
@@ -304,11 +304,11 @@ private function isTypeSortable(TypeAnalysis $type): bool
}
/**
- * @return array{0: array, 1: string}
+ * @return array{0: list|string>, 1: string}
*/
private function collectDisjunctiveNormalFormTypes(string $type): array
{
- $types = array_map(static function ($subType) {
+ $types = array_map(static function (string $subType) {
if (str_starts_with($subType, '(')) {
return explode('&', trim($subType, '()'));
}
@@ -320,7 +320,7 @@ private function collectDisjunctiveNormalFormTypes(string $type): array
}
/**
- * @return array{0: string[], 1: string}
+ * @return array{0: list, 1: string}
*/
private function collectUnionOrIntersectionTypes(string $type): array
{
@@ -336,13 +336,13 @@ private function collectUnionOrIntersectionTypes(string $type): array
}
/**
- * @param array $types
+ * @param list|string> $types
*
- * @return array
+ * @return ($types is list ? list : list>)
*/
private function runTypesThroughSortingAlgorithm(array $types): array
{
- $normalizeType = static fn (string $type): string => Preg::replace('/^\\\\?/', '', $type);
+ $normalizeType = static fn (string $type): string => Preg::replace('/^\\\?/', '', $type);
usort($types, function ($a, $b) use ($normalizeType): int {
if (\is_array($a)) {
@@ -369,7 +369,7 @@ private function runTypesThroughSortingAlgorithm(array $types): array
}
if ('alpha' === $this->configuration['sort_algorithm']) {
- return $this->configuration['case_sensitive'] ? strcmp($a, $b) : strcasecmp($a, $b);
+ return true === $this->configuration['case_sensitive'] ? $a <=> $b : strcasecmp($a, $b);
}
return 0;
@@ -379,9 +379,9 @@ private function runTypesThroughSortingAlgorithm(array $types): array
}
/**
- * @param array $types
+ * @param list|string> $types
*
- * @return array
+ * @return list
*/
private function createTypeDeclarationTokens(array $types, string $glue, bool $isDisjunctive = false): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php
index 1ad573c99..7150b6bbd 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SelfAccessorFixer.php
@@ -184,7 +184,7 @@ private function getClassStart(Tokens $tokens, int $index, string $namespace): ?
{
$namespace = ('' !== $namespace ? '\\'.$namespace : '').'\\';
- foreach (array_reverse(Preg::split('/(\\\\)/', $namespace, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE)) as $piece) {
+ foreach (array_reverse(Preg::split('/(\\\)/', $namespace, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE)) as $piece) {
$index = $tokens->getPrevMeaningfulToken($index);
if ('\\' === $piece) {
if (!$tokens[$index]->isGivenKind(T_NS_SEPARATOR)) {
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php
index 2eed24643..927f31750 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php
@@ -195,7 +195,7 @@ private function expandElement(Tokens $tokens, string $type, int $startIndex, in
}
/**
- * @return Token[]
+ * @return list
*/
private function getModifiersSequences(Tokens $tokens, string $type, int $startIndex, int $endIndex): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleTraitInsertPerStatementFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleTraitInsertPerStatementFixer.php
index ec20f3cad..03eb845aa 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleTraitInsertPerStatementFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/SingleTraitInsertPerStatementFixer.php
@@ -70,7 +70,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
/**
- * @param int[] $candidates ',' indices to fix
+ * @param list $candidates ',' indices to fix
*/
private function fixTraitUse(Tokens $tokens, int $useTraitIndex, array $candidates): void
{
@@ -95,7 +95,7 @@ private function fixTraitUse(Tokens $tokens, int $useTraitIndex, array $candidat
}
/**
- * @return int[]
+ * @return list
*/
private function getCandidates(Tokens $tokens, int $index): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/CommentToPhpdocFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/CommentToPhpdocFixer.php
index 610260598..d443231fc 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/CommentToPhpdocFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/CommentToPhpdocFixer.php
@@ -35,7 +35,7 @@
final class CommentToPhpdocFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
{
/**
- * @var string[]
+ * @var list
*/
private array $ignoredTags = [];
@@ -52,7 +52,7 @@ public function isRisky(): bool
/**
* {@inheritdoc}
*
- * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToCommentFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer.
+ * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocArrayTypeFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocListTypeFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocParamOrderFixer, PhpdocReadonlyClassCommentToKeywordFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToCommentFixer, PhpdocToParamTypeFixer, PhpdocToPropertyTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer.
* Must run after AlignMultilineCommentFixer.
*/
public function getPriority(): int
@@ -124,7 +124,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
/**
- * @param int[] $indices
+ * @param list $indices
*/
private function isCommentCandidate(Tokens $tokens, array $indices): bool
{
@@ -134,7 +134,7 @@ function (bool $carry, int $index) use ($tokens): bool {
if ($carry) {
return true;
}
- if (!Preg::match('~(?:#|//|/\*+|\R(?:\s*\*)?)\s*\@([a-zA-Z0-9_\\\\-]+)(?=\s|\(|$)~', $tokens[$index]->getContent(), $matches)) {
+ if (!Preg::match('~(?:#|//|/\*+|\R(?:\s*\*)?)\s*\@([a-zA-Z0-9_\\\-]+)(?=\s|\(|$)~', $tokens[$index]->getContent(), $matches)) {
return false;
}
@@ -145,12 +145,12 @@ function (bool $carry, int $index) use ($tokens): bool {
}
/**
- * @param int[] $indices
+ * @param non-empty-list $indices
*/
private function fixComment(Tokens $tokens, array $indices): void
{
if (1 === \count($indices)) {
- $this->fixCommentSingleLine($tokens, reset($indices));
+ $this->fixCommentSingleLine($tokens, $indices[0]);
} else {
$this->fixCommentMultiLine($tokens, $indices);
}
@@ -172,11 +172,11 @@ private function fixCommentSingleLine(Tokens $tokens, int $index): void
}
/**
- * @param int[] $indices
+ * @param non-empty-list $indices
*/
private function fixCommentMultiLine(Tokens $tokens, array $indices): void
{
- $startIndex = reset($indices);
+ $startIndex = $indices[0];
$indent = Utils::calculateTrailingWhitespaceIndent($tokens[$startIndex - 1]);
$newContent = '/**'.$this->whitespacesConfig->getLineEnding();
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/HeaderCommentFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/HeaderCommentFixer.php
index e6da49d83..1915cf235 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/HeaderCommentFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/HeaderCommentFixer.php
@@ -112,7 +112,7 @@ public function getDefinition(): FixerDefinitionInterface
public function isCandidate(Tokens $tokens): bool
{
- return $tokens->isMonolithicPhp();
+ return $tokens->isMonolithicPhp() && !$tokens->isTokenKindFound(T_OPEN_TAG_WITH_ECHO);
}
/**
@@ -266,11 +266,7 @@ private function findHeaderCommentCurrentIndex(Tokens $tokens, int $headerNewInd
*/
private function findHeaderCommentInsertionIndex(Tokens $tokens, string $location): int
{
- $openTagIndex = $tokens[0]->isGivenKind(T_OPEN_TAG) ? 0 : $tokens->getNextTokenOfKind(0, [[T_OPEN_TAG]]);
-
- if (null === $openTagIndex) {
- return 1;
- }
+ $openTagIndex = $tokens[0]->isGivenKind(T_INLINE_HTML) ? 1 : 0;
if ('after_open' === $location) {
return $openTagIndex + 1;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/MultilineCommentOpeningClosingFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/MultilineCommentOpeningClosingFixer.php
index dc4b7dc33..055c701bb 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/MultilineCommentOpeningClosingFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/MultilineCommentOpeningClosingFixer.php
@@ -75,11 +75,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
// Fix opening
if ($token->isGivenKind(T_COMMENT)) {
- $newContent = Preg::replace('/^\\/\\*{2,}(?!\\/)/', '/*', $newContent);
+ $newContent = Preg::replace('/^\/\*{2,}(?!\/)/', '/*', $newContent);
}
// Fix closing
- $newContent = Preg::replace('/(?getId(), $newContent]);
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoEmptyCommentFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoEmptyCommentFixer.php
index c2d6c7442..23f0b1a3a 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoEmptyCommentFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/NoEmptyCommentFixer.php
@@ -60,7 +60,11 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
continue;
}
- [$blockStart, $index, $isEmpty] = $this->getCommentBlock($tokens, $index);
+ $blockInfo = $this->getCommentBlock($tokens, $index);
+ $blockStart = $blockInfo['blockStart'];
+ $index = $blockInfo['blockEnd'];
+ $isEmpty = $blockInfo['isEmpty'];
+
if (false === $isEmpty) {
continue;
}
@@ -75,6 +79,8 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
* Return the start index, end index and a flag stating if the comment block is empty.
*
* @param int $index T_COMMENT index
+ *
+ * @return array{blockStart: int, blockEnd: int, isEmpty: bool}
*/
private function getCommentBlock(Tokens $tokens, int $index): array
{
@@ -82,7 +88,11 @@ private function getCommentBlock(Tokens $tokens, int $index): array
$empty = $this->isEmptyComment($tokens[$index]->getContent());
if (self::TYPE_SLASH_ASTERISK === $commentType) {
- return [$index, $index, $empty];
+ return [
+ 'blockStart' => $index,
+ 'blockEnd' => $index,
+ 'isEmpty' => $empty,
+ ];
}
$start = $index;
@@ -107,7 +117,11 @@ private function getCommentBlock(Tokens $tokens, int $index): array
}
}
- return [$start, $index - 1, $empty];
+ return [
+ 'blockStart' => $start,
+ 'blockEnd' => $index - 1,
+ 'isEmpty' => $empty,
+ ];
}
private function getCommentType(string $content): int
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php
index aaf81ed90..f0b38658b 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php
@@ -119,7 +119,9 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
$content = $token->getContent();
- $commentContent = substr($content, 2, -2) ?: '';
+
+ /** @TODO PHP 8.0 - no more need for `?: ''` */
+ $commentContent = substr($content, 2, -2) ?: ''; // @phpstan-ignore-line
if ($this->hashEnabled && str_starts_with($content, '#')) {
if (isset($content[1]) && '[' === $content[1]) {
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopConditionFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopConditionFixer.php
index 6e3c81fca..0e48012bc 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopConditionFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/EmptyLoopConditionFixer.php
@@ -131,7 +131,7 @@ private static function clearNotCommentsInRange(Tokens $tokens, int $indexStart,
}
/**
- * @param Token[] $replacement
+ * @param list $replacement
*/
private static function cloneAndInsert(Tokens $tokens, int $index, array $replacement): void
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoBreakCommentFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoBreakCommentFixer.php
index b50a6c855..eca954278 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoBreakCommentFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoBreakCommentFixer.php
@@ -335,7 +335,7 @@ private function getStructureEnd(Tokens $tokens, int $position): int
}
/**
- * @return array
+ * @return list
*/
private static function getParenthesisedStructureKinds(): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededBracesFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededBracesFixer.php
index 281eca162..3d1e72bc4 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededBracesFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededBracesFixer.php
@@ -134,9 +134,17 @@ private function clearIfIsOverCompleteNamespaceBlock(Tokens $tokens): void
$index = $tokens->getNextTokenOfKind(0, [[T_NAMESPACE]]);
- do {
+ $namespaceIsNamed = false;
+
+ $index = $tokens->getNextMeaningfulToken($index);
+ while ($tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR])) {
$index = $tokens->getNextMeaningfulToken($index);
- } while ($tokens[$index]->isGivenKind([T_STRING, T_NS_SEPARATOR]));
+ $namespaceIsNamed = true;
+ }
+
+ if (!$namespaceIsNamed) {
+ return;
+ }
if (!$tokens[$index]->equals('{')) {
return; // `;`
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededControlParenthesesFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededControlParenthesesFixer.php
index b0156c27a..b924eed61 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededControlParenthesesFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/NoUnneededControlParenthesesFixer.php
@@ -36,7 +36,7 @@
final class NoUnneededControlParenthesesFixer extends AbstractFixer implements ConfigurableFixerInterface
{
/**
- * @var int[]
+ * @var list
*/
private const BLOCK_TYPES = [
Tokens::BLOCK_TYPE_ARRAY_INDEX_CURLY_BRACE,
@@ -102,7 +102,7 @@ final class NoUnneededControlParenthesesFixer extends AbstractFixer implements C
];
/**
- * @var list|string>
+ * @var list
*/
private array $noopTypes;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SimplifiedIfReturnFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SimplifiedIfReturnFixer.php
index 9710a9fda..a36337003 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SimplifiedIfReturnFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SimplifiedIfReturnFixer.php
@@ -27,7 +27,7 @@
final class SimplifiedIfReturnFixer extends AbstractFixer
{
/**
- * @var list|string>}>
+ * @var list}>
*/
private array $sequences = [
[
@@ -106,7 +106,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
continue;
}
- $firstSequenceIndex = key($sequenceFound);
+ $firstSequenceIndex = array_key_first($sequenceFound);
if ($firstSequenceIndex !== $firstCandidateIndex) {
continue;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchContinueToBreakFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchContinueToBreakFixer.php
index 23b523a8c..b42fc3a99 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchContinueToBreakFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/SwitchContinueToBreakFixer.php
@@ -25,7 +25,7 @@
final class SwitchContinueToBreakFixer extends AbstractFixer
{
/**
- * @var int[]
+ * @var list
*/
private array $switchLevels = [];
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php
index 19cfffe89..f5a5f8ffe 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/TrailingCommaInMultilineFixer.php
@@ -98,7 +98,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
->setAllowedTypes(['array'])
->setAllowedValues([new AllowedValueSubset([self::ELEMENTS_ARRAYS, self::ELEMENTS_ARGUMENTS, self::ELEMENTS_PARAMETERS, self::MATCH_EXPRESSIONS])])
->setDefault([self::ELEMENTS_ARRAYS])
- ->setNormalizer(static function (Options $options, $value) {
+ ->setNormalizer(static function (Options $options, array $value) {
if (\PHP_VERSION_ID < 8_00_00) { // @TODO: drop condition when PHP 8.0+ is required
foreach ([self::ELEMENTS_PARAMETERS, self::MATCH_EXPRESSIONS] as $option) {
if (\in_array($option, $value, true)) {
@@ -142,7 +142,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
$prevPrevIndex = $tokens->getPrevMeaningfulToken($prevIndex);
if ($fixArguments
- && $tokens[$prevIndex]->equalsAny([']', [T_CLASS], [T_STRING], [T_VARIABLE], [T_STATIC]])
+ && $tokens[$prevIndex]->equalsAny([']', [T_CLASS], [T_STRING], [T_VARIABLE], [T_STATIC], [T_ISSET], [T_UNSET], [T_LIST]])
&& !$tokens[$prevPrevIndex]->isGivenKind(T_FUNCTION)
) {
$this->fixBlock($tokens, $index);
@@ -153,7 +153,8 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
if (
$fixParameters
&& (
- $tokens[$prevIndex]->isGivenKind(T_STRING) && $tokens[$prevPrevIndex]->isGivenKind(T_FUNCTION)
+ $tokens[$prevIndex]->isGivenKind(T_STRING)
+ && $tokens[$prevPrevIndex]->isGivenKind(T_FUNCTION)
|| $tokens[$prevIndex]->isGivenKind([T_FN, T_FUNCTION])
)
) {
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/YodaStyleFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/YodaStyleFixer.php
index 0a2674652..c8005f1b4 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/YodaStyleFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/YodaStyleFixer.php
@@ -44,7 +44,7 @@ final class YodaStyleFixer extends AbstractFixer implements ConfigurableFixerInt
private $candidateTypesConfiguration;
/**
- * @var array
+ * @var list
*/
private $candidateTypes;
@@ -345,6 +345,9 @@ private function fixTokensComparePart(Tokens $tokens, int $start, int $end): Tok
return $newTokens;
}
+ /**
+ * @return null|array{left: array{start: int, end: int}, right: array{start: int, end: int}}
+ */
private function getCompareFixableInfo(Tokens $tokens, int $index, bool $yoda): ?array
{
$right = $this->getRightSideCompareFixableInfo($tokens, $index);
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/DeprecatedFixerInterface.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/DeprecatedFixerInterface.php
index 6d7d7e840..eded16148 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/DeprecatedFixerInterface.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/DeprecatedFixerInterface.php
@@ -22,7 +22,7 @@ interface DeprecatedFixerInterface extends FixerInterface
/**
* Returns names of fixers to use instead, if any.
*
- * @return string[]
+ * @return list
*/
public function getSuccessorsNames(): array;
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php
index 1359aef06..58ae532ba 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php
@@ -105,7 +105,7 @@ protected function fixAnnotations(Tokens $doctrineAnnotationTokens): void
}
/**
- * @return int[]
+ * @return array{int, int}
*/
private function getLineBracesCount(Tokens $tokens, int $index): array
{
@@ -157,7 +157,7 @@ private function isClosingLineWithMeaningfulContent(Tokens $tokens, int $index):
}
/**
- * @param array> $annotationPositions Pairs of begin and end indices of main annotations
+ * @param list $annotationPositions Pairs of begin and end indices of main annotations
*/
private function indentationCanBeFixed(Tokens $tokens, int $newLineTokenIndex, array $annotationPositions): bool
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/ExperimentalFixerInterface.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ExperimentalFixerInterface.php
new file mode 100644
index 000000000..9ade1875d
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/ExperimentalFixerInterface.php
@@ -0,0 +1,20 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Fixer;
+
+/**
+ * @internal
+ */
+interface ExperimentalFixerInterface extends FixerInterface {}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php
index 7a1809989..a96f73fe3 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php
@@ -67,7 +67,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
for ($index = $tokens->count() - 1; 0 <= $index; --$index) {
$dirnameInfo = $this->getDirnameInfo($tokens, $index);
- if (!$dirnameInfo) {
+ if (false === $dirnameInfo) {
continue;
}
@@ -105,7 +105,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
* @param int $index Index of `dirname`
* @param null|int $firstArgumentEndIndex Index of last token of first argument of `dirname` call
*
- * @return array{indices: list, secondArgument?: int, levels: int, end: int}|bool `false` when it is not a (supported) `dirname` call, an array with info about the dirname call otherwise
+ * @return array{indices: list, secondArgument?: int, levels: int, end: int}|false `false` when it is not a (supported) `dirname` call, an array with info about the dirname call otherwise
*/
private function getDirnameInfo(Tokens $tokens, int $index, ?int $firstArgumentEndIndex = null)
{
@@ -189,7 +189,7 @@ private function getDirnameInfo(Tokens $tokens, int $index, ?int $firstArgumentE
}
/**
- * @param array, secondArgument?: int, levels: int, end: int}> $dirnameInfoArray
+ * @param non-empty-list, secondArgument?: int, levels: int, end: int}> $dirnameInfoArray
*/
private function combineDirnames(Tokens $tokens, array $dirnameInfoArray): void
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php
index 5c72fcf2f..55ff455c8 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php
@@ -87,7 +87,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
$classNameIndex = $tokens->getPrevMeaningfulToken($index);
- if (!$tokens[$classNameIndex]->equalsAny([[T_STRING, 'DateTime'], [T_STRING, 'DateTimeImmutable']], false)) {
+ if (!$tokens[$classNameIndex]->equalsAny([[T_STRING, \DateTime::class], [T_STRING, \DateTimeImmutable::class]], false)) {
continue;
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagOrderFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagOrderFixer.php
index edf0bf6c5..3bf72e223 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagOrderFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/FopenFlagOrderFixer.php
@@ -85,9 +85,9 @@ protected function fixFopenFlagToken(Tokens $tokens, int $argumentStartIndex, in
}
/**
- * @param string[] $flags
+ * @param list $flags
*
- * @return string[]
+ * @return list
*/
private function sortFlags(array $flags): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ImplodeCallFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ImplodeCallFixer.php
index 49d728ef0..4561c393c 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ImplodeCallFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/ImplodeCallFixer.php
@@ -78,7 +78,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
$argumentsIndices = $this->getArgumentIndices($tokens, $index);
if (1 === \count($argumentsIndices)) {
- $firstArgumentIndex = key($argumentsIndices);
+ $firstArgumentIndex = array_key_first($argumentsIndices);
$tokens->insertAt($firstArgumentIndex, [
new Token([T_CONSTANT_ENCAPSED_STRING, "''"]),
new Token(','),
@@ -103,7 +103,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
// collect tokens from first argument
$firstArgumentEndIndex = $argumentsIndices[key($argumentsIndices)];
$newSecondArgumentTokens = [];
- for ($i = key($argumentsIndices); $i <= $firstArgumentEndIndex; ++$i) {
+ for ($i = array_key_first($argumentsIndices); $i <= $firstArgumentEndIndex; ++$i) {
$newSecondArgumentTokens[] = clone $tokens[$i];
$tokens->clearAt($i);
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php
index 48155ceca..e026637c5 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php
@@ -108,6 +108,8 @@ private function fixLambda(Tokens $tokens, int $lambdaUseIndex): void
}
/**
+ * @param array $imports
+ *
* @return array
*/
private function findNotUsedLambdaImports(Tokens $tokens, array $imports, int $lambdaUseCloseBraceIndex): array
@@ -234,6 +236,12 @@ private function findNotUsedLambdaImports(Tokens $tokens, array $imports, int $l
return $imports;
}
+ /**
+ * @param array $imports
+ * @param array $arguments
+ *
+ * @return array
+ */
private function countImportsUsedAsArgument(Tokens $tokens, array $imports, array $arguments): array
{
foreach ($arguments as $start => $end) {
@@ -277,6 +285,11 @@ private function getLambdaUseIndex(Tokens $tokens, int $index)
return $lambdaUseIndex;
}
+ /**
+ * @param array $arguments
+ *
+ * @return array
+ */
private function filterArguments(Tokens $tokens, array $arguments): array
{
$imports = [];
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php
index 5f47784e7..2b6e3f2c7 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php
@@ -301,7 +301,7 @@ private function ensureFunctionFullyMultiline(Tokens $tokens, int $startFunction
do {
$prevWhitespaceTokenIndex = $tokens->getPrevTokenOfKind(
$searchIndex,
- [[T_WHITESPACE]]
+ [[T_ENCAPSED_AND_WHITESPACE], [T_WHITESPACE]],
);
$searchIndex = $prevWhitespaceTokenIndex;
@@ -311,6 +311,8 @@ private function ensureFunctionFullyMultiline(Tokens $tokens, int $startFunction
if (null === $prevWhitespaceTokenIndex) {
$existingIndentation = '';
+ } elseif (!$tokens[$prevWhitespaceTokenIndex]->isGivenKind(T_WHITESPACE)) {
+ return;
} else {
$existingIndentation = $tokens[$prevWhitespaceTokenIndex]->getContent();
$lastLineIndex = strrpos($existingIndentation, "\n");
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php
index 06f9b6606..f726e4675 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php
@@ -385,17 +385,18 @@ private function getAllInternalFunctionsNormalized(): array
}
/**
- * @param string[] $functionNames
+ * @param list $functionNames
*
* @return array all function names lower cased
*/
private function normalizeFunctionNames(array $functionNames): array
{
- foreach ($functionNames as $index => $functionName) {
- $functionNames[strtolower($functionName)] = true;
- unset($functionNames[$index]);
+ $result = [];
+
+ foreach ($functionNames as $functionName) {
+ $result[strtolower($functionName)] = true;
}
- return $functionNames;
+ return $result;
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoSpacesAfterFunctionNameFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoSpacesAfterFunctionNameFixer.php
index 9549b45a8..a63e99141 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoSpacesAfterFunctionNameFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NoSpacesAfterFunctionNameFixer.php
@@ -33,7 +33,7 @@ public function getDefinition(): FixerDefinitionInterface
{
return new FixerDefinition(
'When making a method or function call, there MUST NOT be a space between the method or function name and the opening parenthesis.',
- [new CodeSample("isAnyTokenKindsFound(array_merge($this->getFunctionyTokenKinds(), [T_STRING]));
+ return $tokens->isAnyTokenKindsFound([T_STRING, ...$this->getFunctionyTokenKinds()]);
}
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
@@ -73,7 +73,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
$nextNonWhiteSpace = $tokens->getNextMeaningfulToken($endParenthesisIndex);
if (
null !== $nextNonWhiteSpace
- && $tokens[$nextNonWhiteSpace]->equals('?')
+ && !$tokens[$nextNonWhiteSpace]->equals(';')
&& $tokens[$lastTokenIndex]->isGivenKind($languageConstructionTokens)
) {
continue;
@@ -116,24 +116,22 @@ private function fixFunctionCall(Tokens $tokens, int $index): void
}
/**
- * @return array|string>
+ * @return list
*/
private function getBraceAfterVariableKinds(): array
{
- static $tokens = [
+ return [
')',
']',
[CT::T_DYNAMIC_VAR_BRACE_CLOSE],
[CT::T_ARRAY_INDEX_CURLY_BRACE_CLOSE],
];
-
- return $tokens;
}
/**
* Gets the token kinds which can work as function calls.
*
- * @return int[] Token names
+ * @return list Token names
*/
private function getFunctionyTokenKinds(): array
{
@@ -160,7 +158,7 @@ private function getFunctionyTokenKinds(): array
/**
* Gets the token kinds of actually language construction.
*
- * @return int[]
+ * @return list
*/
private function getLanguageConstructionTokenKinds(): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php
index a8cec92c2..efebad874 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php
@@ -92,6 +92,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
(new FixerOptionBuilder('use_nullable_type_declaration', 'Whether to add or remove `?` or `|null` to parameters with a default `null` value.'))
->setAllowedTypes(['bool'])
->setDefault(true)
+ ->setDeprecationMessage('Behaviour will follow default one.') // @TODO remove the option on next major 4.0
->getOption(),
]);
}
@@ -114,7 +115,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
/**
- * @param ArgumentAnalysis[] $arguments
+ * @param array $arguments
*/
private function fixFunctionParameters(Tokens $tokens, array $arguments): void
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php
index 2ab134303..603051f2b 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php
@@ -16,6 +16,7 @@
use PhpCsFixer\AbstractPhpdocToTypeDeclarationFixer;
use PhpCsFixer\DocBlock\Annotation;
+use PhpCsFixer\Fixer\ExperimentalFixerInterface;
use PhpCsFixer\FixerDefinition\CodeSample;
use PhpCsFixer\FixerDefinition\FixerDefinition;
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
@@ -25,12 +26,12 @@
/**
* @author Jan Gantzert
*/
-final class PhpdocToParamTypeFixer extends AbstractPhpdocToTypeDeclarationFixer
+final class PhpdocToParamTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ExperimentalFixerInterface
{
private const TYPE_CHECK_TEMPLATE = '
*/
private const EXCLUDE_FUNC_NAMES = [
[T_STRING, '__clone'],
@@ -49,7 +50,7 @@ final class PhpdocToParamTypeFixer extends AbstractPhpdocToTypeDeclarationFixer
public function getDefinition(): FixerDefinitionInterface
{
return new FixerDefinition(
- 'EXPERIMENTAL: Takes `@param` annotations of non-mixed types and adjusts accordingly the function signature. Requires PHP >= 7.0.',
+ 'Takes `@param` annotations of non-mixed types and adjusts accordingly the function signature. Requires PHP >= 7.0.',
[
new CodeSample(
' false]
),
+ new CodeSample(
+ ' false]
+ ),
],
null,
- 'This rule is EXPERIMENTAL and [1] is not covered with backward compatibility promise. [2] `@param` annotation is mandatory for the fixer to make changes, signatures of methods without it (no docblock, inheritdocs) will not be fixed. [3] Manual actions are required if inherited signatures are not properly documented.'
+ 'The `@param` annotation is mandatory for the fixer to make changes, signatures of methods without it (no docblock, inheritdocs) will not be fixed. Manual actions are required if inherited signatures are not properly documented.'
);
}
public function isCandidate(Tokens $tokens): bool
{
- return $tokens->isTokenKindFound(T_FUNCTION);
+ return $tokens->isAnyTokenKindsFound([T_FUNCTION, T_FN]);
}
/**
@@ -102,7 +113,7 @@ protected function isSkippedType(string $type): bool
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
{
for ($index = $tokens->count() - 1; 0 < $index; --$index) {
- if (!$tokens[$index]->isGivenKind(T_FUNCTION)) {
+ if (!$tokens[$index]->isGivenKind([T_FUNCTION, T_FN])) {
continue;
}
@@ -136,7 +147,8 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
if (null !== $typeInfo) {
- [$paramType, $isNullable] = $typeInfo;
+ $paramType = $typeInfo['commonType'];
+ $isNullable = $typeInfo['isNullable'];
} elseif (null !== $unionTypes) {
$paramType = $unionTypes;
$isNullable = false;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php
index 7a1f287ee..7467c0088 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToPropertyTypeFixer.php
@@ -16,13 +16,17 @@
use PhpCsFixer\AbstractPhpdocToTypeDeclarationFixer;
use PhpCsFixer\DocBlock\Annotation;
+use PhpCsFixer\Fixer\ExperimentalFixerInterface;
use PhpCsFixer\FixerDefinition\CodeSample;
use PhpCsFixer\FixerDefinition\FixerDefinition;
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
use PhpCsFixer\Tokenizer\Token;
use PhpCsFixer\Tokenizer\Tokens;
-final class PhpdocToPropertyTypeFixer extends AbstractPhpdocToTypeDeclarationFixer
+/**
+ * @phpstan-import-type _CommonTypeInfo from AbstractPhpdocToTypeDeclarationFixer
+ */
+final class PhpdocToPropertyTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ExperimentalFixerInterface
{
private const TYPE_CHECK_TEMPLATE = '= 7.4.',
+ 'Takes `@var` annotation of non-mixed types and adjusts accordingly the property signature. Requires PHP >= 7.4.',
[
new CodeSample(
' false]
),
+ new CodeSample(
+ ' false]
+ ),
],
null,
- 'This rule is EXPERIMENTAL and [1] is not covered with backward compatibility promise. [2] `@var` annotation is mandatory for the fixer to make changes, signatures of properties without it (no docblock) will not be fixed. [3] Manual actions might be required for newly typed properties that are read before initialization.'
+ 'The `@var` annotation is mandatory for the fixer to make changes, signatures of properties without it (no docblock) will not be fixed. Manual actions might be required for newly typed properties that are read before initialization.'
);
}
@@ -142,7 +157,8 @@ private function fixClass(Tokens $tokens, int $index): void
continue;
}
- [$propertyType, $isNullable] = $typeInfo;
+ $propertyType = $typeInfo['commonType'];
+ $isNullable = $typeInfo['isNullable'];
if (\in_array($propertyType, ['callable', 'never', 'void'], true)) {
continue;
@@ -198,7 +214,9 @@ private function findNextUntypedPropertiesDeclaration(Tokens $tokens, int $index
/**
* @param array $propertyIndices
- * @param Annotation[] $annotations
+ * @param list $annotations
+ *
+ * @return ?_CommonTypeInfo
*/
private function resolveApplicableType(array $propertyIndices, array $annotations): ?array
{
@@ -212,7 +230,7 @@ private function resolveApplicableType(array $propertyIndices, array $annotation
continue;
}
- $propertyName = key($propertyIndices);
+ $propertyName = array_key_first($propertyIndices);
}
if (!isset($propertyIndices[$propertyName])) {
@@ -237,7 +255,7 @@ private function resolveApplicableType(array $propertyIndices, array $annotation
}
if (null !== $unionTypes) {
- $typeInfo = [$unionTypes, false];
+ $typeInfo = ['commonType' => $unionTypes, 'isNullable' => false];
}
if (\array_key_exists($propertyName, $propertyTypes) && $typeInfo !== $propertyTypes[$propertyName]) {
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php
index 5ce5f9dbc..7b029da27 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/PhpdocToReturnTypeFixer.php
@@ -15,7 +15,7 @@
namespace PhpCsFixer\Fixer\FunctionNotation;
use PhpCsFixer\AbstractPhpdocToTypeDeclarationFixer;
-use PhpCsFixer\DocBlock\Annotation;
+use PhpCsFixer\Fixer\ExperimentalFixerInterface;
use PhpCsFixer\FixerDefinition\CodeSample;
use PhpCsFixer\FixerDefinition\FixerDefinition;
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
@@ -28,7 +28,7 @@
/**
* @author Filippo Tessarotto
*/
-final class PhpdocToReturnTypeFixer extends AbstractPhpdocToTypeDeclarationFixer
+final class PhpdocToReturnTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ExperimentalFixerInterface
{
private const TYPE_CHECK_TEMPLATE = ' false]
),
+ new CodeSample(
+ ' false]
+ ),
new VersionSpecificCodeSample(
'getTypeExpression();
@@ -164,7 +173,8 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
if (null !== $typeInfo) {
- [$returnType, $isNullable] = $typeInfo;
+ $returnType = $typeInfo['commonType'];
+ $isNullable = $typeInfo['isNullable'];
} elseif (null !== $unionTypes) {
$returnType = $unionTypes;
$isNullable = false;
@@ -174,9 +184,12 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
continue;
}
- $startIndex = $tokens->getNextTokenOfKind($index, ['{', ';']);
+ $paramsStartIndex = $tokens->getNextTokenOfKind($index, ['(']);
+ $paramsEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS_BRACE, $paramsStartIndex);
- if ($this->hasReturnTypeHint($tokens, $startIndex)) {
+ $bodyStartIndex = $tokens->getNextTokenOfKind($paramsEndIndex, ['{', ';', [T_DOUBLE_ARROW]]);
+
+ if ($this->hasReturnTypeHint($tokens, $bodyStartIndex)) {
continue;
}
@@ -184,10 +197,8 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
continue;
}
- $endFuncIndex = $tokens->getPrevTokenOfKind($startIndex, [')']);
-
$tokens->insertAt(
- $endFuncIndex + 1,
+ $paramsEndIndex + 1,
array_merge(
[
new Token([CT::T_TYPE_COLON, ':']),
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/RegularCallableCallFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/RegularCallableCallFixer.php
index 2bb372c34..7538ff7ab 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/RegularCallableCallFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/RegularCallableCallFixer.php
@@ -103,7 +103,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
}
/**
- * @param array $arguments
+ * @param non-empty-array $arguments
*/
private function processCall(Tokens $tokens, int $index, array $arguments): void
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/VoidReturnFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/VoidReturnFixer.php
index 65e8268da..150931dd4 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/VoidReturnFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/FunctionNotation/VoidReturnFixer.php
@@ -220,7 +220,7 @@ private function fixFunctionDefinition(Tokens $tokens, int $index): void
*
* @param int $index The index of the function token
*
- * @return Annotation[]
+ * @return list
*/
private function findReturnAnnotations(Tokens $tokens, int $index): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/FullyQualifiedStrictTypesFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/FullyQualifiedStrictTypesFixer.php
index e9f04f3c9..5522dafda 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/FullyQualifiedStrictTypesFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/FullyQualifiedStrictTypesFixer.php
@@ -15,44 +15,111 @@
namespace PhpCsFixer\Fixer\Import;
use PhpCsFixer\AbstractFixer;
+use PhpCsFixer\DocBlock\TypeExpression;
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
+use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
use PhpCsFixer\FixerDefinition\CodeSample;
use PhpCsFixer\FixerDefinition\FixerDefinition;
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
+use PhpCsFixer\Preg;
use PhpCsFixer\Tokenizer\Analyzer\Analysis\TypeAnalysis;
+use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer;
use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer;
use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer;
use PhpCsFixer\Tokenizer\CT;
+use PhpCsFixer\Tokenizer\Processor\ImportProcessor;
use PhpCsFixer\Tokenizer\Token;
use PhpCsFixer\Tokenizer\Tokens;
/**
* @author VeeWee
+ * @author Tomas Jadrny
+ * @author Greg Korba
+ * @author SpacePossum
+ * @author Michael Vorisek
*/
-final class FullyQualifiedStrictTypesFixer extends AbstractFixer implements ConfigurableFixerInterface
+final class FullyQualifiedStrictTypesFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
{
+ private const REGEX_CLASS = '(?:\\\?+'.TypeExpression::REGEX_IDENTIFIER
+ .'(\\\\'.TypeExpression::REGEX_IDENTIFIER.')*+)';
+
+ /**
+ * @var array{
+ * const?: list,
+ * class?: list,
+ * function?: list
+ * }|null
+ */
+ private ?array $discoveredSymbols;
+
+ /**
+ * @var array{
+ * const?: array,
+ * class?: array,
+ * function?: array
+ * }
+ */
+ private array $symbolsForImport = [];
+
+ /**
+ * @var array, array>
+ */
+ private array $reservedIdentifiersByLevel;
+
+ /** @var array */
+ private array $cacheUsesLast = [];
+
+ /** @var array */
+ private array $cacheUseNameByShortNameLower;
+
+ /** @var array */
+ private array $cacheUseShortNameByNameLower;
+
public function getDefinition(): FixerDefinitionInterface
{
return new FixerDefinition(
- 'Transforms imported FQCN parameters and return types in function arguments to short version.',
+ 'Removes the leading part of fully qualified symbol references if a given symbol is imported or belongs to the current namespace.',
[
new CodeSample(
'baz = $baz;
}
- public function doY(Foo\NotImported $u, \Foo\NotImported $v)
+ /**
+ * @return \Foo\Bar\Baz
+ */
+ public function getBaz() {
+ return $this->baz;
+ }
+
+ public function doX(\Foo\Bar $foo, \Exception $e): \Foo\Bar\Baz
{
+ try {}
+ catch (\Foo\SomeException $e) {}
}
}
'
@@ -69,6 +136,43 @@ public function doY(Foo\NotImported $u, \Foo\NotImported $v)
',
['leading_backslash_in_global_namespace' => true]
),
+ new CodeSample(
+ ' true]
+ ),
+ new CodeSample(
+ ' true]
+ ),
]
);
}
@@ -76,8 +180,8 @@ public function doY(Foo\NotImported $u, \Foo\NotImported $v)
/**
* {@inheritdoc}
*
- * Must run before NoSuperfluousPhpdocTagsFixer.
- * Must run after PhpdocToReturnTypeFixer.
+ * Must run before NoSuperfluousPhpdocTagsFixer, OrderedAttributesFixer, OrderedImportsFixer, OrderedInterfacesFixer, StatementIndentationFixer.
+ * Must run after ClassKeywordFixer, PhpUnitAttributesFixer, PhpdocToReturnTypeFixer.
*/
public function getPriority(): int
{
@@ -86,7 +190,19 @@ public function getPriority(): int
public function isCandidate(Tokens $tokens): bool
{
- return $tokens->isTokenKindFound(T_FUNCTION);
+ return $tokens->isAnyTokenKindsFound([
+ CT::T_USE_TRAIT,
+ ...(\defined('T_ATTRIBUTE') ? [T_ATTRIBUTE] : []), // @TODO: drop condition when PHP 8.0+ is required
+ T_CATCH,
+ T_DOUBLE_COLON,
+ T_DOC_COMMENT,
+ T_EXTENDS,
+ T_FUNCTION,
+ T_IMPLEMENTS,
+ T_INSTANCEOF,
+ T_NEW,
+ T_VARIABLE,
+ ]);
}
protected function createConfigurationDefinition(): FixerConfigurationResolverInterface
@@ -99,6 +215,41 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
->setAllowedTypes(['bool'])
->setDefault(false)
->getOption(),
+ (new FixerOptionBuilder(
+ 'import_symbols',
+ 'Whether FQCNs should be automatically imported.'
+ ))
+ ->setAllowedTypes(['bool'])
+ ->setDefault(false)
+ ->getOption(),
+ (new FixerOptionBuilder(
+ 'phpdoc_tags',
+ 'Collection of PHPDoc annotation tags where FQCNs should be processed. As of now only simple tags with `@tag \F\Q\C\N` format are supported (no complex types).'
+ ))
+ ->setAllowedTypes(['array'])
+ ->setDefault([
+ 'param',
+ 'phpstan-param',
+ 'phpstan-property',
+ 'phpstan-property-read',
+ 'phpstan-property-write',
+ 'phpstan-return',
+ 'phpstan-var',
+ 'property',
+ 'property-read',
+ 'property-write',
+ 'psalm-param',
+ 'psalm-property',
+ 'psalm-property-read',
+ 'psalm-property-write',
+ 'psalm-return',
+ 'psalm-var',
+ 'return',
+ 'see',
+ 'throws',
+ 'var',
+ ])
+ ->getOption(),
]);
}
@@ -107,18 +258,300 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
$namespaceUsesAnalyzer = new NamespaceUsesAnalyzer();
$functionsAnalyzer = new FunctionsAnalyzer();
- foreach ($tokens->getNamespaceDeclarations() as $namespace) {
- $namespaceName = strtolower($namespace->getFullName());
+ $this->symbolsForImport = [];
+
+ foreach ($tokens->getNamespaceDeclarations() as $namespaceIndex => $namespace) {
+ $namespace = $tokens->getNamespaceDeclarations()[$namespaceIndex];
+
+ $namespaceName = $namespace->getFullName();
$uses = [];
+ $lastUse = null;
+
+ foreach ($namespaceUsesAnalyzer->getDeclarationsInNamespace($tokens, $namespace, true) as $use) {
+ if (!$use->isClass()) {
+ continue;
+ }
+ $uses[ltrim($use->getFullName(), '\\')] = $use->getShortName();
+ $lastUse = $use;
+ }
+
+ $indexDiff = 0;
+ foreach (true === $this->configuration['import_symbols'] ? [true, false] : [false] as $discoverSymbolsPhase) {
+ $this->discoveredSymbols = $discoverSymbolsPhase ? [] : null;
+
+ $classyKinds = [T_CLASS, T_INTERFACE, T_TRAIT];
+ if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required
+ $classyKinds[] = T_ENUM;
+ }
+
+ $openedCurlyBrackets = 0;
+ $this->reservedIdentifiersByLevel = [];
+
+ for ($index = $namespace->getScopeStartIndex(); $index < $namespace->getScopeEndIndex() + $indexDiff; ++$index) {
+ $origSize = \count($tokens);
+
+ if ($tokens[$index]->equals('{')) {
+ ++$openedCurlyBrackets;
+ } if ($tokens[$index]->equals('}')) {
+ unset($this->reservedIdentifiersByLevel[$openedCurlyBrackets]);
+ --$openedCurlyBrackets;
+ } elseif ($discoverSymbolsPhase && $tokens[$index]->isGivenKind($classyKinds)) {
+ $this->fixNextName($tokens, $index, $uses, $namespaceName);
+ } elseif ($tokens[$index]->isGivenKind(T_FUNCTION)) {
+ $this->fixFunction($functionsAnalyzer, $tokens, $index, $uses, $namespaceName);
+ } elseif ($tokens[$index]->isGivenKind([T_EXTENDS, T_IMPLEMENTS])) {
+ $this->fixExtendsImplements($tokens, $index, $uses, $namespaceName);
+ } elseif ($tokens[$index]->isGivenKind(T_CATCH)) {
+ $this->fixCatch($tokens, $index, $uses, $namespaceName);
+ } elseif ($tokens[$index]->isGivenKind(T_DOUBLE_COLON)) {
+ $this->fixPrevName($tokens, $index, $uses, $namespaceName);
+ } elseif ($tokens[$index]->isGivenKind([T_INSTANCEOF, T_NEW, CT::T_USE_TRAIT])) {
+ $this->fixNextName($tokens, $index, $uses, $namespaceName);
+ } elseif ($tokens[$index]->isGivenKind(T_VARIABLE)) {
+ $prevIndex = $tokens->getPrevMeaningfulToken($index);
+ if (null !== $prevIndex && $tokens[$prevIndex]->isGivenKind(T_STRING)) {
+ $this->fixPrevName($tokens, $index, $uses, $namespaceName);
+ }
+ } elseif (\defined('T_ATTRIBUTE') && $tokens[$index]->isGivenKind(T_ATTRIBUTE)) { // @TODO: drop const check when PHP 8.0+ is required
+ $this->fixAttribute($tokens, $index, $uses, $namespaceName);
+ } elseif ($discoverSymbolsPhase && !\defined('T_ATTRIBUTE') && $tokens[$index]->isComment() && Preg::match('/#\[\s*('.self::REGEX_CLASS.')/', $tokens[$index]->getContent(), $matches)) { // @TODO: drop when PHP 8.0+ is required
+ $this->determineShortType($matches[1], $uses, $namespaceName);
+ } elseif ($tokens[$index]->isGivenKind(T_DOC_COMMENT)) {
+ Preg::matchAll('/\*\h*@(?:psalm-|phpstan-)?(?:template(?:-covariant|-contravariant)?|(?:import-)?type)\h+('.TypeExpression::REGEX_IDENTIFIER.')(?!\S)/i', $tokens[$index]->getContent(), $matches);
+ foreach ($matches[1] as $reservedIdentifier) {
+ $this->reservedIdentifiersByLevel[$openedCurlyBrackets + 1][$reservedIdentifier] = true;
+ }
+
+ $this->fixPhpDoc($tokens, $index, $uses, $namespaceName);
+ }
- foreach ($namespaceUsesAnalyzer->getDeclarationsInNamespace($tokens, $namespace) as $use) {
- $uses[strtolower(ltrim($use->getFullName(), '\\'))] = $use->getShortName();
+ $indexDiff += \count($tokens) - $origSize;
+ }
+
+ $this->reservedIdentifiersByLevel = [];
+
+ if ($discoverSymbolsPhase) {
+ $this->setupUsesFromDiscoveredSymbols($uses, $namespaceName);
+ }
}
- for ($index = $namespace->getScopeStartIndex(); $index < $namespace->getScopeEndIndex(); ++$index) {
- if ($tokens[$index]->isGivenKind(T_FUNCTION)) {
- $this->fixFunction($functionsAnalyzer, $tokens, $index, $uses, $namespaceName);
+ if ([] !== $this->symbolsForImport) {
+ if (null !== $lastUse) {
+ $atIndex = $lastUse->getEndIndex() + 1;
+ } elseif (0 !== $namespace->getEndIndex()) {
+ $atIndex = $namespace->getEndIndex() + 1;
+ } else {
+ $firstTokenIndex = $tokens->getNextMeaningfulToken($namespace->getScopeStartIndex());
+ if (null !== $firstTokenIndex && $tokens[$firstTokenIndex]->isGivenKind(T_DECLARE)) {
+ $atIndex = $tokens->getNextTokenOfKind($firstTokenIndex, [';']) + 1;
+ } else {
+ $atIndex = $namespace->getScopeStartIndex() + 1;
+ }
}
+
+ // Insert all registered FQCNs
+ $this->createImportProcessor()->insertImports($tokens, $this->symbolsForImport, $atIndex);
+
+ $this->symbolsForImport = [];
+ }
+ }
+ }
+
+ /**
+ * @param array $uses
+ */
+ private function refreshUsesCache(array $uses): void
+ {
+ if ($this->cacheUsesLast === $uses) {
+ return;
+ }
+
+ $this->cacheUsesLast = $uses;
+ $this->cacheUseNameByShortNameLower = [];
+ $this->cacheUseShortNameByNameLower = [];
+ foreach ($uses as $useLongName => $useShortName) {
+ $this->cacheUseNameByShortNameLower[strtolower($useShortName)] = $useLongName;
+ $this->cacheUseShortNameByNameLower[strtolower($useLongName)] = $useShortName;
+ }
+ }
+
+ private function isReservedIdentifier(string $symbol): bool
+ {
+ if (str_contains($symbol, '\\')) { // optimization only
+ return false;
+ }
+
+ if ((new TypeAnalysis($symbol))->isReservedType()) {
+ return true;
+ }
+
+ foreach ($this->reservedIdentifiersByLevel as $reservedIdentifiers) {
+ if (isset($reservedIdentifiers[$symbol])) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Resolve absolute or relative symbol to normalized FQCN.
+ *
+ * @param array $uses
+ */
+ private function resolveSymbol(string $symbol, array $uses, string $namespaceName): string
+ {
+ if (str_starts_with($symbol, '\\')) {
+ return substr($symbol, 1);
+ }
+
+ if ($this->isReservedIdentifier($symbol)) {
+ return $symbol;
+ }
+
+ $this->refreshUsesCache($uses);
+
+ $symbolArr = explode('\\', $symbol, 2);
+ $shortStartNameLower = strtolower($symbolArr[0]);
+ if (isset($this->cacheUseNameByShortNameLower[$shortStartNameLower])) {
+ return $this->cacheUseNameByShortNameLower[$shortStartNameLower].(isset($symbolArr[1]) ? '\\'.$symbolArr[1] : '');
+ }
+
+ return ('' !== $namespaceName ? $namespaceName.'\\' : '').$symbol;
+ }
+
+ /**
+ * Shorten normalized FQCN as much as possible.
+ *
+ * @param array $uses
+ */
+ private function shortenSymbol(string $fqcn, array $uses, string $namespaceName): string
+ {
+ if ($this->isReservedIdentifier($fqcn)) {
+ return $fqcn;
+ }
+
+ $this->refreshUsesCache($uses);
+
+ $res = null;
+
+ // try to shorten the name using namespace
+ $iMin = 0;
+ if (str_starts_with($fqcn, $namespaceName.'\\')) {
+ $tmpRes = substr($fqcn, \strlen($namespaceName) + 1);
+ if (!isset($this->cacheUseNameByShortNameLower[strtolower(explode('\\', $tmpRes, 2)[0])]) && !$this->isReservedIdentifier($tmpRes)) {
+ $res = $tmpRes;
+ $iMin = substr_count($namespaceName, '\\') + 1;
+ }
+ }
+
+ // try to shorten the name using uses
+ $tmp = $fqcn;
+ for ($i = substr_count($fqcn, '\\'); $i >= $iMin; --$i) {
+ if (isset($this->cacheUseShortNameByNameLower[strtolower($tmp)])) {
+ $tmpRes = $this->cacheUseShortNameByNameLower[strtolower($tmp)].substr($fqcn, \strlen($tmp));
+ if (!$this->isReservedIdentifier($tmpRes)) {
+ $res = $tmpRes;
+
+ break;
+ }
+ }
+
+ if ($i > 0) {
+ $tmp = substr($tmp, 0, strrpos($tmp, '\\'));
+ }
+ }
+
+ // shortening is not possible, add leading backslash if needed
+ if (null === $res) {
+ $res = $fqcn;
+ if ('' !== $namespaceName
+ || true === $this->configuration['leading_backslash_in_global_namespace']
+ || isset($this->cacheUseNameByShortNameLower[strtolower(explode('\\', $res, 2)[0])])
+ ) {
+ $res = '\\'.$res;
+ }
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $uses
+ */
+ private function setupUsesFromDiscoveredSymbols(array &$uses, string $namespaceName): void
+ {
+ foreach ($this->discoveredSymbols as $kind => $discoveredSymbols) {
+ $discoveredFqcnByShortNameLower = [];
+
+ if ('' === $namespaceName) {
+ foreach ($discoveredSymbols as $symbol) {
+ if (!str_starts_with($symbol, '\\')) {
+ $shortStartName = explode('\\', ltrim($symbol, '\\'), 2)[0];
+ $shortStartNameLower = strtolower($shortStartName);
+ $discoveredFqcnByShortNameLower[$shortStartNameLower] = $this->resolveSymbol($shortStartName, $uses, $namespaceName);
+ }
+ }
+ }
+
+ foreach ($uses as $useLongName => $useShortName) {
+ $discoveredFqcnByShortNameLower[strtolower($useShortName)] = $useLongName;
+ }
+
+ $useByShortNameLower = [];
+ foreach ($uses as $useShortName) {
+ $useByShortNameLower[strtolower($useShortName)] = true;
+ }
+
+ uasort($discoveredSymbols, static function ($a, $b) {
+ $res = str_starts_with($a, '\\') <=> str_starts_with($b, '\\');
+ if (0 !== $res) {
+ return $res;
+ }
+
+ return substr_count($a, '\\') <=> substr_count($b, '\\');
+ });
+ foreach ($discoveredSymbols as $symbol) {
+ while (true) {
+ $shortEndNameLower = strtolower(str_contains($symbol, '\\') ? substr($symbol, strrpos($symbol, '\\') + 1) : $symbol);
+ if (!isset($discoveredFqcnByShortNameLower[$shortEndNameLower])) {
+ $shortStartNameLower = strtolower(explode('\\', ltrim($symbol, '\\'), 2)[0]);
+ if (str_starts_with($symbol, '\\') || ('' === $namespaceName && !isset($useByShortNameLower[$shortStartNameLower]))
+ || !str_contains($symbol, '\\')
+ ) {
+ $discoveredFqcnByShortNameLower[$shortEndNameLower] = $this->resolveSymbol($symbol, $uses, $namespaceName);
+
+ break;
+ }
+ }
+ // else short name collision - keep unimported
+
+ if (str_starts_with($symbol, '\\') || '' === $namespaceName || !str_contains($symbol, '\\')) {
+ break;
+ }
+
+ $symbol = substr($symbol, 0, strrpos($symbol, '\\'));
+ }
+ }
+
+ foreach ($uses as $useLongName => $useShortName) {
+ $discoveredLongName = $discoveredFqcnByShortNameLower[strtolower($useShortName)] ?? null;
+ if (strtolower($discoveredLongName) === strtolower($useLongName)) {
+ unset($discoveredFqcnByShortNameLower[strtolower($useShortName)]);
+ }
+ }
+
+ foreach ($discoveredFqcnByShortNameLower as $fqcn) {
+ $shortenedName = ltrim($this->shortenSymbol($fqcn, [], $namespaceName), '\\');
+ if (str_contains($shortenedName, '\\')) { // prevent importing non-namespaced names in global namespace
+ $shortEndName = str_contains($fqcn, '\\') ? substr($fqcn, strrpos($fqcn, '\\') + 1) : $fqcn;
+ $uses[$fqcn] = $shortEndName;
+ $this->symbolsForImport[$kind][$shortEndName] = $fqcn;
+ }
+ }
+
+ if (isset($this->symbolsForImport[$kind])) {
+ ksort($this->symbolsForImport[$kind], SORT_NATURAL);
}
}
}
@@ -148,91 +581,261 @@ private function fixFunction(FunctionsAnalyzer $functionsAnalyzer, Tokens $token
/**
* @param array $uses
*/
- private function replaceByShortType(Tokens $tokens, TypeAnalysis $type, array $uses, string $namespaceName): void
+ private function fixPhpDoc(Tokens $tokens, int $index, array $uses, string $namespaceName): void
{
- $typeStartIndex = $type->getStartIndex();
+ $allowedTags = $this->configuration['phpdoc_tags'];
- if ($tokens[$typeStartIndex]->isGivenKind(CT::T_NULLABLE_TYPE)) {
- $typeStartIndex = $tokens->getNextMeaningfulToken($typeStartIndex);
+ if ([] === $allowedTags) {
+ return;
}
- $namespaceNameLength = \strlen($namespaceName);
- $types = $this->getTypes($tokens, $typeStartIndex, $type->getEndIndex());
+ $phpDoc = $tokens[$index];
+ $phpDocContent = $phpDoc->getContent();
+ $phpDocContentNew = Preg::replaceCallback('/([*{]\h*@)(\S+)(\h+)('.TypeExpression::REGEX_TYPES.')(?!(?!\})\S)/', function ($matches) use ($allowedTags, $uses, $namespaceName) {
+ if (!\in_array($matches[2], $allowedTags, true)) {
+ return $matches[0];
+ }
+
+ /** @TODO parse the complex type using TypeExpression and fix all names inside (like `list<\Foo\Bar|'a|b|c'|string>` or `\Foo\Bar[]`) */
+ $unsupported = false;
+
+ return $matches[1].$matches[2].$matches[3].implode('|', array_map(function ($v) use ($uses, $namespaceName, &$unsupported) {
+ if ($unsupported || !Preg::match('/^'.self::REGEX_CLASS.'$/', $v)) {
+ $unsupported = true;
+
+ return $v;
+ }
+
+ $shortTokens = $this->determineShortType($v, $uses, $namespaceName);
+ if (null === $shortTokens) {
+ return $v;
+ }
+
+ return implode('', array_map(
+ static fn (Token $token) => $token->getContent(),
+ $shortTokens
+ ));
+ }, explode('|', $matches[4])));
+ }, $phpDocContent);
+
+ if ($phpDocContentNew !== $phpDocContent) {
+ $tokens[$index] = new Token([T_DOC_COMMENT, $phpDocContentNew]);
+ }
+ }
+
+ /**
+ * @param array $uses
+ */
+ private function fixExtendsImplements(Tokens $tokens, int $index, array $uses, string $namespaceName): void
+ {
+ // We handle `extends` and `implements` with similar logic, but we need to exit the loop under different conditions.
+ $isExtends = $tokens[$index]->equals([T_EXTENDS]);
+ $index = $tokens->getNextMeaningfulToken($index);
+
+ $typeStartIndex = null;
+ $typeEndIndex = null;
+
+ while (true) {
+ if ($tokens[$index]->equalsAny([',', '{', [T_IMPLEMENTS]])) {
+ if (null !== $typeStartIndex) {
+ $index += $this->shortenClassIfPossible($tokens, $typeStartIndex, $typeEndIndex, $uses, $namespaceName);
+ }
+ $typeStartIndex = null;
- foreach ($types as $typeName => [$startIndex, $endIndex]) {
- if ((new TypeAnalysis($typeName))->isReservedType()) {
- return;
+ if ($tokens[$index]->equalsAny($isExtends ? [[T_IMPLEMENTS], '{'] : ['{'])) {
+ break;
+ }
+ } else {
+ if (null === $typeStartIndex) {
+ $typeStartIndex = $index;
+ }
+ $typeEndIndex = $index;
}
- $withLeadingBackslash = str_starts_with($typeName, '\\');
- if ($withLeadingBackslash) {
- $typeName = substr($typeName, 1);
+ $index = $tokens->getNextMeaningfulToken($index);
+ }
+ }
+
+ /**
+ * @param array $uses
+ */
+ private function fixCatch(Tokens $tokens, int $index, array $uses, string $namespaceName): void
+ {
+ $index = $tokens->getNextMeaningfulToken($index); // '('
+ $index = $tokens->getNextMeaningfulToken($index); // first part of first exception class to be caught
+
+ $typeStartIndex = null;
+ $typeEndIndex = null;
+
+ while (true) {
+ if ($tokens[$index]->equalsAny([')', [T_VARIABLE], [CT::T_TYPE_ALTERNATION]])) {
+ if (null === $typeStartIndex) {
+ break;
+ }
+
+ $index += $this->shortenClassIfPossible($tokens, $typeStartIndex, $typeEndIndex, $uses, $namespaceName);
+ $typeStartIndex = null;
+
+ if ($tokens[$index]->equals(')')) {
+ break;
+ }
+ } else {
+ if (null === $typeStartIndex) {
+ $typeStartIndex = $index;
+ }
+ $typeEndIndex = $index;
}
- $typeNameLower = strtolower($typeName);
- if (isset($uses[$typeNameLower]) && ($withLeadingBackslash || '' === $namespaceName)) {
- // if the type without leading "\" equals any of the full "uses" long names, it can be replaced with the short one
- $tokens->overrideRange($startIndex, $endIndex, $this->namespacedStringToTokens($uses[$typeNameLower]));
+ $index = $tokens->getNextMeaningfulToken($index);
+ }
+ }
+
+ /**
+ * @param array $uses
+ */
+ private function fixAttribute(Tokens $tokens, int $index, array $uses, string $namespaceName): void
+ {
+ $attributeAnalysis = AttributeAnalyzer::collectOne($tokens, $index);
- continue;
+ foreach ($attributeAnalysis->getAttributes() as $attribute) {
+ $index = $attribute['start'];
+ while ($tokens[$index]->equalsAny([[T_STRING], [T_NS_SEPARATOR]])) {
+ $index = $tokens->getPrevMeaningfulToken($index);
+ }
+ $this->fixNextName($tokens, $index, $uses, $namespaceName);
+ }
+ }
+
+ /**
+ * @param array $uses
+ */
+ private function fixPrevName(Tokens $tokens, int $index, array $uses, string $namespaceName): void
+ {
+ $typeStartIndex = null;
+ $typeEndIndex = null;
+
+ while (true) {
+ $index = $tokens->getPrevMeaningfulToken($index);
+ if ($tokens[$index]->isObjectOperator()) {
+ break;
}
- if ('' === $namespaceName) {
- foreach ($uses as $useShortName) {
- if (strtolower($useShortName) === $typeNameLower) {
- continue 2;
- }
+ if ($tokens[$index]->equalsAny([[T_STRING], [T_NS_SEPARATOR]])) {
+ $typeStartIndex = $index;
+ if (null === $typeEndIndex) {
+ $typeEndIndex = $index;
+ }
+ } else {
+ if (null !== $typeEndIndex) {
+ $index += $this->shortenClassIfPossible($tokens, $typeStartIndex, $typeEndIndex, $uses, $namespaceName);
}
- // if we are in the global namespace and the type is not imported,
- // we enforce/remove leading backslash (depending on the configuration)
- if (true === $this->configuration['leading_backslash_in_global_namespace']) {
- if (!$withLeadingBackslash && !isset($uses[$typeNameLower])) {
- $tokens->overrideRange(
- $startIndex,
- $endIndex,
- $this->namespacedStringToTokens($typeName, true)
- );
- }
- } else {
- $tokens->overrideRange($startIndex, $endIndex, $this->namespacedStringToTokens($typeName));
+ break;
+ }
+ }
+ }
+
+ /**
+ * @param array $uses
+ */
+ private function fixNextName(Tokens $tokens, int $index, array $uses, string $namespaceName): void
+ {
+ $typeStartIndex = null;
+ $typeEndIndex = null;
+
+ while (true) {
+ $index = $tokens->getNextMeaningfulToken($index);
+
+ if ($tokens[$index]->equalsAny([[T_STRING], [T_NS_SEPARATOR]])) {
+ if (null === $typeStartIndex) {
+ $typeStartIndex = $index;
}
- } elseif (!str_contains($typeName, '\\')) {
- // If we're NOT in the global namespace, there's no related import,
- // AND used type is from global namespace, then it can't be shortened.
- continue;
- } elseif ($typeNameLower !== $namespaceName && str_starts_with($typeNameLower, $namespaceName.'\\')) {
- // if the type starts with namespace and the type is not the same as the namespace it can be shortened
- $typeNameShort = substr($typeName, $namespaceNameLength + 1);
-
- // if short names are the same, but long one are different then it cannot be shortened
- foreach ($uses as $useLongName => $useShortName) {
- if (
- strtolower($typeNameShort) === strtolower($useShortName)
- && strtolower($typeName) !== strtolower($useLongName)
- ) {
- continue 2;
- }
+ $typeEndIndex = $index;
+ } else {
+ if (null !== $typeStartIndex) {
+ $index += $this->shortenClassIfPossible($tokens, $typeStartIndex, $typeEndIndex, $uses, $namespaceName);
}
- $tokens->overrideRange($startIndex, $endIndex, $this->namespacedStringToTokens($typeNameShort));
+ break;
+ }
+ }
+ }
+
+ /**
+ * @param array $uses
+ */
+ private function shortenClassIfPossible(Tokens $tokens, int $typeStartIndex, int $typeEndIndex, array $uses, string $namespaceName): int
+ {
+ $content = $tokens->generatePartialCode($typeStartIndex, $typeEndIndex);
+ $newTokens = $this->determineShortType($content, $uses, $namespaceName);
+ if (null === $newTokens) {
+ return 0;
+ }
+
+ $tokens->overrideRange($typeStartIndex, $typeEndIndex, $newTokens);
+
+ return \count($newTokens) - ($typeEndIndex - $typeStartIndex) - 1;
+ }
+
+ /**
+ * @param array $uses
+ */
+ private function replaceByShortType(Tokens $tokens, TypeAnalysis $type, array $uses, string $namespaceName): void
+ {
+ $typeStartIndex = $type->getStartIndex();
+
+ if ($tokens[$typeStartIndex]->isGivenKind(CT::T_NULLABLE_TYPE)) {
+ $typeStartIndex = $tokens->getNextMeaningfulToken($typeStartIndex);
+ }
+
+ $types = $this->getTypes($tokens, $typeStartIndex, $type->getEndIndex());
+
+ foreach ($types as [$startIndex, $endIndex]) {
+ $content = $tokens->generatePartialCode($startIndex, $endIndex);
+ $newTokens = $this->determineShortType($content, $uses, $namespaceName);
+ if (null !== $newTokens) {
+ $tokens->overrideRange($startIndex, $endIndex, $newTokens);
}
}
}
/**
- * @return iterable
+ * Determines short type based on FQCN, current namespace and imports (`use` declarations).
+ *
+ * @param array $uses
+ *
+ * @return null|list
+ */
+ private function determineShortType(string $typeName, array $uses, string $namespaceName): ?array
+ {
+ if (null !== $this->discoveredSymbols) {
+ if (!$this->isReservedIdentifier($typeName)) {
+ $this->discoveredSymbols['class'][] = $typeName;
+ }
+
+ return null;
+ }
+
+ $fqcn = $this->resolveSymbol($typeName, $uses, $namespaceName);
+ $shortenedType = $this->shortenSymbol($fqcn, $uses, $namespaceName);
+ if ($shortenedType === $typeName) {
+ return null;
+ }
+
+ return $this->namespacedStringToTokens($shortenedType);
+ }
+
+ /**
+ * @return iterable
*/
private function getTypes(Tokens $tokens, int $index, int $endIndex): iterable
{
$skipNextYield = false;
$typeStartIndex = $typeEndIndex = null;
- $type = null;
while (true) {
if ($tokens[$index]->isGivenKind(CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN)) {
$index = $tokens->getNextMeaningfulToken($index);
$typeStartIndex = $typeEndIndex = null;
- $type = null;
continue;
}
@@ -244,19 +847,17 @@ private function getTypes(Tokens $tokens, int $index, int $endIndex): iterable
if (!$skipNextYield && null !== $typeStartIndex) {
$origCount = \count($tokens);
- yield $type => [$typeStartIndex, $typeEndIndex];
+ yield [$typeStartIndex, $typeEndIndex];
$endIndex += \count($tokens) - $origCount;
// type tokens were possibly updated, restart type match
$skipNextYield = true;
$index = $typeEndIndex = $typeStartIndex;
- $type = null;
} else {
$skipNextYield = false;
$index = $tokens->getNextMeaningfulToken($index);
$typeStartIndex = $typeEndIndex = null;
- $type = null;
}
if ($index > $endIndex) {
@@ -268,25 +869,23 @@ private function getTypes(Tokens $tokens, int $index, int $endIndex): iterable
if (null === $typeStartIndex) {
$typeStartIndex = $index;
- $type = '';
}
-
$typeEndIndex = $index;
- $type .= $tokens[$index]->getContent();
$index = $tokens->getNextMeaningfulToken($index);
}
}
/**
- * @return Token[]
+ * @return list
*/
- private function namespacedStringToTokens(string $input, bool $withLeadingBackslash = false): array
+ private function namespacedStringToTokens(string $input): array
{
$tokens = [];
- if ($withLeadingBackslash) {
+ if (str_starts_with($input, '\\')) {
$tokens[] = new Token([T_NS_SEPARATOR, '\\']);
+ $input = substr($input, 1);
}
$parts = explode('\\', $input);
@@ -300,4 +899,13 @@ private function namespacedStringToTokens(string $input, bool $withLeadingBacksl
return $tokens;
}
+
+ /**
+ * We need to create import processor dynamically (not in costructor), because actual whitespace configuration
+ * is set later, not when fixer's instance is created.
+ */
+ private function createImportProcessor(): ImportProcessor
+ {
+ return new ImportProcessor($this->whitespacesConfig);
+ }
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GlobalNamespaceImportFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GlobalNamespaceImportFixer.php
index adda98289..73389d431 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GlobalNamespaceImportFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/Import/GlobalNamespaceImportFixer.php
@@ -31,6 +31,7 @@
use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer;
use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer;
use PhpCsFixer\Tokenizer\CT;
+use PhpCsFixer\Tokenizer\Processor\ImportProcessor;
use PhpCsFixer\Tokenizer\Token;
use PhpCsFixer\Tokenizer\Tokens;
use PhpCsFixer\Tokenizer\TokensAnalyzer;
@@ -40,6 +41,15 @@
*/
final class GlobalNamespaceImportFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
{
+ private ImportProcessor $importProcessor;
+
+ public function __construct()
+ {
+ parent::__construct();
+
+ $this->importProcessor = new ImportProcessor($this->whitespacesConfig);
+ }
+
public function getDefinition(): FixerDefinitionInterface
{
return new FixerDefinition(
@@ -90,7 +100,7 @@ public function getDefinition(): FixerDefinitionInterface
/**
* {@inheritdoc}
*
- * Must run before NoUnusedImportsFixer, OrderedImportsFixer.
+ * Must run before NoUnusedImportsFixer, OrderedImportsFixer, StatementIndentationFixer.
* Must run after NativeConstantInvocationFixer, NativeFunctionInvocationFixer.
*/
public function getPriority(): int
@@ -136,10 +146,16 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
$this->fullyQualifyClasses($tokens, $useDeclarations);
}
- $newImports = array_filter($newImports);
-
if (\count($newImports) > 0) {
- $this->insertImports($tokens, $newImports, $useDeclarations);
+ if (\count($useDeclarations) > 0) {
+ $useDeclaration = end($useDeclarations);
+ $atIndex = $useDeclaration->getEndIndex() + 1;
+ } else {
+ $namespace = $tokens->getNamespaceDeclarations()[0];
+ $atIndex = $namespace->getEndIndex() + 1;
+ }
+
+ $this->importProcessor->insertImports($tokens, $newImports, $atIndex);
}
}
@@ -162,7 +178,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
}
/**
- * @param NamespaceUseAnalysis[] $useDeclarations
+ * @param list $useDeclarations
*
* @return array