File tree Expand file tree Collapse file tree 3 files changed +22
-9
lines changed
Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Original file line number Diff line number Diff line change 134134 "Ternary" : true ,
135135 "This" : true ,
136136 "Throw_" : true ,
137- "TrueValue" : true ,
137+ "TrueValue" : {
138+ "ignore" : [
139+ " PhpCsFixerCustomFixers\\ Fixer\\ ClassConstantUsageFixer::getClassConstants"
140+ ]
141+ },
138142 "UnwrapArrayChangeKeyCase" : true ,
139143 "UnwrapArrayChunk" : true ,
140144 "UnwrapArrayColumn" : true ,
Original file line number Diff line number Diff line change @@ -94,6 +94,12 @@ public function build(): array
9494 ],
9595 ];
9696
97+ $ config ['mutators ' ]['TrueValue ' ] = [
98+ 'ignore ' => [
99+ 'PhpCsFixerCustomFixers \\Fixer \\ClassConstantUsageFixer::getClassConstants ' ,
100+ ],
101+ ];
102+
97103 return $ config ;
98104 }
99105}
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ public function f()
5050 }
5151 PHP,
5252 ];
53+
5354 yield 'multiple constants with the same value ' => [
5455 <<<'PHP'
5556 <?php
@@ -68,26 +69,28 @@ public function f()
6869 yield 'constants all over the class ' => [
6970 <<<'PHP'
7071 <?php
71- class Foo
72+ class C
7273 {
73- public const BAR = 'bar';
74+ public const FOO = 'foo';
75+ public const F00 = 0;
7476 public function f()
7577 {
76- return self::BAR . self::BAZ ;
78+ return 'Hello ' . self::FOO . self::BAR . '!' ;
7779 }
78- public const BAZ = 'baz ';
80+ public const BAR = 'bar ';
7981 }
8082 PHP,
8183 <<<'PHP'
8284 <?php
83- class Foo
85+ class C
8486 {
85- public const BAR = 'bar';
87+ public const FOO = 'foo';
88+ public const F00 = 0;
8689 public function f()
8790 {
88- return 'bar' . 'baz ';
91+ return 'Hello ' . 'foo' . ' bar' . '! ';
8992 }
90- public const BAZ = 'baz ';
93+ public const BAR = 'bar ';
9194 }
9295 PHP,
9396 ];
You can’t perform that action at this time.
0 commit comments