biati-digital / nova-php-cs-fixer

Nova php-cs-fixer extension with HTML support
10 stars 2 forks source link

BUG: Blade properties issue #28

Open mischasigtermans opened 1 year ago

mischasigtermans commented 1 year ago

Mac OS Version 13.3

PHP version 8.2

Nova version 10.6

Describe the bug Blade properties aren't formatted correctly.

Post an example code

@props([
    'title' => null,
    'slug' => null,
    'body' => null
    ])

    <div>
        <article>
            <a href="/posts/{{$slug}}">
                <h2>{{$title}}</h2>
            </a>
            <p>{{$body}}</p>
        </article>
    </div>

Expected behavior

@props([
    'title' => null,
    'slug' => null,
    'body' => null
])

<div>
    <article>
        <a href="/posts/{{$slug}}">
            <h2>{{$title}}</h2>
        </a>
        <p>{{$body}}</p>
    </article>
</div>

Extension Debug output (REQUIRED)

PHP CS Fixer[14:05:57.309000] Extension configuration

PHP CS Fixer[14:05:57.309000] {
 "phppath": null,
 "csfixerpath": "",
 "port": 8631,
 "server": true,
 "log": true,
 "fixerv3": true,
 "standard": "PSR2",
 "rules": "",
 "phpcsconfig": "",
 "onsave": true,
 "onlyiflocalconfigfile": false,
 "ignoreremote": false,
 "phpRespectNova": true,
 "phpUseTabs": false,
 "phpTabWidth": 4,
 "htmltry": true,
 "htmladditional": true,
 "htmlrules": "preserve_newlines: true",
 "twig": true,
 "twigRespectNova": true,
 "twigUseTabs": false,
 "twigTabWidth": 4,
 "twigrules": "new_line: true",
 "blade": true,
 "bladeRespectNova": false,
 "bladeUseTabs": false,
 "bladeTabWidth": 4,
 "bladerules": "preserve_newlines: true",
 "phpcsfixerVersion": "3.4.0"
}

PHP CS Fixer[14:05:57.309000] Starting Blade format

PHP CS Fixer[14:05:57.309000] Converted Blade to HTML

PHP CS Fixer[14:05:57.309000] <blade props|(%5B>
    'title' => null,
    'slug' => null,
    'body' => null
])

<div>
    <article>
        <a href="/posts/{{%24slug}}">
            <h2>{{%24title}}</h2>
        </a>
        <p>{{%24body}}</p>
    </article>
</div>

PHP CS Fixer[14:05:57.309000] Doing HTML

PHP CS Fixer[14:05:57.309000] {
 "indent_size": 4,
 "indent_with_tabs": false,
 "preserve_newlines": true,
 "indent_scripts": "keep",
 "max_preserve_newlines": 3,
 "content_unformatted": [
  "pre",
  "code"
 ]
}

PHP CS Fixer[14:05:57.309000] Format HTML inside PHP before processing PHP with config

PHP CS Fixer[14:05:57.309000] {"indent_size":4,"indent_with_tabs":false,"preserve_newlines":true,"indent_scripts":"keep","max_preserve_newlines":3,"content_unformatted":["pre","code"],"end_with_newline":false}

PHP CS Fixer[14:05:57.310000] HTML in PHP formatted in 0ms

PHP CS Fixer[14:05:57.310000] Formatted Blade

PHP CS Fixer[14:05:57.310000] @props([
    'title' => null,
    'slug' => null,
    'body' => null
    ])

    <div>
        <article>
            <a href="/posts/{{$slug}}">
                <h2>{{$title}}</h2>
            </a>
            <p>{{$body}}</p>
        </article>
    </div>

PHP CS Fixer[14:05:57.310000] Updating document content

PHP CS Fixer[14:05:57.312000] Updating editor indent

PHP CS Fixer[14:05:57.312000] {
 "tabLength": 4,
 "softTabs": true
}

PHP CS Fixer[14:05:57.312000] Formatting process done
biati-digital commented 1 year ago

Thank's for letting me know. I'll take a look at this as soon as i've some free time.