Skip to content

Commit

Permalink
fix: 🐛 unnecessary indent in raw php directive
Browse files Browse the repository at this point in the history
  • Loading branch information
shufo committed Oct 9, 2023
1 parent b9d5d53 commit 4a45806
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion __tests__/fixtures/formatted.raw_php_block.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@foreach ($users as $user)
@php
$users = $_GET;
foreach ($users as $key1 => $value) {
if (is_array($value)) {
foreach ($value as $key2 => $value2) {
Expand Down
4 changes: 4 additions & 0 deletions src/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,10 @@ export default class Formatter {
return prefixForEnd + line;
}

if (line.length === 0) {
return line;
}

return prefix + line;
})
.join('\n')
Expand Down

0 comments on commit 4a45806

Please sign in to comment.