|
27 | 27 | <div class="clearfix"> |
28 | 28 | <div class="logo_header"><a href="/">PHP Coding Standards Fixer</a></div> |
29 | 29 | <h1 class="title_header"> |
30 | | - <strong>Folding Bike (v3.89.0)</strong> edition |
| 30 | + <strong>Folding Bike (v3.89.1)</strong> edition |
31 | 31 | </h1> |
32 | 32 | </div> |
33 | 33 | </div> |
@@ -66,18 +66,24 @@ <h2>Background<a class="headerlink" href="#background" title="Permalink to this |
66 | 66 | discouraged - it is meant only to give more people more chance to |
67 | 67 | contribute, and to detect bugs (<a class="reference external" href="https://en.wikipedia.org/wiki/Linus%27s_Law">Linus’s Law</a>).</p> |
68 | 68 | <p>If possible, try to get acquainted with the public interface for the |
69 | | -<a class="reference external" href="https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.89.0/src/Tokenizer/Tokens.php">PhpCsFixer\Tokenizer\Tokens</a> and |
70 | | -<a class="reference external" href="https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.89.0/src/Tokenizer/Token.php">PhpCsFixer\Tokenizer\Token</a> classes.</p> |
| 69 | +<a class="reference external" href="https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.89.1/src/Tokenizer/Tokens.php">PhpCsFixer\Tokenizer\Tokens</a> and |
| 70 | +<a class="reference external" href="https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.89.1/src/Tokenizer/Token.php">PhpCsFixer\Tokenizer\Token</a> classes.</p> |
71 | 71 | </section> |
72 | 72 | <section id="assumptions"> |
73 | 73 | <h2>Assumptions<a class="headerlink" href="#assumptions" title="Permalink to this heading">¶</a></h2> |
74 | 74 | <ul class="simple"> |
| 75 | +<li><p>You want to create a new fixer for PHP CS Fixer main repository.</p></li> |
75 | 76 | <li><p>You are familiar with Test Driven Development.</p></li> |
76 | 77 | <li><p>Forked PHP-CS-Fixer/PHP-CS-Fixer into your own GitHub Account.</p></li> |
77 | 78 | <li><p>Cloned your forked repository locally.</p></li> |
78 | 79 | <li><p>Installed the dependencies of PHP CS Fixer using <a class="reference external" href="https://getcomposer.org">Composer</a>.</p></li> |
79 | 80 | <li><p>You have read <a class="reference external" href="./../CONTRIBUTING.md">CONTRIBUTING.md</a>.</p></li> |
80 | 81 | </ul> |
| 82 | +<p>In case you want to create a custom fixer for your own use, you can |
| 83 | +follow this guide as well, but you will need to apply some changes on the go, |
| 84 | +for example use <a class="reference external" href="https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.89.1/src/Fixer/FixerInterface.php">PhpCsFixer\Fixer\FixerInterface</a> |
| 85 | +instead of <a class="reference external" href="https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.89.1/src/AbstractFixer.php">PhpCsFixer\AbstractFixer</a> (which is internal |
| 86 | +and not covered with BC promise).</p> |
81 | 87 | </section> |
82 | 88 | <section id="step-by-step"> |
83 | 89 | <h2>Step by step<a class="headerlink" href="#step-by-step" title="Permalink to this heading">¶</a></h2> |
@@ -131,8 +137,8 @@ <h3>Step 1 - Creating files<a class="headerlink" href="#step-1-creating-files" t |
131 | 137 | </pre></div> |
132 | 138 | </div> |
133 | 139 | <p>Note how the class and file name match. Also keep in mind that all |
134 | | -fixers must implement <code class="docutils literal notranslate"><span class="pre">Fixer\FixerInterface</span></code>. In this case, the fixer is |
135 | | -inheriting from <code class="docutils literal notranslate"><span class="pre">AbstractFixer</span></code>, which fulfills the interface with some |
| 140 | +fixers must implement <a class="reference external" href="https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.89.1/src/Fixer/FixerInterface.php">PhpCsFixer\Fixer\FixerInterface</a>. In this case, the fixer is |
| 141 | +inheriting from <a class="reference external" href="https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.89.1/src/AbstractFixer.php">PhpCsFixer\AbstractFixer</a>, which fulfills the interface with some |
136 | 142 | default behavior.</p> |
137 | 143 | <p>Now let us create the test file at |
138 | 144 | <code class="docutils literal notranslate"><span class="pre">tests/Fixer/Comment/RemoveCommentsFixerTest.php</span></code>. Put this content inside:</p> |
|
0 commit comments