@@ -19,7 +19,6 @@ composer require --dev kubawerlos/php-cs-fixer-custom-fixers
1919In your PHP CS Fixer configuration register fixers and use them:
2020``` diff
2121 <?php
22-
2322 return PhpCsFixer\Config::create()
2423+ ->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers())
2524 ->setRules([
@@ -28,7 +27,6 @@ In your PHP CS Fixer configuration register fixers and use them:
2827+ PhpCsFixerCustomFixers\Fixer\NoLeadingSlashInGlobalNamespaceFixer::name() => true,
2928+ PhpCsFixerCustomFixers\Fixer\NoTwoConsecutiveEmptyLinesFixer::name() => true,
3029 ]);
31-
3230```
3331
3432
@@ -38,14 +36,13 @@ In your PHP CS Fixer configuration register fixers and use them:
3836 <?php
3937- implode($foo, "") . implode($bar);
4038+ implode("", $foo) . implode('', $bar);
41-
4239```
4340
4441- ** NoDoctrineMigrationsGeneratedCommentFixer** - there must be no comment generated by Doctrine Migrations.
4542``` diff
43+ <?php
4644 namespace Migrations;
4745 use Doctrine\DBAL\Schema\Schema;
48- use Doctrine\Migrations\AbstractMigration;
4946- /**
5047- * Auto-generated Migration: Please modify to your needs!
5148- */
@@ -62,7 +59,6 @@ In your PHP CS Fixer configuration register fixers and use them:
6259 $this->addSql("UPDATE t1 SET col1 = col1 - 1");
6360 }
6461 }
65-
6662```
6763
6864- ** NoLeadingSlashInGlobalNamespaceFixer** - when in global namespace there must be no leading slash for class.
@@ -72,7 +68,6 @@ In your PHP CS Fixer configuration register fixers and use them:
7268+ $x = new Foo();
7369 namespace Bar;
7470 $y = new \Baz();
75-
7671```
7772
7873- ** NoPhpStormGeneratedCommentFixer** - there must be no comment generated by PhpStorm.
@@ -85,7 +80,6 @@ In your PHP CS Fixer configuration register fixers and use them:
8580- * Time: 12:00
8681- */
8782 namespace Foo;
88-
8983```
9084
9185- ** NoTwoConsecutiveEmptyLinesFixer** - there must be no two consecutive empty lines in code.
@@ -95,7 +89,6 @@ In your PHP CS Fixer configuration register fixers and use them:
9589
9690-
9791 class Bar {};
98-
9992```
10093
10194- ** NoUselessClassCommentFixer** - there must be no comment like: "Class FooBar".
@@ -106,19 +99,17 @@ In your PHP CS Fixer configuration register fixers and use them:
10699 * Class to do something
107100 */
108101 class FooBar {}
109-
110102```
111103
112104- ** NoUselessConstructorCommentFixer** - there must be no comment like: "Foo constructor".
113105``` diff
114- class Foo
115- {
106+ <?php
107+ class Foo {
116108 /**
117109- * Foo constructor
118110 */
119111 public function __construct() {}
120112 }
121-
122113```
123114
124115- ** NoUselessDoctrineRepositoryCommentFixer** - there must be no comment generated by the Doctrine ORM.
@@ -131,7 +122,6 @@ In your PHP CS Fixer configuration register fixers and use them:
131122- * repository methods below.
132123- */
133124 class FooRepository extends EntityRepository {}
134-
135125```
136126
137127- ** PhpdocNoIncorrectVarAnnotationFixer** - ` @var ` must be correct in the code.
@@ -140,7 +130,6 @@ In your PHP CS Fixer configuration register fixers and use them:
140130- /** @var Foo $foo */
141131+
142132 $bar = new Foo();
143-
144133```
145134
146135- ** PhpdocParamTypeFixer** - ` @param ` must have type.
@@ -152,7 +141,6 @@ In your PHP CS Fixer configuration register fixers and use them:
152141+ * @param mixed $bar
153142 */
154143 function a($foo, $bar) {}
155-
156144```
157145
158146- ** PhpdocSingleLineVarFixer** - ` @var ` annotation must be in single line when is the only content.
@@ -165,7 +153,6 @@ In your PHP CS Fixer configuration register fixers and use them:
165153+ /** @var string */
166154 private $name;
167155 }
168-
169156```
170157
171158- ** PhpdocVarAnnotationCorrectOrderFixer** - ` @var ` annotation must have type and name in the correct order.
@@ -174,7 +161,6 @@ In your PHP CS Fixer configuration register fixers and use them:
174161- /** @var $foo int */
175162+ /** @var int $foo */
176163 $foo = 2 + 2;
177-
178164```
179165
180166
0 commit comments