Browse Source

Merge branch '2.18'

Dariusz Ruminski 4 years ago
parent
commit
e62026871b

+ 1 - 1
src/AbstractNoUselessElseFixer.php

@@ -25,7 +25,7 @@ abstract class AbstractNoUselessElseFixer extends AbstractFixer
     public function getPriority()
     {
         // should be run before NoWhitespaceInBlankLineFixer, NoExtraBlankLinesFixer, BracesFixer and after NoEmptyStatementFixer.
-        return 25;
+        return 39;
     }
 
     /**

+ 1 - 1
src/Fixer/Alias/NoAliasFunctionsFixer.php

@@ -178,7 +178,7 @@ mbereg_search_getregs();
      */
     public function getPriority()
     {
-        return 0;
+        return 40;
     }
 
     /**

+ 1 - 1
src/Fixer/Alias/PowToExponentiationFixer.php

@@ -58,7 +58,7 @@ final class PowToExponentiationFixer extends AbstractFunctionReferenceFixer
      */
     public function getPriority()
     {
-        return 3;
+        return 32;
     }
 
     /**

+ 1 - 1
src/Fixer/Basic/BracesFixer.php

@@ -130,7 +130,7 @@ class Foo
      */
     public function getPriority()
     {
-        return -25;
+        return 35;
     }
 
     /**

+ 16 - 0
src/Fixer/Basic/PsrAutoloadingFixer.php

@@ -61,6 +61,18 @@ class InvalidName {}
         );
     }
 
+    /**
+     * {@inheritdoc}
+     */
+    public function configure(array $configuration = null)
+    {
+        parent::configure($configuration);
+
+        if (null !== $this->configuration['dir']) {
+            $this->configuration['dir'] = realpath($this->configuration['dir']);
+        }
+    }
+
     /**
      * {@inheritdoc}
      */
@@ -137,6 +149,10 @@ class InvalidName {}
      */
     protected function applyFix(\SplFileInfo $file, Tokens $tokens)
     {
+        if (null !== $this->configuration['dir'] && 0 !== strpos($file->getRealPath(), $this->configuration['dir'])) {
+            return;
+        }
+
         $namespace = null;
         $namespaceStartIndex = null;
         $namespaceEndIndex = null;

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

@@ -304,7 +304,7 @@ class Sample
      */
     private function fixSpaceAboveClassElement(Tokens $tokens, $classStartIndex, $elementIndex, $spacing)
     {
-        static $methodAttr = [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];
+        static $methodAttr = [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];
 
         $nonWhiteAbove = null;
 

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

@@ -49,7 +49,7 @@ final class Example
      */
     public function getPriority()
     {
-        return 1;
+        return 36;
     }
 
     public function isCandidate(Tokens $tokens)

+ 1 - 0
src/Fixer/Comment/CommentToPhpdocFixer.php

@@ -55,6 +55,7 @@ final class CommentToPhpdocFixer extends AbstractFixer implements ConfigurationD
      * {@inheritdoc}
      *
      * Must run before GeneralPhpdocAnnotationRemoveFixer, GeneralPhpdocTagRenameFixer, NoBlankLinesAfterPhpdocFixer, NoEmptyPhpdocFixer, NoSuperfluousPhpdocTagsFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocAlignFixer, PhpdocAlignFixer, PhpdocAnnotationWithoutDotFixer, PhpdocInlineTagFixer, PhpdocInlineTagNormalizerFixer, PhpdocLineSpanFixer, PhpdocNoAccessFixer, PhpdocNoAliasTagFixer, PhpdocNoEmptyReturnFixer, PhpdocNoPackageFixer, PhpdocNoUselessInheritdocFixer, PhpdocOrderByValueFixer, PhpdocOrderFixer, PhpdocReturnSelfReferenceFixer, PhpdocSeparationFixer, PhpdocSingleLineVarSpacingFixer, PhpdocSummaryFixer, PhpdocTagCasingFixer, PhpdocTagTypeFixer, PhpdocToCommentFixer, PhpdocToParamTypeFixer, PhpdocToReturnTypeFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer, PhpdocTrimFixer, PhpdocTypesOrderFixer, PhpdocVarAnnotationCorrectOrderFixer, PhpdocVarWithoutNameFixer.
+     * Must run after AlignMultilineCommentFixer.
      */
     public function getPriority()
     {

+ 1 - 1
src/Fixer/ControlStructure/ElseifFixer.php

@@ -44,7 +44,7 @@ final class ElseifFixer extends AbstractFixer
      */
     public function getPriority()
     {
-        return 0;
+        return 40;
     }
 
     /**

+ 1 - 1
src/Fixer/ControlStructure/NoAlternativeSyntaxFixer.php

@@ -62,7 +62,7 @@ final class NoAlternativeSyntaxFixer extends AbstractFixer
      */
     public function getPriority()
     {
-        return 26;
+        return 42;
     }
 
     /**

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