Browse Source

Merge branch '2.16'

# Conflicts:
#	src/Console/Application.php
#	src/Fixer/ClassNotation/NoUnneededFinalMethodFixer.php
Dariusz Ruminski 4 years ago
parent
commit
9076c1da5e

+ 2 - 1
.circleci/config.yml

@@ -3,7 +3,8 @@ version: 2
 jobs:
     build:
         macos:
-            xcode: '11.7.0'
+            # https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
+            xcode: '12.2.0'
         steps:
             - checkout
 

+ 1 - 1
.travis.yml

@@ -151,7 +151,7 @@ jobs:
                 token:
                     secure: K9NKi7X1OPz898fxtVc1RfWrSI+4hTFFYOik932wTz1jC4dQJ64Khh1LV9frA1+JiDS3+R6TvmQtpzbkX3y4L75UrSnP1ADH5wfMYIVmydG3ZjTMo8SWQWHmRMh3ORAKTMMpjl4Q7EkRkLp6RncKe+FAFPP5mgv55mtIMaE4qUk=
                 file: php-cs-fixer.phar
-                cleanup: false
+                skip_cleanup: true
                 on:
                     repo: FriendsOfPHP/PHP-CS-Fixer
                     tags: true

+ 139 - 0
CHANGELOG.md

@@ -3,6 +3,80 @@ CHANGELOG for PHP CS Fixer
 
 This file contains changelogs for stable releases only.
 
+Changelog for v2.16.5
+---------------------
+
+* bug #4378 PhpUnitNoExpectationAnnotationFixer - annotation in single line doc comment (kubawerlos)
+* bug #4936 HeaderCommentFixer - Fix unexpected removal of regular comments (julienfalque)
+* bug #5006 PhpdocToParamTypeFixer - fix for breaking PHP syntax for type having reserved name (kubawerlos)
+* bug #5016 NoSuperfluousPhpdocTagsFixer - fix for @return with @inheritDoc in description (kubawerlos)
+* bug #5017 PhpdocTrimConsecutiveBlankLineSeparationFixer - must run after AlignMultilineCommentFixer (kubawerlos)
+* bug #5032 SingleLineAfterImportsFixer - fix for line after import (and before another import) already added using CRLF (kubawerlos)
+* bug #5033 VoidReturnFixer - must run after NoSuperfluousPhpdocTagsFixer (kubawerlos)
+* bug #5038 HelpCommandTest - toString nested array (SpacePossum)
+* bug #5040 LinebreakAfterOpeningTagFixer - do not change code if linebreak already present (kubawerlos)
+* bug #5044 StandardizeIncrementFixer - fix handling static properties (kubawerlos)
+* bug #5045 BacktickToShellExecFixer - add priority relation to NativeFunctionInvocationFixer and SingleQuoteFixer (kubawerlos)
+* bug #5054 PhpdocTypesFixer - fix for multidimensional array (kubawerlos)
+* bug #5065 TernaryOperatorSpacesFixer - fix for discovering ":" correctly (kubawerlos)
+* bug #5068 Fixed php-cs-fixer crashes on input file syntax error (GrahamCampbell)
+* bug #5087 NoAlternativeSyntaxFixer - add support for switch and declare (SpacePossum)
+* bug #5092 PhpdocToParamTypeFixer - remove not used option (SpacePossum)
+* bug #5105 ClassKeywordRemoveFixer - fix for fully qualified class (kubawerlos)
+* bug #5113 TernaryOperatorSpacesFixer - handle goto labels (SpacePossum)
+* bug #5124 Fix TernaryToNullCoalescingFixer when dealing with object properties (HypeMC)
+* bug #5137 DoctrineAnnotationSpacesFixer - fix for typed properties (kubawerlos)
+* bug #5180 Always lint test cases with the stricter process linter (GrahamCampbell)
+* bug #5190 PhpUnit*Fixers - Only fix in unit test class scope (SpacePossum)
+* bug #5195 YodaStyle - statements in braces should be treated as variables in strict … (SpacePossum)
+* bug #5220 NoUnneededFinalMethodFixer - do not fix private constructors (SpacePossum)
+* feature #3475 Rework documentation (julienfalque, SpacePossum)
+* feature #5166 PHP8 (SpacePossum)
+* minor #4878 ArrayIndentationFixer - refactor (julienfalque)
+* minor #5031 CI: skip_cleanup: true (keradus)
+* minor #5035 PhpdocToParamTypeFixer - Rename attribute (SpacePossum)
+* minor #5048 Allow composer/semver ^2.0 and ^3.0 (thomasvargiu)
+* minor #5050 DX: moving integration test for braces, indentation_type and no_break_comment into right place (kubawerlos)
+* minor #5051 DX: move all tests from AutoReview\FixerTest to Test\AbstractFixerTestCase (kubawerlos)
+* minor #5053 DX: cleanup FunctionTypehintSpaceFixer (kubawerlos)
+* minor #5056 DX: add missing priority test for indentation_type and phpdoc_indent (kubawerlos)
+* minor #5077 DX: add missing priority test between NoUnsetCastFixer and BinaryOperatorSpacesFixer (kubawerlos)
+* minor #5083 Update composer.json to prevent issue #5030 (mvorisek)
+* minor #5088 NoBreakCommentFixer - NoUselessElseFixer - priority test (SpacePossum)
+* minor #5100 Fixed invalid PHP 5.6 syntax (GrahamCampbell)
+* minor #5106 Symfony's finder already ignores vcs and dot files by default (GrahamCampbell)
+* minor #5112 DX: check file permissions (kubawerlos, SpacePossum)
+* minor #5122 Show runtime PHP version (kubawerlos)
+* minor #5132 Do not allow assignments in if statements (SpacePossum)
+* minor #5133 RuleSetTest - Early return for boolean and detect more defaults (SpacePossum)
+* minor #5139 revert some unneeded exclusions (SpacePossum)
+* minor #5148 Upgrade Xcode (kubawerlos)
+* minor #5149 NoUnsetOnPropertyFixer - risky description tweaks (SpacePossum)
+* minor #5161 minors (SpacePossum)
+* minor #5170 Fix test on PHP8 (SpacePossum)
+* minor #5172 Remove accidentally inserted newlines (GrahamCampbell)
+* minor #5173 Fix PHP8 RuleSet inherit (SpacePossum)
+* minor #5174 Corrected linting error messages (GrahamCampbell)
+* minor #5177 PHP8 (SpacePossum)
+* minor #5178 Fix tests (SpacePossum)
+* minor #5184 [FinalStaticAccessFixer] Handle new static() in final class (localheinz)
+* minor #5188 DX: Update sibling debs to version supporting PHP8/PHPUnit9 (keradus)
+* minor #5189 Create temporary linting file in system temp dir (keradus)
+* minor #5191 MethodArgumentSpaceFixer - support use/import of anonymous functions. (undefinedor)
+* minor #5193 DX: add AbstractPhpUnitFixer (kubawerlos)
+* minor #5204 DX: cleanup NullableTypeTransformerTest (kubawerlos)
+* minor #5207 Add © for logo (keradus)
+* minor #5208 DX: cleanup php-cs-fixer entry file (keradus)
+* minor #5210 CICD - temporarily disable problematic test (keradus)
+* minor #5211 CICD: fix file permissions (keradus)
+* minor #5213 DX: move report schemas to dedicated dir (keradus)
+* minor #5214 CICD: fix file permissions (keradus)
+* minor #5215 CICD: update checkbashisms (keradus)
+* minor #5217 CICD: use Composer v2 and drop hirak/prestissimo plugin (keradus)
+* minor #5218 DX: .gitignore - add .phpunit.result.cache (keradus)
+* minor #5222 Upgrade Xcode (kubawerlos)
+* minor #5223 Docs: regenerate docs on 2.16 line (keradus)
+
 Changelog for v2.16.4
 ---------------------
 
@@ -200,6 +274,71 @@ Changelog for v2.16.0
 * minor #4619 Fix PHP 7.3 strict mode warnings (keradus)
 * minor #4621 Add single_line_throw to Symfony ruleset (keradus)
 
+Changelog for v2.15.9
+---------------------
+
+* bug #4378 PhpUnitNoExpectationAnnotationFixer - annotation in single line doc comment (kubawerlos)
+* bug #4936 HeaderCommentFixer - Fix unexpected removal of regular comments (julienfalque)
+* bug #5017 PhpdocTrimConsecutiveBlankLineSeparationFixer - must run after AlignMultilineCommentFixer (kubawerlos)
+* bug #5033 VoidReturnFixer - must run after NoSuperfluousPhpdocTagsFixer (kubawerlos)
+* bug #5038 HelpCommandTest - toString nested array (SpacePossum)
+* bug #5040 LinebreakAfterOpeningTagFixer - do not change code if linebreak already present (kubawerlos)
+* bug #5044 StandardizeIncrementFixer - fix handling static properties (kubawerlos)
+* bug #5045 BacktickToShellExecFixer - add priority relation to NativeFunctionInvocationFixer and SingleQuoteFixer (kubawerlos)
+* bug #5054 PhpdocTypesFixer - fix for multidimensional array (kubawerlos)
+* bug #5065 TernaryOperatorSpacesFixer - fix for discovering ":" correctly (kubawerlos)
+* bug #5068 Fixed php-cs-fixer crashes on input file syntax error (GrahamCampbell)
+* bug #5087 NoAlternativeSyntaxFixer - add support for switch and declare (SpacePossum)
+* bug #5105 ClassKeywordRemoveFixer - fix for fully qualified class (kubawerlos)
+* bug #5113 TernaryOperatorSpacesFixer - handle goto labels (SpacePossum)
+* bug #5124 Fix TernaryToNullCoalescingFixer when dealing with object properties (HypeMC)
+* bug #5137 DoctrineAnnotationSpacesFixer - fix for typed properties (kubawerlos)
+* bug #5180 Always lint test cases with the stricter process linter (GrahamCampbell)
+* bug #5190 PhpUnit*Fixers - Only fix in unit test class scope (SpacePossum)
+* bug #5195 YodaStyle - statements in braces should be treated as variables in strict … (SpacePossum)
+* bug #5220 NoUnneededFinalMethodFixer - do not fix private constructors (SpacePossum)
+* feature #3475 Rework documentation (julienfalque, SpacePossum)
+* feature #5166 PHP8 (SpacePossum)
+* minor #4878 ArrayIndentationFixer - refactor (julienfalque)
+* minor #5031 CI: skip_cleanup: true (keradus)
+* minor #5048 Allow composer/semver ^2.0 and ^3.0 (thomasvargiu)
+* minor #5050 DX: moving integration test for braces, indentation_type and no_break_comment into right place (kubawerlos)
+* minor #5051 DX: move all tests from AutoReview\FixerTest to Test\AbstractFixerTestCase (kubawerlos)
+* minor #5053 DX: cleanup FunctionTypehintSpaceFixer (kubawerlos)
+* minor #5056 DX: add missing priority test for indentation_type and phpdoc_indent (kubawerlos)
+* minor #5077 DX: add missing priority test between NoUnsetCastFixer and BinaryOperatorSpacesFixer (kubawerlos)
+* minor #5083 Update composer.json to prevent issue #5030 (mvorisek)
+* minor #5088 NoBreakCommentFixer - NoUselessElseFixer - priority test (SpacePossum)
+* minor #5100 Fixed invalid PHP 5.6 syntax (GrahamCampbell)
+* minor #5106 Symfony's finder already ignores vcs and dot files by default (GrahamCampbell)
+* minor #5112 DX: check file permissions (kubawerlos, SpacePossum)
+* minor #5122 Show runtime PHP version (kubawerlos)
+* minor #5132 Do not allow assignments in if statements (SpacePossum)
+* minor #5133 RuleSetTest - Early return for boolean and detect more defaults (SpacePossum)
+* minor #5139 revert some unneeded exclusions (SpacePossum)
+* minor #5148 Upgrade Xcode (kubawerlos)
+* minor #5149 NoUnsetOnPropertyFixer - risky description tweaks (SpacePossum)
+* minor #5161 minors (SpacePossum)
+* minor #5172 Remove accidentally inserted newlines (GrahamCampbell)
+* minor #5173 Fix PHP8 RuleSet inherit (SpacePossum)
+* minor #5174 Corrected linting error messages (GrahamCampbell)
+* minor #5177 PHP8 (SpacePossum)
+* minor #5188 DX: Update sibling debs to version supporting PHP8/PHPUnit9 (keradus)
+* minor #5189 Create temporary linting file in system temp dir (keradus)
+* minor #5191 MethodArgumentSpaceFixer - support use/import of anonymous functions. (undefinedor)
+* minor #5193 DX: add AbstractPhpUnitFixer (kubawerlos)
+* minor #5204 DX: cleanup NullableTypeTransformerTest (kubawerlos)
+* minor #5207 Add © for logo (keradus)
+* minor #5208 DX: cleanup php-cs-fixer entry file (keradus)
+* minor #5210 CICD - temporarily disable problematic test (keradus)
+* minor #5211 CICD: fix file permissions (keradus)
+* minor #5213 DX: move report schemas to dedicated dir (keradus)
+* minor #5214 CICD: fix file permissions (keradus)
+* minor #5215 CICD: update checkbashisms (keradus)
+* minor #5217 CICD: use Composer v2 and drop hirak/prestissimo plugin (keradus)
+* minor #5218 DX: .gitignore - add .phpunit.result.cache (keradus)
+* minor #5222 Upgrade Xcode (kubawerlos)
+
 Changelog for v2.15.8
 ---------------------
 

+ 35 - 0
doc/rules/alias/array_push.rst

@@ -0,0 +1,35 @@
+===================
+Rule ``array_push``
+===================
+
+Converts simple usages of ``array_push($x, $y);`` to ``$x[] = $y;``.
+
+.. warning:: Using this rule is risky.
+
+   Risky when the function ``array_push`` is overridden.
+
+Examples
+--------
+
+Example #1
+~~~~~~~~~~
+
+.. code-block:: diff
+
+   --- Original
+   +++ New
+   @@ -1,2 +1,2 @@
+    <?php
+   -array_push($x, $y);
+   +$x[] = $y;
+
+Rule sets
+---------
+
+The rule is part of the following rule sets:
+
+@Symfony:risky
+  Using the ``@Symfony:risky`` rule set will enable the ``array_push`` rule.
+
+@PhpCsFixer:risky
+  Using the ``@PhpCsFixer:risky`` rule set will enable the ``array_push`` rule.

+ 11 - 0
doc/rules/alias/backtick_to_shell_exec.rst

@@ -26,3 +26,14 @@ Example #1
    -$withVar = `ls -lah $var1 ${var2} {$var3} {$var4[0]} {$var5->call()}`;
    +$plain = shell_exec("ls -lah");
    +$withVar = shell_exec("ls -lah $var1 ${var2} {$var3} {$var4[0]} {$var5->call()}");
+
+Rule sets
+---------
+
+The rule is part of the following rule sets:
+
+@Symfony
+  Using the ``@Symfony`` rule set will enable the ``backtick_to_shell_exec`` rule.
+
+@PhpCsFixer
+  Using the ``@PhpCsFixer`` rule set will enable the ``backtick_to_shell_exec`` rule.

+ 3 - 0
doc/rules/alias/no_alias_functions.rst

@@ -106,6 +106,9 @@ The rule is part of the following rule sets:
 
   ``['sets' => ['@all']]``
 
+@PHP74Migration:risky
+  Using the ``@PHP74Migration:risky`` rule set will enable the ``no_alias_functions`` rule with the default config.
+
 @PHP80Migration:risky
   Using the ``@PHP80Migration:risky`` rule set will enable the ``no_alias_functions`` rule with the config below:
 

+ 31 - 0
doc/rules/alias/no_alias_language_construct_call.rst

@@ -0,0 +1,31 @@
+=========================================
+Rule ``no_alias_language_construct_call``
+=========================================
+
+Master language constructs shall be used instead of aliases.
+
+Examples
+--------
+
+Example #1
+~~~~~~~~~~
+
+.. code-block:: diff
+
+   --- Original
+   +++ New
+   @@ -1,2 +1,2 @@
+    <?php
+   -die;
+   +exit;
+
+Rule sets
+---------
+
+The rule is part of the following rule sets:
+
+@Symfony
+  Using the ``@Symfony`` rule set will enable the ``no_alias_language_construct_call`` rule.
+
+@PhpCsFixer
+  Using the ``@PhpCsFixer`` rule set will enable the ``no_alias_language_construct_call`` rule.

+ 9 - 0
doc/rules/alias/pow_to_exponentiation.rst

@@ -28,6 +28,12 @@ Rule sets
 
 The rule is part of the following rule sets:
 
+@Symfony:risky
+  Using the ``@Symfony:risky`` rule set will enable the ``pow_to_exponentiation`` rule.
+
+@PhpCsFixer:risky
+  Using the ``@PhpCsFixer:risky`` rule set will enable the ``pow_to_exponentiation`` rule.
+
 @PHP56Migration:risky
   Using the ``@PHP56Migration:risky`` rule set will enable the ``pow_to_exponentiation`` rule.
 
@@ -37,5 +43,8 @@ The rule is part of the following rule sets:
 @PHP71Migration:risky
   Using the ``@PHP71Migration:risky`` rule set will enable the ``pow_to_exponentiation`` rule.
 
+@PHP74Migration:risky
+  Using the ``@PHP74Migration:risky`` rule set will enable the ``pow_to_exponentiation`` rule.
+
 @PHP80Migration:risky
   Using the ``@PHP80Migration:risky`` rule set will enable the ``pow_to_exponentiation`` rule.

+ 5 - 0
doc/rules/alias/random_api_migration.rst

@@ -73,6 +73,11 @@ The rule is part of the following rule sets:
 
   ``['replacements' => ['mt_rand' => 'random_int', 'rand' => 'random_int']]``
 
+@PHP74Migration:risky
+  Using the ``@PHP74Migration:risky`` rule set will enable the ``random_api_migration`` rule with the config below:
+
+  ``['replacements' => ['mt_rand' => 'random_int', 'rand' => 'random_int']]``
+
 @PHP80Migration:risky
   Using the ``@PHP80Migration:risky`` rule set will enable the ``random_api_migration`` rule with the config below:
 

+ 15 - 0
doc/rules/array_notation/no_whitespace_before_comma_in_array.rst

@@ -60,3 +60,18 @@ The rule is part of the following rule sets:
 
 @PhpCsFixer
   Using the ``@PhpCsFixer`` rule set will enable the ``no_whitespace_before_comma_in_array`` rule with the default config.
+
+@PHP73Migration
+  Using the ``@PHP73Migration`` rule set will enable the ``no_whitespace_before_comma_in_array`` rule with the config below:
+
+  ``['after_heredoc' => true]``
+
+@PHP74Migration
+  Using the ``@PHP74Migration`` rule set will enable the ``no_whitespace_before_comma_in_array`` rule with the config below:
+
+  ``['after_heredoc' => true]``
+
+@PHP80Migration
+  Using the ``@PHP80Migration`` rule set will enable the ``no_whitespace_before_comma_in_array`` rule with the config below:
+
+  ``['after_heredoc' => true]``

Some files were not shown because too many files changed in this diff