Browse Source

Merge branch '2.18'

Dariusz Ruminski 3 years ago
parent
commit
adea9b8ef5
2 changed files with 37 additions and 0 deletions
  1. 21 0
      doc/rules/comment/header_comment.rst
  2. 16 0
      src/Fixer/Comment/HeaderCommentFixer.php

+ 21 - 0
doc/rules/comment/header_comment.rst

@@ -110,3 +110,24 @@ With configuration: ``['header' => 'Made with love.', 'comment_type' => 'comment
     namespace A\B;
 
     echo 1;
+
+Example #4
+~~~~~~~~~~
+
+With configuration: ``['header' => '']``.
+
+.. code-block:: diff
+
+   --- Original
+   +++ New
+   @@ -1,10 +1,6 @@
+    <?php
+    declare(strict_types=1);
+
+   -/*
+   - * Comment is not wanted here.
+   - */
+   -
+    namespace A\B;
+
+    echo 1;

+ 16 - 0
src/Fixer/Comment/HeaderCommentFixer.php

@@ -102,6 +102,22 @@ echo 1;
                         'location' => 'after_declare_strict',
                     ]
                 ),
+                new CodeSample(
+                    '<?php
+declare(strict_types=1);
+
+/*
+ * Comment is not wanted here.
+ */
+
+namespace A\B;
+
+echo 1;
+',
+                    [
+                        'header' => '',
+                    ]
+                ),
             ]
         );
     }