Browse Source

Merge branch '2.2' into 2.9

Dariusz Ruminski 7 years ago
parent
commit
801904ec3c

+ 21 - 6
doc/COOKBOOK-FIXERS.md

@@ -78,9 +78,9 @@ final class RemoveCommentsFixer extends AbstractFixer
     /**
      * {@inheritdoc}
      */
-    public function getDescription()
+    public function getDefinition()
     {
-        // Return a short description of the Fixer, it will be used in the README.rst.
+        // Return a definition of the fixer, it will be used in the README.rst.
     }
 }
 ```
@@ -235,9 +235,16 @@ final class RemoveCommentsFixer extends AbstractFixer
     /**
      * {@inheritdoc}
      */
-    public function getDescription()
+    public function getDefinition()
     {
-        return 'Removes all comments of the code that are preceded by ";" (semicolon).'; // Trailing dot is important. We thrive to use English grammar properly.
+        return new FixerDefinition(
+            'Removes all comments of the code that are preceded by ";" (semicolon).', // Trailing dot is important. We thrive to use English grammar properly.
+            [
+                new CodeSample(
+                    '<?php echo 123; /* Comment */'
+                ),
+            ]
+        );
     }
 }
 ```
@@ -402,8 +409,16 @@ final class RemoveCommentsFixer extends AbstractFixer {
     /**
      * {@inheritdoc}
      */
-    public function getDescription() {
-        return 'Removes all comments of the code that are preceded by ";" (semicolon).';// Trailing dot is important. We thrive to use English grammar properly.
+    public function getDefinition()
+    {
+        return new FixerDefinition(
+            'Removes all comments of the code that are preceded by ";" (semicolon).', // Trailing dot is important. We thrive to use English grammar properly.
+            [
+                new CodeSample(
+                    '<?php echo 123; /* Comment */'
+                ),
+            ]
+        );
     }
 
     /**

+ 0 - 8
src/Fixer/Import/OrderedImportsFixer.php

@@ -237,14 +237,6 @@ use function CCC\AA;
         ]);
     }
 
-    /**
-     * {@inheritdoc}
-     */
-    protected function getDescription()
-    {
-        return 'Ordering use statements.';
-    }
-
     /**
      * This method is used for sorting the uses in a namespace.
      *

+ 1 - 1
tests/AutoReview/ProjectCodeTest.php

@@ -116,7 +116,7 @@ final class ProjectCodeTest extends TestCase
 
         $exceptionMethods = [
             'configure', // due to AbstractFixer::configure
-            'getConfigurationDefinition', // due to AbstractFixer::getDefaultConfiguration
+            'getConfigurationDefinition', // due to AbstractFixer::getConfigurationDefinition
             'getDefaultConfiguration', // due to AbstractFixer::getDefaultConfiguration
             'setWhitespacesConfig', // due to AbstractFixer::setWhitespacesConfig
         ];