Browse Source

Merge branch '2.0'

# Conflicts:
#	.travis.yml
Dariusz Ruminski 8 years ago
parent
commit
4fac6225fd

+ 1 - 1
.travis.yml

@@ -75,7 +75,7 @@ install:
 
 script:
     - if [ $TASK_SCA == 1 ]; then php php-cs-fixer fix --rules declare_strict_types,native_function_invocation -q; fi
-    - if [ $TASK_SCA == 1 ]; then files_with_trailing_spaces=`find . -type f -not -path "./.git/*" -not -path "./vendor/*" -not -path "./tests/Fixtures/*" -exec egrep -l " $" {} \;` && [[ $files_with_trailing_spaces ]] && echo $files_with_trailing_spaces && travis_terminate 1 || echo "No trailing spaces detected."; fi
+    - if [ $TASK_SCA == 1 ]; then files_with_trailing_spaces=`find . -type f -not -path "./.git/*" -not -path "./vendor/*" -not -path "./tests/Fixtures/*" -exec egrep -nH " $" {} \;` && [[ $files_with_trailing_spaces ]] && echo $files_with_trailing_spaces && travis_terminate 1 || echo "No trailing spaces detected."; fi
 
     - if [ $TASK_TESTS == 1 ] && [ $TASK_TESTS_COVERAGE == 0 ]; then vendor/bin/phpunit --verbose; fi
     - if [ $TASK_TESTS == 1 ] && [ $TASK_TESTS_COVERAGE == 1 ]; then phpdbg -qrr vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml; fi

+ 1 - 1
src/AbstractFunctionReferenceFixer.php

@@ -67,7 +67,7 @@ abstract class AbstractFunctionReferenceFixer extends AbstractFixer
         $matches = $tokens->findSequence($candidateSequence, $start, $end, false);
         if (null === $matches) {
             // not found, simply return without further attempts
-            return;
+            return null;
         }
 
         // translate results for humans

+ 1 - 1
src/DocBlock/Line.php

@@ -49,7 +49,7 @@ class Line
     /**
      * Get the content of this line.
      *
-     * @return int
+     * @return string
      */
     public function getContent()
     {

+ 2 - 2
src/Fixer/Comment/HeaderCommentFixer.php

@@ -42,7 +42,7 @@ final class HeaderCommentFixer extends AbstractFixer implements ConfigurableFixe
     /** @var string */
     private $headerComment;
 
-    /** @var int */
+    /** @var string */
     private $headerCommentType;
 
     /** @var int */
@@ -177,7 +177,7 @@ echo 1;
      * Enclose the given text in a comment block.
      *
      * @param string $header
-     * @param int    $type
+     * @param string $type
      *
      * @return string
      */

+ 3 - 3
src/Fixer/PhpUnit/PhpUnitConstructFixer.php

@@ -204,7 +204,7 @@ $this->assertNotSame(null, $d);
         );
 
         if (null === $sequence) {
-            return;
+            return null;
         }
 
         $sequenceIndexes = array_keys($sequence);
@@ -212,14 +212,14 @@ $this->assertNotSame(null, $d);
         $firstParameterToken = $tokens[$sequenceIndexes[4]];
 
         if (!$firstParameterToken->isNativeConstant()) {
-            return;
+            return null;
         }
 
         $sequenceIndexes[5] = $tokens->getNextMeaningfulToken($sequenceIndexes[4]);
 
         // return if first method argument is an expression, not value
         if (!$tokens[$sequenceIndexes[5]]->equals(',')) {
-            return;
+            return null;
         }
 
         $tokens[$sequenceIndexes[2]]->setContent($map[$firstParameterToken->getContent()]);

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

@@ -95,7 +95,7 @@ function foo () {}
 
             // no short description was found
             if ($line->containsATag()) {
-                return;
+                return null;
             }
 
             // we've reached content, but need to check the next lines too

+ 4 - 4
src/FixerDefinition/FileSpecificCodeSample.php

@@ -25,14 +25,14 @@ final class FileSpecificCodeSample implements FileSpecificCodeSampleInterface
     private $codeSample;
 
     /**
-     * @var SplFileInfo
+     * @var \SplFileInfo
      */
     private $splFileInfo;
 
     /**
-     * @param string      $code
-     * @param SplFileInfo $splFileInfo
-     * @param null|array  $configuration
+     * @param string       $code
+     * @param \SplFileInfo $splFileInfo
+     * @param null|array   $configuration
      */
     public function __construct(
         $code,

+ 1 - 1
src/FixerDefinition/FileSpecificCodeSampleInterface.php

@@ -20,7 +20,7 @@ namespace PhpCsFixer\FixerDefinition;
 interface FileSpecificCodeSampleInterface extends CodeSampleInterface
 {
     /**
-     * @return SplFileInfo
+     * @return \SplFileInfo
      */
     public function getSplFileInfo();
 }

+ 3 - 3
src/Report/TextReporter.php

@@ -88,9 +88,9 @@ final class TextReporter implements ReporterInterface
     }
 
     /**
-     * @param float $time
-     * @param float $memory
-     * @param bool  $isDryRun
+     * @param int  $time
+     * @param int  $memory
+     * @param bool $isDryRun
      *
      * @return string
      */

+ 1 - 1
src/RuleSet.php

@@ -216,7 +216,7 @@ final class RuleSet implements RuleSetInterface
         }
 
         if ($this->rules[$rule] === true) {
-            return;
+            return null;
         }
 
         return $this->rules[$rule];

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