Skip to content

Commit

Permalink
minor PHP-CS-Fixer#5590 Docs: HeaderCommentFixer - document example h…
Browse files Browse the repository at this point in the history
…ow to remove header comment (keradus)

This PR was squashed before being merged into the 2.18 branch.

Discussion
----------

Docs: HeaderCommentFixer - document example how to remove header comment

Commits
-------

def06db Docs: HeaderCommentFixer - document example how to remove header comment
  • Loading branch information
keradus committed Apr 3, 2021
2 parents f669ea6 + def06db commit 9bf2760
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
21 changes: 21 additions & 0 deletions doc/rules/comment/header_comment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 16 additions & 0 deletions src/Fixer/Comment/HeaderCommentFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ public function getDefinition()
'location' => 'after_declare_strict',
]
),
new CodeSample(
'<?php
declare(strict_types=1);
/*
* Comment is not wanted here.
*/
namespace A\B;
echo 1;
',
[
'header' => '',
]
),
]
);
}
Expand Down

0 comments on commit 9bf2760

Please sign in to comment.