blade-formatter icon indicating copy to clipboard operation
blade-formatter copied to clipboard

Inconsistency in @unless directive

Open sanskar-mk2 opened this issue 3 years ago • 1 comments
trafficstars

@foreach, @if and other directives have a space between the parameter parentheses. Example @foreach ($users as $user) and @if ($user->isAdmin()) But @unless doesn't seem to have the same. If we write @unless ($user->isAdmin()), it gets formatted to @unless($user->isAdmin()) Notice that it is missing a space that makes its style inconsistent with the rest of the directives.

Thank you.

sanskar-mk2 avatar Aug 13 '22 07:08 sanskar-mk2

Thanks @sanskar-mk2 Currently formatter using PSR-2 for formatting so it does not include space except for PHP built-in syntax like if or foreach.

But the official blade example code includes space so I think it's fine to include it at some point. This may be a Breaking Change and should be included in the Major version upgrade.

shufo avatar Aug 15 '22 09:08 shufo

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Dec 18 '22 01:12 github-actions[bot]

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Feb 17 '23 02:02 github-actions[bot]

Fixed at https://github.com/shufo/blade-formatter/releases/tag/v1.32.11

shufo avatar Apr 02 '23 15:04 shufo