File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
tests/Integration/Fixtures Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 50
50
use PhpCsFixer \Fixer \Basic \PsrAutoloadingFixer ;
51
51
use PhpCsFixer \Fixer \Basic \SingleLineEmptyBodyFixer ;
52
52
use PhpCsFixer \Fixer \Casing \ClassReferenceNameCasingFixer ;
53
+ use PhpCsFixer \Fixer \Casing \MagicConstantCasingFixer ;
53
54
use PhpCsFixer \Fixer \Casing \MagicMethodCasingFixer ;
54
55
use PhpCsFixer \Fixer \Casing \NativeFunctionCasingFixer ;
55
56
use PhpCsFixer \Fixer \Casing \NativeTypeDeclarationCasingFixer ;
258
259
PsrAutoloadingFixer::class,
259
260
// When referencing an internal class it must be written using the correct casing.
260
261
ClassReferenceNameCasingFixer::class,
262
+ // Magic constants should be referred to using the correct casing.
263
+ MagicConstantCasingFixer::class,
261
264
// Magic method definitions and calls must be using the correct casing
262
265
MagicMethodCasingFixer::class,
263
266
// Function defined by PHP should be called using the correct casing
Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ class Basic extends AbstractBasic implements InterfaceFromThisNamespace // Fully
15
15
16
16
protected int $ myProperty = 666 ; // OrderedClassElementsFixer
17
17
18
+ // MagicMethodCasingFixer, OrderedClassElementsFixer
19
+ public function __toString (): string
20
+ {
21
+ return '' ;
22
+ }
23
+
18
24
public function isEqual ($ a , ?string $ b ): ?bool // VisibilityRequiredFixer, CompactNullableTypeDeclarationFixer
19
25
{
20
26
// TrimArraySpacesFixer
@@ -44,6 +50,8 @@ class Basic extends AbstractBasic implements InterfaceFromThisNamespace // Fully
44
50
45
51
public function fooBar (mixed $ foo ): mixed // FunctionDeclarationFixer
46
52
{
53
+ // MagicConstantCasingFixer
54
+ $ magicConstant = __DIR__ ;
47
55
$ value = 5 ;
48
56
// FunctionDeclarationFixer
49
57
$ function = function ($ foo ) use ($ value ) {
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ class Basic extends \Some\Other\Namespace\AbstractBasic implements \Lmc\CodingSt
36
36
37
37
public function fooBar ( mixed $ foo ): mixed // FunctionDeclarationFixer
38
38
{
39
+ // MagicConstantCasingFixer
40
+ $ magicConstant = __dir__;
39
41
$ value = 5 ;
40
42
// FunctionDeclarationFixer
41
43
$ function = function ($ foo )use ($ value ) {
@@ -158,4 +160,10 @@ but should be heredoc instead';
158
160
// NullableTypeDeclarationForDefaultNullValueFixer
159
161
string $ anotherNullableValue = null ,
160
162
): void {}
163
+
164
+ // MagicMethodCasingFixer, OrderedClassElementsFixer
165
+ public function __ToString (): string
166
+ {
167
+ return '' ;
168
+ }
161
169
}
You can’t perform that action at this time.
0 commit comments