Browse Source

Merge branch 'master' into 3.0

Dariusz Ruminski 4 years ago
parent
commit
9249b0c368

+ 1 - 1
.github/ISSUE_TEMPLATE/bug_report.md

@@ -1,7 +1,7 @@
 ---
 name: Bug report ๐Ÿ›
 about: Existing feature does not behave as expected.
-label: kind/bug
+labels: kind/bug
 ---
 
 ## Bug report

+ 1 - 1
.github/ISSUE_TEMPLATE/feature_request.md

@@ -1,7 +1,7 @@
 ---
 name: Feature request ๐Ÿš€
 about: I have a suggestion about a new feature (and may want to implement it)!
-label: kind/feature request
+labels: kind/feature request
 ---
 
 ## Feature request

+ 1 - 1
.github/ISSUE_TEMPLATE/rule_request.md

@@ -1,7 +1,7 @@
 ---
 name: Rule request โœ๏ธ
 about: I have a suggestion about a new rule (and may want to implement it)!
-label: kind/feature request
+labels: kind/feature request
 ---
 
 ## Rule request

+ 1 - 1
.github/ISSUE_TEMPLATE/support_question.md

@@ -1,7 +1,7 @@
 ---
 name: Support question โ“
 about: You have a question about how the tool works or how to use it.
-label: kind/question
+labels: kind/question
 ---
 
 ## Support question

+ 3 - 3
README.rst

@@ -193,14 +193,14 @@ apply (the rule names must be separated by a comma):
 
     $ php php-cs-fixer.phar fix /path/to/dir --rules=line_ending,full_opening_tag,indentation_type
 
-You can also blacklist the rules you don't want by placing a dash in front of the rule name, if this is more convenient,
+You can also exclude the rules you don't want by placing a dash in front of the rule name, if this is more convenient,
 using ``-name_of_fixer``:
 
 .. code-block:: bash
 
     $ php php-cs-fixer.phar fix /path/to/dir --rules=-full_opening_tag,-indentation_type
 
-When using combinations of exact and blacklist rules, applying exact rules along with above blacklisted results:
+When using combinations of exact and exclude rules, applying exact rules along with above excluded results:
 
 .. code-block:: bash
 
@@ -2069,7 +2069,7 @@ Both ``exclude`` and ``notPath`` methods accept only relative paths to the ones
 See `Symfony\\Finder <https://symfony.com/doc/current/components/finder.html>`_
 online documentation for other `Finder` methods.
 
-You may also use a blacklist for the rules instead of the above shown whitelist approach.
+You may also use an exclude list for the rules instead of the above shown include approach.
 The following example shows how to use all ``Symfony`` rules but the ``full_opening_tag`` rule.
 
 .. code-block:: php

+ 3 - 3
src/Console/Command/HelpCommand.php

@@ -93,12 +93,12 @@ apply (the rule names must be separated by a comma):
 
     <info>$ php %command.full_name% /path/to/dir --rules=line_ending,full_opening_tag,indentation_type</info>
 
-You can also blacklist the rules you don't want by placing a dash in front of the rule name, if this is more convenient,
+You can also exclude the rules you don't want by placing a dash in front of the rule name, if this is more convenient,
 using <comment>-name_of_fixer</comment>:
 
     <info>$ php %command.full_name% /path/to/dir --rules=-full_opening_tag,-indentation_type</info>
 
-When using combinations of exact and blacklist rules, applying exact rules along with above blacklisted results:
+When using combinations of exact and exclude rules, applying exact rules along with above excluded results:
 
     <info>$ php %command.full_name% /path/to/project --rules=@Symfony,-@PSR1,-blank_line_before_statement,strict_comparison</info>
 
@@ -199,7 +199,7 @@ Both ``exclude`` and ``notPath`` methods accept only relative paths to the ones
 See `Symfony\Finder` (<url>https://symfony.com/doc/current/components/finder.html</url>)
 online documentation for other `Finder` methods.
 
-You may also use a blacklist for the rules instead of the above shown whitelist approach.
+You may also use an exclude list for the rules instead of the above shown include approach.
 The following example shows how to use all ``Symfony`` rules but the ``full_opening_tag`` rule.
 
     <?php

+ 1 - 1
src/DocBlock/Annotation.php

@@ -302,7 +302,7 @@ final class Annotation
             }
 
             $matchingResult = Preg::match(
-                '{^(?:\s*\*|/\*\*)\s*@'.$name.'\s+'.self::REGEX_TYPES.'(?:[*\h].*)?$}sx',
+                '{^(?:\s*\*|/\*\*)\s*@'.$name.'\s+'.self::REGEX_TYPES.'(?:[*\h\v].*)?$}sx',
                 $this->lines[0]->getContent(),
                 $matches
             );

+ 1 - 1
src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php

@@ -127,7 +127,7 @@ class Sample
      * {@inheritdoc}
      *
      * Must run before BracesFixer, IndentationTypeFixer.
-     * Must run after OrderedClassElementsFixer.
+     * Must run after OrderedClassElementsFixer, SingleClassElementPerStatementFixer.
      */
     public function getPriority()
     {

+ 3 - 3
src/Fixer/ClassNotation/FinalInternalClassFixer.php

@@ -45,7 +45,7 @@ final class FinalInternalClassFixer extends AbstractFixer implements Configurabl
         );
 
         if (\count($intersect)) {
-            throw new InvalidFixerConfigurationException($this->getName(), sprintf('Annotation cannot be used in both the white- and black list, got duplicates: "%s".', implode('", "', array_keys($intersect))));
+            throw new InvalidFixerConfigurationException($this->getName(), sprintf('Annotation cannot be used in both the include and exclude list, got duplicates: "%s".', implode('", "', array_keys($intersect))));
         }
     }
 
@@ -206,7 +206,7 @@ final class FinalInternalClassFixer extends AbstractFixer implements Configurabl
             $tag = strtolower(substr(array_shift($matches), 1));
             foreach ($this->configuration['annotation_black_list'] as $tagStart => $true) {
                 if (0 === strpos($tag, $tagStart)) {
-                    return false; // ignore class: class-level PHPDoc contains tag that has been black listed through configuration
+                    return false; // ignore class: class-level PHPDoc contains tag that has been excluded through configuration
                 }
             }
 
@@ -215,7 +215,7 @@ final class FinalInternalClassFixer extends AbstractFixer implements Configurabl
 
         foreach ($this->configuration['annotation_white_list'] as $tag => $true) {
             if (!isset($tags[$tag])) {
-                return false; // ignore class: class-level PHPDoc does not contain all tags that has been white listed through configuration
+                return false; // ignore class: class-level PHPDoc does not contain all tags that has been included through configuration
             }
         }
 

+ 10 - 0
src/Fixer/ClassNotation/SingleClassElementPerStatementFixer.php

@@ -43,6 +43,16 @@ final class SingleClassElementPerStatementFixer extends AbstractFixer implements
         return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds());
     }
 
+    /**
+     * {@inheritdoc}
+     *
+     * Must run before ClassAttributesSeparationFixer.
+     */
+    public function getPriority()
+    {
+        return 56;
+    }
+
     /**
      * {@inheritdoc}
      */

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