diff options
| author | gbprod <contact@gb-prod.fr> | 2022-10-06 09:17:35 +0200 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-10-06 08:55:11 -0400 |
| commit | 84e23bd979ac17307e9cb5d93c6ec5b5a5bf1ba0 (patch) | |
| tree | a8b33d9e1dd03cf6d3a9cf6a0737c90200ca1411 | |
| parent | 07e5fcbaad1a503bdde87a62029be6e6d5beb06b (diff) | |
Fix php indent for short array declaration
| -rw-r--r-- | queries/php/indents.scm | 1 | ||||
| -rw-r--r-- | tests/indent/php/issue-3591.php | 5 | ||||
| -rw-r--r-- | tests/indent/php_spec.lua | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/queries/php/indents.scm b/queries/php/indents.scm index d9a356cb..aea769ad 100644 --- a/queries/php/indents.scm +++ b/queries/php/indents.scm @@ -6,6 +6,7 @@ (return_statement) (arguments) (formal_parameters) + "[" ] @indent [ diff --git a/tests/indent/php/issue-3591.php b/tests/indent/php/issue-3591.php new file mode 100644 index 00000000..30b90a6a --- /dev/null +++ b/tests/indent/php/issue-3591.php @@ -0,0 +1,5 @@ +<?php + +function test() { + $array = [ +} diff --git a/tests/indent/php_spec.lua b/tests/indent/php_spec.lua index 2ce64ab5..d0b08aa6 100644 --- a/tests/indent/php_spec.lua +++ b/tests/indent/php_spec.lua @@ -22,5 +22,6 @@ describe("indent PHP:", function() ) run:new_line("issue-2497.php", { on_line = 5, text = "$a =", indent = 4 }) run:new_line("unfinished-call.php", { on_line = 6, text = "$a =", indent = 0 }) + run:new_line("issue-3591.php", { on_line = 4, text = "$a =", indent = 8 }) end) end) |
