fix(php): do not indent after class/enum decl

This commit is contained in:
再生花 2024-07-09 10:12:29 +09:00 committed by GitHub
parent ebdffa78bd
commit 53c79ddc28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,12 @@
<?php
enum DaysOfWeek: int
{
case Sunday = 0;
case Monday = 1;
}
class Foo {
public int $id;
public string $brand;
}
?>

View file

@ -62,5 +62,10 @@ describe("indent PHP:", function()
run:new_line("issue-4848.php", { on_line = 64, text = "return $a;", indent = 12 })
run:new_line("issue-4848.php", { on_line = 65, text = "$a,", indent = 8 })
run:new_line("issue-4848.php", { on_line = 66, text = "$a;", indent = 0 })
run:new_line("issue-6888.php", { on_line = 2, text = "$a;", indent = 0 })
run:new_line("issue-6888.php", { on_line = 3, text = "case Funday = 2;", indent = 4 })
run:new_line("issue-6888.php", { on_line = 6, text = "$a;", indent = 0 })
run:new_line("issue-6888.php", { on_line = 8, text = "$a;", indent = 4 })
run:new_line("issue-6888.php", { on_line = 11, text = "$a;", indent = 0 })
end)
end)