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
7 changes: 7 additions & 0 deletions blink/internal/fixer/rules/concat_space.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ func spaceAttributeConcat(value string, none bool) (string, bool) {
}
continue
}
if c == '<' && strings.HasPrefix(value[i:], "<<<") {
if end := heredocEnd(value, i); end > i {
b = append(b, value[i:end]...)
i = end - 1
continue
}
}
if c == '\'' || c == '"' {
quote = c
b = append(b, c)
Expand Down
1 change: 1 addition & 0 deletions blink/internal/fixer/rules/concat_space_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestConcatSpaceConfigCases(t *testing.T) {
{"float literal in attribute left alone", ConcatSpace{}, "<?php #[X(1.5)]\nclass C {}", "<?php #[X(1.5)]\nclass C {}"},
{"spread in attribute left alone", ConcatSpace{}, "<?php #[X(...$a)]\nclass C {}", "<?php #[X(...$a)]\nclass C {}"},
{"scope resolution in attribute left alone", ConcatSpace{}, "<?php #[X(self::A.'b')]\nclass C {}", "<?php #[X(self::A . 'b')]\nclass C {}"},
{"dot inside attribute heredoc left alone", ConcatSpace{}, "<?php #[X(help: <<<'TXT'\n%command.name% runs.\nTXT, __DIR__.'/x')]\nclass C {}", "<?php #[X(help: <<<'TXT'\n%command.name% runs.\nTXT, __DIR__ . '/x')]\nclass C {}"},
}
for _, c := range cases {
got, _ := apply(t, c.rule, c.src)
Expand Down
Loading