Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Configuration/Defaults/CommonRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer;
use PhpCsFixer\Fixer\Casing\MagicMethodCasingFixer;
use PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer;
use PhpCsFixer\Fixer\Casing\NativeTypeDeclarationCasingFixer;
use PhpCsFixer\Fixer\CastNotation\CastSpacesFixer;
use PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer;
use PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer;
Expand Down Expand Up @@ -368,6 +369,7 @@ class CommonRules extends Rules
NoMultilineWhitespaceAroundDoubleArrowFixer::class => true,
CompactEmptyArrayFixer::class => true,
ClassKeywordFixer::class => true,
NativeTypeDeclarationCasingFixer::class => true,
NamedArgumentFixer::class => true,
NoBlankLinesAfterPhpdocFixer::class => true,
ConstantCaseFixer::class => true,
Expand Down
1 change: 1 addition & 0 deletions tests/codestyle/CommonRulesetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static function providePhp81Fixtures(): array
return [
["enums"],
["readonlies"],
["nativeFunctionTypeDeclarations"],
];
}

Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/enums/actual.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

enum Status: string
{
case ACTIVE = "active";
case INACTIVE = "inactive";
case Active = "active";
case Inactive = "inactive";
}
4 changes: 2 additions & 2 deletions tests/fixtures/enums/expected.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

enum Status: string
{
case ACTIVE = "active";
case INACTIVE = "inactive";
case Active = "active";
case Inactive = "inactive";
}
12 changes: 12 additions & 0 deletions tests/fixtures/nativeFunctionTypeDeclarations/actual.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

enum Status: String
{
case Active = "active";
}
enum Priority: Int
{
case High = 1;
}
12 changes: 12 additions & 0 deletions tests/fixtures/nativeFunctionTypeDeclarations/expected.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

enum Status: string
{
case Active = "active";
}
enum Priority: int
{
case High = 1;
}