Browse Source

Merge branch 'master' into 3.0

* master:
  Add Gitlab Reporter
  NoExtraBlankLinesFixer - fix candidate detection
  code grooming
  Fix short list syntax detection.
  Handle more priority tests cases
  Define priority between LineEndingFixer and BracesFixer
  PhpUnitTestCaseStaticMethodCallsFixer - prepare for PHPUnit 8
SpacePossum 6 years ago
parent
commit
1fbe35040c

+ 0 - 1
src/AbstractNoUselessElseFixer.php

@@ -12,7 +12,6 @@
 
 namespace PhpCsFixer;
 
-use PhpCsFixer\Tokenizer\Token;
 use PhpCsFixer\Tokenizer\Tokens;
 
 /**

+ 1 - 1
src/Cache/SignatureInterface.php

@@ -47,7 +47,7 @@ interface SignatureInterface
     /**
      * @param SignatureInterface $signature
      *
-     * @return mixed
+     * @return bool
      */
     public function equals(self $signature);
 }

+ 1 - 0
src/Console/Command/DescribeCommand.php

@@ -235,6 +235,7 @@ final class DescribeCommand extends Command
             $output->writeln('');
         }
 
+        /** @var CodeSampleInterface[] $codeSamples */
         $codeSamples = array_filter($definition->getCodeSamples(), static function (CodeSampleInterface $codeSample) {
             if ($codeSample instanceof VersionSpecificCodeSampleInterface) {
                 return $codeSample->isSuitableFor(\PHP_VERSION_ID);

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

@@ -126,7 +126,7 @@ class Foo
      */
     public function getPriority()
     {
-        // should be run after the ElseIfFixer, NoEmptyStatementFixer and NoUselessElseFixer
+        // should be run after the ElseIfFixer, LineEndingFixer, NoEmptyStatementFixer and NoUselessElseFixer
         return -25;
     }
 

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

@@ -93,7 +93,7 @@ final class NonPrintableCharacterFixer extends AbstractFixer implements Configur
      */
     public function isCandidate(Tokens $tokens)
     {
-        return \count($tokens) > 1 && $tokens->isAnyTokenKindsFound(self::$tokens);
+        return $tokens->isAnyTokenKindsFound(self::$tokens);
     }
 
     /**

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

@@ -67,6 +67,7 @@ final class NoAlternativeSyntaxFixer extends AbstractFixer
      */
     public function getPriority()
     {
+        // Should run before BracesFixer and ElseifFixer
         return 1;
     }
 

+ 2 - 0
src/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixer.php

@@ -82,6 +82,7 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractFixer implemen
         'assertClassNotHasAttribute' => true,
         'assertClassNotHasStaticAttribute' => true,
         'assertContains' => true,
+        'assertContainsEquals' => true,
         'assertContainsOnly' => true,
         'assertContainsOnlyInstancesOf' => true,
         'assertCount' => true,
@@ -147,6 +148,7 @@ final class PhpUnitTestCaseStaticMethodCallsFixer extends AbstractFixer implemen
         'assertLessThanOrEqual' => true,
         'assertNan' => true,
         'assertNotContains' => true,
+        'assertNotContainsEquals' => true,
         'assertNotContainsOnly' => true,
         'assertNotCount' => true,
         'assertNotEmpty' => true,

+ 1 - 1
src/Fixer/Phpdoc/PhpdocOrderFixer.php

@@ -45,7 +45,7 @@ final class PhpdocOrderFixer extends AbstractFixer
 /**
  * Hello there!
  *
- * @throws Exception|RuntimeException dfsdf
+ * @throws Exception|RuntimeException foo
  * @custom Test!
  * @return int  Return the number of changes.
  * @param string $foo

+ 0 - 1
src/Fixer/Phpdoc/PhpdocSummaryFixer.php

@@ -14,7 +14,6 @@ namespace PhpCsFixer\Fixer\Phpdoc;
 
 use PhpCsFixer\AbstractFixer;
 use PhpCsFixer\DocBlock\DocBlock;
-use PhpCsFixer\DocBlock\Line;
 use PhpCsFixer\DocBlock\ShortDescription;
 use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
 use PhpCsFixer\FixerDefinition\CodeSample;

+ 1 - 0
src/Fixer/Whitespace/ArrayIndentationFixer.php

@@ -50,6 +50,7 @@ final class ArrayIndentationFixer extends AbstractFixer implements WhitespacesAw
     public function getPriority()
     {
         // should run after BracesFixer, MethodChainingIndentationFixer
+        // should run before AlignMultilineCommentFixer and BinaryOperatorSpacesFixer
         return -30;
     }
 

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