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 5050use PhpCsFixer \Fixer \Basic \PsrAutoloadingFixer ;
5151use PhpCsFixer \Fixer \Basic \SingleLineEmptyBodyFixer ;
5252use PhpCsFixer \Fixer \Casing \ClassReferenceNameCasingFixer ;
53+ use PhpCsFixer \Fixer \Casing \MagicConstantCasingFixer ;
5354use PhpCsFixer \Fixer \Casing \MagicMethodCasingFixer ;
5455use PhpCsFixer \Fixer \Casing \NativeFunctionCasingFixer ;
5556use PhpCsFixer \Fixer \Casing \NativeTypeDeclarationCasingFixer ;
258259 PsrAutoloadingFixer::class,
259260 // When referencing an internal class it must be written using the correct casing.
260261 ClassReferenceNameCasingFixer::class,
262+ // Magic constants should be referred to using the correct casing.
263+ MagicConstantCasingFixer::class,
261264 // Magic method definitions and calls must be using the correct casing
262265 MagicMethodCasingFixer::class,
263266 // 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
1515
1616 protected int $ myProperty = 666 ; // OrderedClassElementsFixer
1717
18+ // MagicMethodCasingFixer, OrderedClassElementsFixer
19+ public function __toString (): string
20+ {
21+ return '' ;
22+ }
23+
1824 public function isEqual ($ a , ?string $ b ): ?bool // VisibilityRequiredFixer, CompactNullableTypeDeclarationFixer
1925 {
2026 // TrimArraySpacesFixer
@@ -44,6 +50,8 @@ class Basic extends AbstractBasic implements InterfaceFromThisNamespace // Fully
4450
4551 public function fooBar (mixed $ foo ): mixed // FunctionDeclarationFixer
4652 {
53+ // MagicConstantCasingFixer
54+ $ magicConstant = __DIR__ ;
4755 $ value = 5 ;
4856 // FunctionDeclarationFixer
4957 $ 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
3636
3737 public function fooBar ( mixed $ foo ): mixed // FunctionDeclarationFixer
3838 {
39+ // MagicConstantCasingFixer
40+ $ magicConstant = __dir__;
3941 $ value = 5 ;
4042 // FunctionDeclarationFixer
4143 $ function = function ($ foo )use ($ value ) {
@@ -158,4 +160,10 @@ but should be heredoc instead';
158160 // NullableTypeDeclarationForDefaultNullValueFixer
159161 string $ anotherNullableValue = null ,
160162 ): void {}
163+
164+ // MagicMethodCasingFixer, OrderedClassElementsFixer
165+ public function __ToString (): string
166+ {
167+ return '' ;
168+ }
161169}
You can’t perform that action at this time.
0 commit comments