Git Product home page Git Product logo

nova-php-cs-fixer's People

Contributors

biati-digital avatar moskoweb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nova-php-cs-fixer's Issues

File scrolls to top on save

After editing a file and then saving, file scrolls back to the first line. Obviously a bit annoying when you are on line 300!

Verified by turning off 'PHP CS Fixer'. Behavior goes away (but of course so does the auto formatting!).

Running Nova 6.2 build 271290
Other active Extensions: "advanced PHP" and "baigoAligner"

issue with php balise

Hi,

when I save this part of code:

<script type="text/javascript">
   <?php

the opening php become '< ? php'.

How to fix this issue please?

Best regards

BUG: Blade properties issue

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

CRITICAL bug with path generate for PHPCsFixer

Describe the bug
I have this tree on php project
Project/Api/Main/13/Api.php
Project/Api/Main/14/Api.php
Project/Api/Main/15/Api.php
Project/Api/Main/16/Api.php
Project/Api/Main/17/Api.php
Project/Api/Main/18/Api.php
Project/Api/Main/19/Api.php
Project/Api/Main/20/Api.php

when I format php files in same time for all files in tree generate this 1 path:

PHP CS Fixer[13:40:08.978000] 1) /Users/kingsman/Library/Application Support/Nova/Workspaces/F66C4A38-1406-4107-8697-60AFA81B7B28/biati.phpcsfixer/projectapimainapi.php

Fixed all files in 22.872 seconds, 24.000 MB memory used

and data randomly mix between each other because when generate this name - projectapimainapi.php, you skip all numbers from path for generate this name

Breaks blade comments

Extension breaks blade comments by erroneously adding a space in the middle of the opening and closing markers:

{{-- This is a comment --}}

Changes to:
{{ -- This is a comment -- }}

Formatting changes '->' to '- >' in Laravel/jQuery

Describe the bug
My Laravel installation includes blade templates to display success/errors in a toast.

This formats fine in Visual Code, Sublime and Atom etc, however in Nova it changes from:

$errors->all()

to

$errors - > all()

Which gives an error of:

Facade\Ignition\Exceptions\ViewException
syntax error, unexpected '>' …

Post an example code - this is before formatting on line 5 (message:)

@if($errors->any())
    <script>
    $(document).ready(function() {
        bulmaToast.toast({
            message: 'Validation error <br>' + @json(implode('<br>', $errors->all())),
            type: 'is-danger',
            dismissible: true,
            'duration': 6000,
            'position': 'top-right',
            'single': false,
            pauseOnHover: true,
            animate: {
                in: 'bounceIn',
                out: 'bounceOutUp'
            },
        });
    }); /* End document ready */
    </script>
@endif

Post an example code - this is after formatting on line 5 (message:)

@if($errors->any())
    <script>
    $(document).ready(function() {
        bulmaToast.toast({
            message: 'Validation error <br>' + @json(implode('<br>', $errors - > all())),
            type: 'is-danger',
            dismissible: true,
            'duration': 6000,
            'position': 'top-right',
            'single': false,
            pauseOnHover: true,
            animate: {
                in: 'bounceIn',
                out: 'bounceOutUp'
            },
        });
    }); /* End document ready */
    </script>
@endif

Expected behavior
Formatting should not add these spaces in.

If I'm missing a setting, please point me in the right direction!

BUG: Blade @click issue

Mac OS Version
13.3

PHP version
8.2

Nova version
10.6

Describe the bug
When saving a Blade file with wrap_attributes: force-expand-multiline set, @ attributes (eg. @click) are being formatted wrong after the second save. When all attributes are on the same line there is no issue, saving it after the first format results in a weirdly, parsed attribute.

Note that with wrap_attributes: force-expand-multiline enabled, #28 still persists.

Post an example code

@props([
    'categories' => null,
    'currentCategory' => null,
    ])
    <div
        class="flex justify-end"
        <blade
        click|.away%3D%26%2334%3Bshow%20%3D%20false%26%2334%3B
    >
        >
        <div
            x-data="{ show: false }"
            class="relative inline-block text-right"
        >
            >
            <div>
                <x-button @click="show = ! show">
                    {{isset($currentCategory) ? $currentCategory->name : 'Categories'}}
                </x-button>
            </div>
        </div>
    </div>

Expected behavior

@props([
    'categories' => null,
    'currentCategory' => null,
    ])
    <div
        class="flex justify-end"
        @click.away="show = false"
    >
        <div
            x-data="{ show: false }"
            class="relative inline-block text-right"
        >
            >
            <div>
                <x-button @click="show = ! show">
                    {{isset($currentCategory) ? $currentCategory->name : 'Categories'}}
                </x-button>
            </div>
        </div>
    </div>

Extension Debug output (REQUIRED)

PHP CS Fixer[13:49:18.873000] Extension configuration

PHP CS Fixer[13:49:18.873000] {
 "phppath": null,
 "csfixerpath": "",
 "port": 8631,
 "server": false,
 "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": "wrap_attributes: force-expand-multiline",
 "twig": true,
 "twigRespectNova": true,
 "twigUseTabs": false,
 "twigTabWidth": 4,
 "twigrules": "wrap_attributes: force-expand-multiline",
 "blade": true,
 "bladeRespectNova": true,
 "bladeUseTabs": false,
 "bladeTabWidth": 4,
 "bladerules": "wrap_attributes: force-expand-multiline",
 "phpcsfixerVersion": "3.4.0"
}

PHP CS Fixer[13:49:18.873000] Starting Blade format

PHP CS Fixer[13:49:18.874000] Converted Blade to HTML

PHP CS Fixer[13:49:18.874000] <blade props|(%5B>
    'categories' => null,
    'currentCategory' => null,
    ])
    <div
        class="flex justify-end"
<blade click|.away%3D%26%2334%3Bshow%20%3D%20false%26%2334%3B>
    >
        <div
            x-data="{ show: false }"
            class="relative inline-block text-right"
        >
            >
            <div>
                <x-button @click="show = ! show">
                    {{isset(%24currentCategory)%20%3F%20%24currentCategory-%3Ename%20%3A%20%26%2339%3BCategories%26%2339%3B}}
                </x-button>
            </div>
        </div>
    </div>


PHP CS Fixer[13:49:18.874000] Doing HTML

PHP CS Fixer[13:49:18.874000] {
 "indent_size": 4,
 "indent_with_tabs": false,
 "preserve_newlines": true,
 "indent_scripts": "keep",
 "max_preserve_newlines": 3,
 "content_unformatted": [
  "pre",
  "code"
 ],
 "wrap_attributes": "force-expand-multiline"
}

PHP CS Fixer[13:49:18.874000] Format HTML inside PHP before processing PHP with config

PHP CS Fixer[13:49:18.874000] {"indent_size":4,"indent_with_tabs":false,"preserve_newlines":true,"indent_scripts":"keep","max_preserve_newlines":3,"content_unformatted":["pre","code"],"wrap_attributes":"force-expand-multiline","end_with_newline":false}

PHP CS Fixer[13:49:18.875000] HTML in PHP formatted in 1ms

PHP CS Fixer[13:49:18.875000] Formatted Blade

PHP CS Fixer[13:49:18.875000] @props([
    'categories' => null,
    'currentCategory' => null,
    ])
    <div
        class="flex justify-end"
        <blade
        click|.away%3D%26%2334%3Bshow%20%3D%20false%26%2334%3B
    >
        >
        <div
            x-data="{ show: false }"
            class="relative inline-block text-right"
        >
            >
            <div>
                <x-button @click="show = ! show">
                    {{isset($currentCategory) ? $currentCategory->name : 'Categories'}}
                </x-button>
            </div>
        </div>
    </div>

PHP CS Fixer[13:49:18.875000] Updating document content

PHP CS Fixer[13:49:18.889000] Updating editor indent

PHP CS Fixer[13:49:18.889000] {
 "tabLength": 4,
 "softTabs": true
}

PHP CS Fixer[13:49:18.889000] Formatting process done

Fixer adds multiple unwanted indents to anything commented in Twig

I moved to Nova in hopes to have a formatter not mess with comments as Prettier etc no longer work in VS Code. They all add extra indentations on every save resulting in comments with hundreds of indents.

Your CS Fixer seemed to work for the first couple of days, but unfortunately I am back to the same issue I had with VS code. Every time I format, or save, it adds additional indents on top of the existing ones anywhere there is a comment. I tried adding comments:false to the extension settings but it did not change this behavior.

No obvious changes to file except tabs converted to spaces

Describe the bug

When I run the formatter, no apparent changes happen to my source file, except the conversion of tabs to spaces.

Post an example code

Here's a block of code where I have intentionally messed up the formatting:

<?php

$db = new PDO("sqlite:index.sqlite3");

$sql = "SELECT * FROM notes";
$stmt = $db->prepare($sql);
$stmt->execute();

while ( 
$row = $stmt->fetch(PDO::FETCH_ASSOC) )
{
$full_path = $row['full_path'];
        $full_path_with_slashes = addcslashes($full_path, '$`');
$id = $row['id'];

print "$full_path\n";
 
}

Expected behavior

Code re-formatted according to PSR2 or some other standard.

**Debug log **

PHP CS Fixer[10:38:12.880000] Format HTML inside PHP before processing PHP with config

PHP CS Fixer[10:38:12.880000] {"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[10:38:12.880000] HTML in PHP formatted in 1ms

PHP CS Fixer[10:38:12.881000] temp file created in

PHP CS Fixer[10:38:12.881000] /Users/stevenf/Library/Application Support/Nova/Workspaces/A44B378D-C3B8-4B7E-876A-1D1A57FD448F/biati.phpcsfixer/volumesmacintoshhdusersstevenfdesktoptest.php

PHP CS Fixer[10:38:12.881000] Generated command to fix file

PHP CS Fixer[10:38:12.881000] php /Users/stevenf/Library/Application\ Support/Nova/Extensions/biati.phpcsfixer/php/php-cs-fixer fix /Users/stevenf/Library/Application\ Support/Nova/Workspaces/A44B378D-C3B8-4B7E-876A-1D1A57FD448F/biati.phpcsfixer/volumesmacintoshhdusersstevenfdesktoptest.php --rules=@PSR2

PHP CS Fixer[10:38:12.881000] Calling PHP Formatting server on URL

PHP CS Fixer[10:38:12.881000] http://localhost:8631/index.php

PHP CS Fixer[10:38:12.917000] Server response

PHP CS Fixer[10:38:12.917000] {"success":true,"command_errors":null,"content":"<?php\n\n$db = new PDO(\"sqlite:index.sqlite3\");\n\n$sql = \"SELECT * FROM notes\";\n$stmt = $db->prepare($sql);\n$stmt->execute();\n\nwhile ( \n$row = $stmt->fetch(PDO::FETCH_ASSOC) )\n{\n$full_path = $row['full_path'];\n        $full_path_with_slashes = addcslashes($full_path, '$`');\n$id = $row['id'];\n\nprint \"$full_path\\n\";\n  \n}","id":"phpcsfixer","command":"php /Users/stevenf/Library/Application\\ Support/Nova/Extensions/biati.phpcsfixer/php/php-cs-fixer fix /Users/stevenf/Library/Application\\ Support/Nova/Workspaces/A44B378D-C3B8-4B7E-876A-1D1A57FD448F/biati.phpcsfixer/volumesmacintoshhdusersstevenfdesktoptest.php --rules=@PSR2"}

PHP CS Fixer[10:38:12.917000] PHP formatted in server took 36ms

PHP CS Fixer[10:38:12.917000] Nothing changed so the content will not be updated

Setting wrong class name

Describe the bug
The extension is always overwriting the class name with a wrong one.
If I launch php cs fixer with my settings from the console it's all correct

Post an example code
The file name is User.php

Before php cs fixer

`namespace App\Models;

class User extends Authenticatable`

After php cs fixer

`namespace App\Models;

class appmodelsuser extends Authenticatable`

I think the problem is due to the copy and renaming of the file in the cache directory, and php cs fixer is launched against the renamed file, which is at this point appmodelsusers.php. I append a log of the execution

`PHP CS Fixer[14:57:01.661000] temp file created in

PHP CS Fixer[14:57:01.661000] /Users/lucarossi/Library/Application Support/Nova/Workspaces/ECB4336E-9D9A-469D-98FD-5879482BFE4B/biati.phpcsfixer/appmodelsuser.php

PHP CS Fixer[14:57:01.662000] Using existing cache file

PHP CS Fixer[14:57:01.662000] Cache file path is /Users/lucarossi/Library/Application Support/Nova/Extensions/biati.phpcsfixer/php/.php-cs-fixer.cache

PHP CS Fixer[14:57:01.662000] Generated command to fix file

PHP CS Fixer[14:57:01.663000] /opt/homebrew/bin/php /opt/homebrew/bin/php-cs-fixer fix /Users/lucarossi/Library/Application Support/Nova/Workspaces/ECB4336E-9D9A-469D-98FD-5879482BFE4B/biati.phpcsfixer/appmodelsuser.php --config=/Users/lucarossi/code/1hs/.php-cs-fixer.php --using-cache=yes --cache-file=/Users/lucarossi/Library/Application Support/Nova/Extensions/biati.phpcsfixer/php/.php-cs-fixer.cache`

Expected behavior
The class name should stay User

Additional } added at save time.

When there is a gap between the end of code and the closing } an additional } is added rather than bringing the } up to the preceding code.

See examples below:

Before save:
Screen Shot 2020-10-26 at 10 54 52 AM

After Save:
Screen Shot 2020-10-26 at 10 55 51 AM

CRITICAL Bug WITH path working

Have paths:
/api/main/23/RC_Api.php
/api/main/22/RC_Api.php
/api/main/21/RC_Api.php
/api/main/20/RC_Api.php
/api/main/19/RC_Api.php

all files differents.
but if I fast save all files in debug area generate 1 path of all files -> apimainrcapi.php
numbers ignored.
and random 1 files replace others files.
fore example 19 api replace files 20 21 22 23

indent_size not working

I try to set indent_size: 4 in the global config but it has no effect. All PHP code will be indented with 2 characters. It works only in the HTML config section and HTML code.

It would be great, if you could fix this for PHP code or – better – read the Nova configuration and use the selected editor tab width.

BUG in Blade @if( != )

The problem ocurs when i save my blade file.
There are a condition that brakes the format.

Here you have my code:
Code Before Save

And this is the result:
The result

Thanks, if you need something else to fix it, let me know.

First line indent in mixed html / php content

When I have a mixed html / php content file I notice that the first PHP line indent is wrong.
If the PHP code is placed between HTML tags the first line indent of the PHP code is wrong.

Does not respect configured twig rules

Describe the bug

I have set rules in the Twig rules option, both in the main extension options and in the project settings, and neither are used when formatting Twig.

I looked at the source and it looks like even though it uses config.twigrules in the constructor of TwigFormatter (see line 16), it never actually uses those rules.

Post an example code

These are options I set in the twig rules option:

indent_level: 0
new_line: true
preserve: 1

In particular the indent_level option is always set at 2 even though I'd like it at 0.

Expected behavior

It should use the options I configure in the Twig rules option.

BUG - Breaks Laravel @Page tag in Blade -> DomPDF

Describe the bug
I'm using DomPDF to generate PDFs on the fly in Laravel. The start of the styling section for this page is as follows:

Screenshot 2021-03-31 at 09 53 49

When I format with PHP-CS-Fixer the tag changes to this:

Screenshot 2021-03-31 at 09 54 00

I wouldn't expect formatting to change @page{ to <blade page|%20%7B>.

Hope that helps.

Very Slow after Update Nova 11

Mac OS Version
MacBook Air M2, 2022
Ventura 13.3.1 (a) (22E772610a)

PHP version
PHP 8.2.6

Nova version
11.1

Describe the bug
After updating to the latest version of Nova, when saving and processing PHP CS Fixer, page validation and formatting were very slow, taking almost a minute to complete the task.

Extension Debug output (REQUIRED)

PHP CS Fixer[20:47:34.976000] Extension configuration

PHP CS Fixer[20:47:34.977000] {
 "phppath": "/opt/homebrew/bin/php",
 "csfixerpath": "/opt/homebrew/bin/php-cs-fixer",
 "port": 8631,
 "server": true,
 "log": true,
 "fixerv3": true,
 "standard": "PSR12",
 "rules": "ordered_imports: true\nno_unused_imports: true\nblank_line_after_namespace: true\nblank_line_before_statement: true\nblank_line_after_opening_tag: true\narray_syntax: { \"syntax\": \"short\" }\nconcat_space: { \"spacing\": \"one\" }\narray_indentation: true\nencoding: true\nmethod_argument_space: true\nsingle_quote: true\nspace_after_semicolon: true\noperator_linebreak: true\nconcat_space: { \"spacing\": \"one\" }\nbinary_operator_spaces:{\"default\":\"align_single_space_minimal\"}\nnot_operator_with_space:true",
 "phpcsconfig": "",
 "onsave": true,
 "onlyiflocalconfigfile": false,
 "ignoreremote": false,
 "phpRespectNova": false,
 "phpUseTabs": false,
 "phpTabWidth": 4,
 "htmltry": true,
 "htmladditional": false,
 "htmlrules": "preserve_newlines: true",
 "twig": true,
 "twigRespectNova": false,
 "twigUseTabs": false,
 "twigTabWidth": 4,
 "twigrules": "new_line: true",
 "blade": false,
 "bladeRespectNova": false,
 "bladeUseTabs": false,
 "bladeTabWidth": 4,
 "bladerules": "end_with_newline: true\nkeep_array_indentation: true\nspace_in_paren: true\nspace_in_empty_paren: true\nunescape_strings: true",
 "phpcsfixerVersion": "3.4.0"
}

PHP CS Fixer[20:47:34.980000] Doing HTML

PHP CS Fixer[20:47:34.980000] {
 "indent_size": 4,
 "indent_with_tabs": false,
 "preserve_newlines": true,
 "indent_scripts": "keep",
 "max_preserve_newlines": 3,
 "content_unformatted": [
  "pre",
  "code"
 ]
}

PHP CS Fixer[20:47:34.980000] Format HTML inside PHP before processing PHP with config

PHP CS Fixer[20:47:34.980000] {"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[20:47:35.001000] HTML in PHP formatted in 22ms

PHP CS Fixer[20:47:35.006000] temp file created in

PHP CS Fixer[20:47:35.006000] /Users/alanmosko/Library/Application Support/Nova/Workspaces/C0B71C73-80C8-4757-98CD-10163091BB1F/biati.phpcsfixer/apporchidscreensadvertorialadvertorialeditscreen.php

PHP CS Fixer[20:47:35.006000] Using existing cache file

PHP CS Fixer[20:47:35.006000] Cache file path is /Users/alanmosko/Library/Application Support/Nova/Extensions/biati.phpcsfixer/php/.php-cs-fixer.cache

PHP CS Fixer[20:47:35.007000] Additional user rules

PHP CS Fixer[20:47:35.007000] {
 "ordered_imports": true,
 "no_unused_imports": true,
 "blank_line_after_namespace": true,
 "blank_line_before_statement": true,
 "blank_line_after_opening_tag": true,
 "array_syntax": {
  "syntax": "short"
 },
 "concat_space": {
  "spacing": "one"
 },
 "array_indentation": true,
 "encoding": true,
 "method_argument_space": true,
 "single_quote": true,
 "space_after_semicolon": true,
 "operator_linebreak": true,
 "binary_operator_spaces": {
  "default": "align_single_space_minimal"
 },
 "not_operator_with_space": true
}

PHP CS Fixer[20:47:35.007000] Generated command to fix file

PHP CS Fixer[20:47:35.007000] /opt/homebrew/bin/php "/opt/homebrew/bin/php-cs-fixer" fix "/Users/alanmosko/Library/Application Support/Nova/Workspaces/C0B71C73-80C8-4757-98CD-10163091BB1F/biati.phpcsfixer/apporchidscreensadvertorialadvertorialeditscreen.php" --rules='{"@PSR12":true,"ordered_imports":true,"no_unused_imports":true,"blank_line_after_namespace":true,"blank_line_before_statement":true,"blank_line_after_opening_tag":true,"array_syntax":{"syntax":"short"},"concat_space":{"spacing":"one"},"array_indentation":true,"encoding":true,"method_argument_space":true,"single_quote":true,"space_after_semicolon":true,"operator_linebreak":true,"binary_operator_spaces":{"default":"align_single_space_minimal"},"not_operator_with_space":true}' --using-cache=yes --cache-file=/Users/alanmosko/Library/Application\ Support/Nova/Extensions/biati.phpcsfixer/php/.php-cs-fixer.cache

PHP CS Fixer[20:47:35.007000] Calling PHP Formatting server on URL

PHP CS Fixer[20:47:35.007000] http://localhost:8631/index.php

PHP CS Fixer[20:48:36.013000] rawResponse [object NovaJSFetchResponse]

PHP CS Fixer[20:48:36.014000] Server response

PHP CS Fixer[20:48:36.015000] {
 "exec": "   1) /Users/alanmosko/Library/Application Support/Nova/Workspaces/C0B71C73-80C8-4757-98CD-10163091BB1F/biati.phpcsfixer/apporchidscreensadvertorialadvertorialeditscreen.php\n\nFixed 1 of 1 files in 0.195 seconds, 16.000 MB memory used\n",
 "content": "<?php\n\nnamespace App\\Orchid\\Screens\\Advertorial;\n\nuse App\\Models\\Advertorial;\nuse App\\Models\\Domain;\nuse App\\Orchid\\Layouts\\Components\\FormTrackingLayout;\nuse App\\Orchid\\Layouts\\Components\\FormUserOwnerLayout;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Validation\\Rule;\nuse Orchid\\Screen\\Actions\\Button;\nuse Orchid\\Screen\\Actions\\Link;\nuse Orchid\\Screen\\Fields;\nuse Orchid\\Screen\\Screen;\nuse Orchid\\Support\\Facades\\Layout;\n\nclass AdvertorialEditScreen extends Screen\n{\n    /**\n     * @var bool\n     */\n    public $exists = false;\n    protected $model;\n\n    /**\n     * Permissions for this screen\n     *\n     * @var array|string\n     */\n    public $permission = [\n        'platform.app.advertorials'\n    ];\n\n    /**\n     * Query data.\n     *\n     * @return array\n     */\n    public function query(Advertorial $model): iterable\n    {\n        /**\n         * Display header name.\n         */\n        $this->name = __('messages.advertorial.single');\n\n        $this->exists = $model->exists;\n        $this->model  = $model;\n\n        /**\n         * Display header description.\n         */\n        if ( ! $this->exists) {\n            $this->description = __('messages.general.add');\n        } else {\n            $this->description = __('messages.general.edit');\n        }\n\n        /**\n         * Check if is permission\n         */\n        if ($model->id) {\n            ! me()->isOwner($model);\n        }\n        if ( ! $model->user_id) {\n            $model->user_id = me()->id;\n        }\n\n        /**\n         * Check plan limit\n         */\n        if ( ! $this->exists && ! me()->hasLimit('advertorials', me()->advertorials()->count())) {\n            \\Toast::warning(__('messages.advertorial.toast.limit'));\n            abort(back());\n        }\n\n        return [\n            'model' => $model,\n            'meta'  => $model->meta->all()\n        ];\n    }\n\n    /**\n     * Button commands.\n     *\n     * @return \\Orchid\\Screen\\Action[]\n     */\n    public function commandBar(): iterable\n    {\n        return [\n            Link::make(__('messages.general.back'))\n                ->icon('arrow-left')\n                ->route('platform.advertorials.index'),\n\n            Button::make(__('messages.general.add'))\n                ->icon('plus')\n                ->method('create')\n                ->canSee( ! $this->exists),\n\n            Button::make(__('messages.general.update'))\n                ->icon('note')\n                ->method('update')\n                ->canSee($this->exists),\n\n            Link::make(__('messages.general.view-page'))\n            ->icon('eye')\n            ->canSee($this->exists)\n            ->href(\n                ($this->exists)\n                ? route('domain.advertorials.link', [$this->model->domain->domain, $this->model->slug])\n                : ''\n            )->target('_blank'),\n\n            Button::make(__('messages.general.delete'))\n                ->icon('trash')\n                ->method('delete')\n                ->canSee($this->exists),\n        ];\n    }\n\n    /**\n     * Views.\n     *\n     * @return \\Orchid\\Screen\\Layout[]|string[]\n     */\n    public function layout(): iterable\n    {\n        return [\n            (new FormUserOwnerLayout())->fields(),\n\n            Layout::block([\n                Layout::rows([\n                    Fields\\Group::make([\n                        Fields\\Input::make('model.name')\n                            ->title(__('messages.general.forms.name.title'))\n                            ->required(),\n\n                        Fields\\Select::make('model.domain_id')\n                            ->title(__('messages.domain.single'))\n                            ->fromQuery(Domain::whereIn('user_id', [1, $this->model->user_id]), 'domain')\n                            ->required(),\n\n                        Fields\\Input::make('model.slug')\n                            ->title(__('messages.general.forms.slug.title'))\n                            ->required()->placeholder(__('messages.general.forms.slug.placeholder'))\n                            ->class('form-control slugify')\n                            ->help(__('messages.general.forms.slug.help')),\n                    ]),\n                ]),\n            ])->title(__('messages.general.forms.title.page-data'))->vertical(true),\n\n            Layout::block([\n                Layout::tabs([\n                    __('Template') => [\n                        Layout::rows([\n                            Fields\\RadioButtons::make('meta.template')\n                                ->options([\n                                    'globo-journalism'    => __('Globo - Jornalismo'),\n                                    'globo-sport'         => __('Globo - Esporte'),\n                                    'globo-entertainment' => __('Globo - Entretenimento'),\n                                    'globo-recipe'        => __('Globo - Receitas'),\n                                    // 2 => __('Modelo 2'),\n                                    // 3 => __('Modelo 3'),\n                                    // 4 => __('Modelo 4'),\n                                    // 5 => __('Modelo 5'),\n                                    // 6 => __('Modelo 6'),\n                                ])\n                                ->title(__('Template:'))\n                                ->value('globo-journalism'),\n                        ]),\n                    ],\n\n                    __('Cabeçalho') => [\n                        Layout::columns([\n                            Layout::rows([\n                                Fields\\Picture::make('meta.header.logo')\n                                    ->title(__('Logo'))\n                                    ->acceptedFiles('.jpg,.png,.jpeg,.svg')\n                                    ->storage('b2'),\n                            ]),\n                            Layout::rows([\n                                Fields\\Input::make('meta.header.title')\n                                    ->title(__('Título')),\n\n                                Fields\\Input::make('meta.header.subtitle')\n                                    ->title(__('Subtítulo:'))\n                                    ->help(__('Opcional')),\n                            ]),\n                            Layout::rows([\n                                Fields\\Input::make('meta.header.button.text')\n                                    ->title(__('Texto do Botão')),\n\n                                Fields\\Input::make('meta.header.button.link')\n                                    ->title(__('Link do Botão')),\n                            ]),\n                        ]),\n                    ],\n\n                    __('Conteúdo') => [\n                        Layout::rows([\n                            Fields\\Group::make([\n                                Fields\\Input::make('meta.body.title')\n                                    ->title(__('Título')),\n\n                                Fields\\Input::make('meta.body.author')\n                                    ->title(__('Autor')),\n                            ]),\n\n                            Fields\\Group::make([\n                                Fields\\Input::make('meta.body.subtitle')\n                                    ->title(__('Subtítulo')),\n\n                                Fields\\DateTimer::make('meta.body.date')\n                                    ->title('Data de Publicação')\n                                    ->enableTime()\n                                    // ->format('d/m/Y H:i')\n                                    ->help(__('Se em branco, será exibido uma data dinâmica, com base no dia de acesso.')),\n                            ]),\n\n                            Fields\\TextArea::make('meta.body.content')\n                                ->title(__('Conteúdo'))\n                                ->class('text_editor')\n                                ->height('500px'),\n\n                            Fields\\Label::make('label')\n                            ->title(__('Conteúdo Dinâmico'))\n                            ->help(__('Você pode colocar algumas chaves de conteúdo dinâmico:')\n                            . '<br>\n                                <code>[BEFORE_YESTERDAY]</code>,\n                                <code>[YESTERDAY]</code>,\n                                <code>[CURRENT_DATE]</code>,\n                                <code>[CURRENT_TIME]</code>,\n                                <code>[TOMORROW]</code>,\n                                <code>[AFTER_TOMORROW]</code>,\n                                <code>[LAST_WEEK]</code>,\n                                <code>[NEXT_WEEK]</code>,\n                                <code>[CITY]</code>,\n                                <code>[STATE]</code>,\n                                <code>[COUNTRY]</code>,\n                                <code>[BANNER_IN_CONTENT]</code>\n                            '),\n                        ]),\n                        Layout::rows([\n                            Fields\\Group::make([\n                                Fields\\Input::make('meta.body.tags')\n                                    ->title(__('Tags:'))\n                                    ->help(__('Para separar as tags, coloque uma vírgula entre as tags.')),\n\n                                Fields\\Switcher::make('meta.body.newsletter.status')\n                                    ->sendTrueOrFalse()\n                                    ->title(__('Ativar Chamada Chamada para Newsletter?')),\n\n                                Fields\\Input::make('meta.body.newsletter.link')\n                                    ->title(__('Link para Inscrição:'))\n                                    ->type('url')->placeholder('https://...'),\n                            ]),\n                        ]),\n                    ],\n\n                    __('Conteúdos Relacionados') => [\n                        Layout::tabs([\n                            __('Conteúdo #1') => Layout::columns([\n                                Layout::rows([\n                                    Fields\\Picture::make('meta.related.0.image')\n                                        ->title(__('Imagem'))\n                                        ->acceptedFiles('.jpg,.png,.jpeg')\n                                        ->help(__('Tamanho Recomendado: 1280px por 720px'))\n                                        ->storage('b2'),\n                                ]),\n                                Layout::rows([\n                                    Fields\\Input::make('meta.related.0.title')\n                                        ->title(__('Título')),\n\n                                    Fields\\Input::make('meta.related.0.subtitle')\n                                        ->title(__('Subtítulo:'))\n                                        ->help(__('Opcional')),\n\n                                    Fields\\Input::make('meta.related.0.link')\n                                        ->title(__('Link do Conteúdo:'))\n                                        ->type('url')->placeholder('https://...'),\n                                ]),\n                                Layout::rows([\n                                    Fields\\TextArea::make('meta.related.0.description')\n                                        ->title(__('Descrição'))\n                                        ->rows(3),\n                                ]),\n                            ]),\n                            __('Conteúdo #2') => Layout::columns([\n                                Layout::rows([\n                                    Fields\\Picture::make('meta.related.1.image')\n                                        ->title(__('Imagem'))\n                                        ->acceptedFiles('.jpg,.png,.jpeg')\n                                        ->help(__('Tamanho Recomendado: 1280px por 720px'))\n                                        ->storage('b2'),\n                                ]),\n                                Layout::rows([\n                                    Fields\\Input::make('meta.related.1.title')\n                                        ->title(__('Título')),\n\n                                    Fields\\Input::make('meta.related.1.subtitle')\n                                        ->title(__('Subtítulo:'))\n                                        ->help(__('Opcional')),\n\n                                    Fields\\Input::make('meta.related.1.link')\n                                        ->title(__('Link do Conteúdo:'))\n                                        ->type('url')->placeholder('https://...'),\n                                ]),\n                                Layout::rows([\n                                    Fields\\TextArea::make('meta.related.1.description')\n                                        ->title(__('Descrição'))\n                                        ->rows(3),\n                                ]),\n                            ]),\n                            __('Conteúdo #3') => Layout::columns([\n                                Layout::rows([\n                                    Fields\\Picture::make('meta.related.2.image')\n                                        ->title(__('Imagem'))\n                                        ->acceptedFiles('.jpg,.png,.jpeg')\n                                        ->help(__('Tamanho Recomendado: 1280px por 720px'))\n                                        ->storage('b2'),\n                                ]),\n                                Layout::rows([\n                                    Fields\\Input::make('meta.related.2.title')\n                                        ->title(__('Título')),\n\n                                    Fields\\Input::make('meta.related.2.subtitle')\n                                        ->title(__('Subtítulo:'))\n                                        ->help(__('Opcional')),\n\n                                    Fields\\Input::make('meta.related.2.link')\n                                        ->title(__('Link do Conteúdo:'))\n                                        ->type('url')->placeholder('https://...'),\n                                ]),\n                                Layout::rows([\n                                    Fields\\TextArea::make('meta.related.2.description')\n                                        ->title(__('Descrição'))\n                                        ->rows(3),\n                                ]),\n                            ]),\n                        ]),\n                    ],\n\n                    __('Rodapé') => [\n                        Layout::rows([\n                            Fields\\Input::make('meta.footer.copyright')\n                                ->title(__('Copyright'))\n                                ->placeholder('Todos os direitos reservados...'),\n\n                            Fields\\Input::make('meta.footer.terms_of_use')\n                                ->title(__('Link para Termos de Uso'))\n                                ->type('url')->placeholder('https://...')\n                                ->help(__('Se não definido nenhum link, será colocado o link padrão da página do seu domínio.')),\n\n                            Fields\\Input::make('meta.footer.privacy_policy')\n                                ->title(__('Link para Política de Privacidade'))\n                                ->type('url')->placeholder('https://...')\n                                ->help(__('Se não definido nenhum link, será colocado o link padrão da página do seu domínio.')),\n                        ]),\n                    ],\n\n                    __('Banners de Publicidade') => [\n                        Layout::rows([\n                            Fields\\Input::make('meta.banners.link')\n                                ->title(__('Link de Destino dos Banner')),\n\n                            Fields\\Group::make([\n                                Fields\\Picture::make('meta.banners.title.before')\n                                    ->title(__('Banner Antes do Título'))\n                                    ->acceptedFiles('.jpg,.png,.jpeg,.gif')\n                                    ->help(__('Tamanho Recomendado: 1448px por 375px'))\n                                    ->storage('b2'),\n\n                                Fields\\Picture::make('meta.banners.content.before')\n                                    ->title(__('Banner Antes do Conteúdo'))\n                                    ->acceptedFiles('.jpg,.png,.jpeg,.gif')\n                                    ->help(__('Tamanho Recomendado: 1448px por 375px'))\n                                    ->storage('b2'),\n                            ]),\n\n                            Fields\\Group::make([\n                                Fields\\Picture::make('meta.banners.content.aside')\n                                    ->title(__('Banner Ao Lado do Conteúdo'))\n                                    ->acceptedFiles('.jpg,.png,.jpeg,.gif')\n                                    ->help(__('Tamanho Recomendado: 512px por 512px'))\n                                    ->storage('b2'),\n\n                                Fields\\Picture::make('meta.banners.content.middle')\n                                    ->title(__('Banner Em Meio ao Conteúdo'))\n                                    ->acceptedFiles('.jpg,.png,.jpeg,.gif')\n                                    ->help(__('Tamanho Recomendado: 1448px por 375px'))\n                                    ->storage('b2'),\n                            ]),\n\n                            Fields\\Group::make([\n                                Fields\\Picture::make('meta.banners.content.after')\n                                    ->title(__('Banner Depois do Conteúdo'))\n                                    ->acceptedFiles('.jpg,.png,.jpeg,.gif')\n                                    ->help(__('Tamanho Recomendado: 1448px por 375px'))\n                                    ->storage('b2'),\n\n                                Fields\\Picture::make('meta.banners.related.after')\n                                    ->title(__('Banner Abaixo do Conteúdo Relacionados'))\n                                    ->acceptedFiles('.jpg,.png,.jpeg,.gif')\n                                    ->help(__('Tamanho Recomendado: 1448px por 375px'))\n                                    ->storage('b2'),\n                            ]),\n                        ]),\n                    ],\n                ]),\n            ])->title(__('Conteúdo de Página'))->vertical(true),\n\n            (new FormTrackingLayout())->fields(),\n\n            Layout::block([\n                Layout::tabs([\n                    'SEO e Social' => [\n                        Layout::rows([\n                            Fields\\Group::make([\n                                Fields\\Input::make('meta.social.title')\n                                    ->title(__('Título')),\n\n                                Fields\\TextArea::make('meta.social.description')\n                                    ->title(__('Descrição'))\n                                    ->rows(3),\n                            ]),\n                            Fields\\Group::make([\n                                Fields\\Picture::make('meta.social.image')\n                                    ->title(__('Imagem'))\n                                    ->acceptedFiles('.jpg,.png,.jpeg')\n                                    ->storage('b2'),\n\n                                Fields\\Picture::make('meta.social.favicon')\n                                    ->title(__('Favicon'))\n                                    ->acceptedFiles('.png')\n                                    ->storage('b2'),\n                            ]),\n                        ]),\n                    ],\n                    'Botão de WhatsApp' => [\n                        Layout::rows([\n                            Fields\\Group::make([\n                                Fields\\Switcher::make('meta.whatsapp.status')\n                                    ->sendTrueOrFalse()\n                                    ->title(__('Ativar Botão do WhatsApp?')),\n\n                                Fields\\Input::make('meta.whatsapp.phone')\n                                    ->title(__('Número de WhatsApp'))\n                                    ->mask('55 (99) 99999-9999'),\n\n                                Fields\\TextArea::make('meta.whatsapp.message')\n                                    ->title(__('Mensagem de Contato'))\n                                    ->rows(2)\n                                    ->help(__('Insira uma mensagem para que possa identificar a origem do contato.')),\n                            ]),\n                        ]),\n                    ],\n                    'Adicionais' => [\n                        Layout::rows([\n                            Fields\\Group::make([\n                                Fields\\Switcher::make('meta.url_parameters')\n                                    ->sendTrueOrFalse()\n                                    ->checked()\n                                    ->title(__('messages.page.forms.additional.url_parameters.title'))\n                                    ->help(__('messages.page.forms.additional.url_parameters.help')),\n\n                                Fields\\Switcher::make('meta.cookie.status')\n                                    ->sendTrueOrFalse()\n                                    ->title(__('messages.page.forms.additional.cookie_status.title')),\n                            ]),\n                            Fields\\Group::make([\n                                Fields\\Input::make('meta.back_redirect')\n                                    ->type('url')->placeholder('https://...')\n                                    ->title(__('messages.page.forms.additional.back_redirect.title'))\n                                    ->help(__('messages.page.forms.additional.back_redirect.help')),\n\n                                Fields\\Input::make('meta.exit_redirect')\n                                    ->type('url')->placeholder('https://...')\n                                    ->title(__('messages.page.forms.additional.exit_redirect.title'))\n                                    ->help(__('messages.page.forms.additional.exit_redirect.help')),\n                            ]),\n                        ]),\n                    ],\n                    'Scripts' => [\n                        Layout::rows([\n                            Fields\\Group::make([\n                                Fields\\Code::make('meta.script.header')\n                                    ->language(Fields\\Code::MARKUP)\n                                    ->title(__('Cabeçalho')),\n\n                                Fields\\Code::make('meta.script.footer')\n                                    ->language(Fields\\Code::MARKUP)\n                                    ->title(__('Rodapé')),\n                            ]),\n                        ]),\n                    ],\n                ]),\n            ])->title('Recursos Extra')->vertical(true),\n        ];\n    }\n\n    /**\n     * @param Page    $page\n     * @param Request $request\n     *\n     * @return \\Illuminate\\Http\\RedirectResponse\n     */\n    public function create(Request $request, Advertorial $model)\n    {\n        $data = $request->get('model');\n        $meta = $request->get('meta');\n\n        if (Advertorial::where([\n            ['slug',      '=', data_get($data, 'slug')],\n            ['domain_id', '=', data_get($data, 'domain_id')],\n        ])->exists()\n        ) {\n            $request->validate([\n                'model.slug' => [\n                    'required',\n                    Rule::unique(Advertorial::class, 'slug')->ignore($model),\n                ]\n            ]);\n        }\n\n        if (is_null(data_get($data, 'user_id'))) {\n            $data['user_id'] = auth()->user()->id;\n        }\n\n        $model->meta = $meta;\n        $model->fill($data)->save();\n\n        \\Toast::success(__('messages.advertorial.toast.created'));\n\n        return redirect()->route('platform.advertorials.edit', $model);\n    }\n\n    /**\n     * @param Page    $page\n     * @param Request $request\n     *\n     * @return \\Illuminate\\Http\\RedirectResponse\n     */\n    public function update(Request $request, Advertorial $model)\n    {\n        $data = $request->get('model');\n        $meta = $request->get('meta');\n\n        if (Advertorial::where([\n            ['slug',      '=', data_get($data, 'slug')],\n            ['domain_id', '=', data_get($data, 'domain_id')],\n            ['id',       '!=', $model->id],\n        ])->exists()\n        ) {\n            $request->validate([\n                'model.slug' => [\n                    'required',\n                    Rule::unique(Advertorial::class, 'slug')->ignore($model),\n                ]\n            ]);\n        }\n\n        $model->meta = $meta;\n        $model->fill($data)->save();\n\n        \\Toast::success(__('messages.advertorial.toast.updated'));\n\n        return redirect()->route('platform.advertorials.edit', $model);\n    }\n\n    /**\n     * @param Advertorial $model\n     *\n     * @return \\Illuminate\\Http\\RedirectResponse\n     * @throws \\Exception\n     */\n    public function delete(Advertorial $model)\n    {\n        $model->slug = $model->slug . '-delete';\n        $model->save();\n\n        $model->delete();\n\n        \\Toast::success(__('messages.advertorial.toast.deleted'));\n\n        return redirect()->route('platform.advertorials.index');\n    }\n}\n",
 "command_errors": "   1) /Users/alanmosko/Library/Application Support/Nova/Workspaces/C0B71C73-80C8-4757-98CD-10163091BB1F/biati.phpcsfixer/apporchidscreensadvertorialadvertorialeditscreen.php\n\nFixed 1 of 1 files in 0.195 seconds, 16.000 MB memory used\n",
 "id": "phpcsfixer",
 "success": true,
 "apple": true,
 "command": "/opt/homebrew/bin/php \"/opt/homebrew/bin/php-cs-fixer\" fix \"/Users/alanmosko/Library/Application Support/Nova/Workspaces/C0B71C73-80C8-4757-98CD-10163091BB1F/biati.phpcsfixer/apporchidscreensadvertorialadvertorialeditscreen.php\" --rules='{\"@PSR12\":true,\"ordered_imports\":true,\"no_unused_imports\":true,\"blank_line_after_namespace\":true,\"blank_line_before_statement\":true,\"blank_line_after_opening_tag\":true,\"array_syntax\":{\"syntax\":\"short\"},\"concat_space\":{\"spacing\":\"one\"},\"array_indentation\":true,\"encoding\":true,\"method_argument_space\":true,\"single_quote\":true,\"space_after_semicolon\":true,\"operator_linebreak\":true,\"binary_operator_spaces\":{\"default\":\"align_single_space_minimal\"},\"not_operator_with_space\":true}' --using-cache=yes --cache-file=/Users/alanmosko/Library/Application\\ Support/Nova/Extensions/biati.phpcsfixer/php/.php-cs-fixer.cache"
}

PHP CS Fixer[20:48:36.017000] PHP formatted in server took 61010ms

PHP CS Fixer[20:48:36.018000] Updating document content

PHP CS Fixer[20:48:36.180000] Updating editor indent

PHP CS Fixer[20:48:36.181000] {
 "tabLength": 4,
 "softTabs": true
}

PHP CS Fixer[20:48:36.239000] Formatting process done

php 8.2 php-cs-fixer 3.16.0

PHP CS Fixer 3.16.0 (d40f943) BoY42 by Fabien Potencier and Dariusz Ruminski.
PHP runtime: 8.2.4

not apply formatted file
when save file temporary file good formatted but it is not apple in editor.
get error:
PHP CS Fixer[0:54:32.240000] Formatting process error

in new version just change log
PHP CS Fixer[0:54:32.240000] PHP formatted in process took 328ms

PHP CS Fixer[0:54:32.240000] 1) /Users/kingsman/Library/Application Support/Nova/Workspaces/F66C4A38-1406-4107-8697-60AFA81B7B28/biati.phpcsfixer/engineclassespubliccontrollerspcmobileapps.php

Fixed 1 of 1 files in 0.252 seconds, 18.000 MB memory used

PHP CS Fixer[0:54:32.240000] stdOut.length = 3
PHP CS Fixer[0:54:32.240000] stdOut

  1. /Users/kingsman/Library/Application Support/Nova/Workspaces/F66C4A38-1406-4107-8697-60AFA81B7B28/biati.phpcsfixer/engineclassespubliccontrollerspcmobileapps.php

Fixed 1 of 1 files in 0.252 seconds, 18.000 MB memory used

PHP CS Fixer[0:54:32.240000] stdErr.length = 2
PHP CS Fixer[0:54:32.240000] stdErr
Loaded config default.
Using cache file "/Users/kingsman/Library/Application Support/Nova/Extensions/biati.phpcsfixer/php/.php-cs-fixer.cache".

PHP CS Fixer[0:54:32.240000] Formatting process error

PHP CS Fixer[0:54:32.240000] Loaded config default.
Using cache file "/Users/kingsman/Library/Application Support/Nova/Extensions/biati.phpcsfixer/php/.php-cs-fixer.cache".

BUG

I have installed brew and php on Apple M1, it is not working
The path to php is different, than in the manual: /opt/homebrew/Cellar/php/8.1.4/bin/php

any ideas?

Fatal error using WordPress coding standard

Using version 4.1.0 when setting the Coding Standard to 'WordPress' a fatal error is generated:

Fatal error: Declaration of WeDevs\Fixer\SpaceInsideParenthesisFixer::applyFix(SplFileInfo $file, PhpCsFixer\Tokenizer\Tokens $tokens) must be compatible with PhpCsFixer\AbstractFixer::applyFix(SplFileInfo $file, PhpCsFixer\Tokenizer\Tokens $tokens): void in /Users/xxxxx/Library/Application Support/Nova/Extensions/biati.phpcsfixer/rules/SpaceInsideParenthesisFixer.php on line 63

FATAL ERROR
[
 "\n",
 "Fatal error: Declaration of WeDevs\\Fixer\\SpaceInsideParenthesisFixer::applyFix(SplFileInfo $file, PhpCsFixer\\Tokenizer\\Tokens $tokens) must be compatible with PhpCsFixer\\AbstractFixer::applyFix(SplFileInfo $file, PhpCsFixer\\Tokenizer\\Tokens $tokens): void in /Users/xxxxx/Library/Application Support/Nova/Extensions/biati.phpcsfixer/rules/SpaceInsideParenthesisFixer.php on line 63\n"
]

I am running PHP 7.4. I tried the default installed by Homebrew (8.1.4) which generated a warning that the version was too high.

All the other coding standards appear to run correctly, so it does appear to be related to the WordPress standard in particular.

Thanks for your work on this extension!

BUG

Describe the bug
When saving, the file is scrolled to the beginning

Expected behavior
It would be great if the code was fixed, but the scrolling remained in the place where you are working now.

Speed issue? takes 1-min to save files

Mac OS Version
13.0

PHP version
8.1.1

Nova version
9.4

Describe the bug
Extreamly slow when saving

CleanShot 2022-08-11 at 21 17 29

Extension Debug output (REQUIRED)

PHP CS Fixer[21:14:49.101000] Extension configuration

PHP CS Fixer[21:14:49.101000] {
 "phppath": null,
 "csfixerpath": "",
 "port": 8631,
 "server": true,
 "log": true,
 "fixerv3": true,
 "standard": "PSR12",
 "rules": "",
 "phpcsconfig": "",
 "onsave": true,
 "onlyiflocalconfigfile": false,
 "ignoreremote": false,
 "phpRespectNova": false,
 "phpUseTabs": false,
 "phpTabWidth": 4,
 "htmltry": true,
 "htmladditional": false,
 "htmlrules": "preserve_newlines: true",
 "twig": true,
 "twigRespectNova": false,
 "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[21:14:49.102000] The file does not contain HTML, skip HTML formatting

PHP CS Fixer[21:14:49.102000] temp file created in

PHP CS Fixer[21:14:49.102000] /Users/benjamin/Library/Application Support/Nova/Workspaces/9F22A600-630A-4D6B-AC66-8826E6E004FB/biati.phpcsfixer/index.php

PHP CS Fixer[21:14:49.103000] Using existing cache file

PHP CS Fixer[21:14:49.103000] Cache file path is /Users/benjamin/Library/Application Support/Nova/Extensions/biati.phpcsfixer/php/.php-cs-fixer.cache

PHP CS Fixer[21:14:49.103000] Generated command to fix file

PHP CS Fixer[21:14:49.103000] php "/Users/benjamin/Library/Application Support/Nova/Extensions/biati.phpcsfixer/php/php-cs-fixer-3.4.0" fix "/Users/benjamin/Library/Application Support/Nova/Workspaces/9F22A600-630A-4D6B-AC66-8826E6E004FB/biati.phpcsfixer/index.php" --rules=@PSR12 --using-cache=yes --cache-file=/Users/benjamin/Library/Application\ Support/Nova/Extensions/biati.phpcsfixer/php/.php-cs-fixer.cache

PHP CS Fixer[21:14:49.103000] Calling PHP Formatting server on URL

PHP CS Fixer[21:14:49.103000] http://localhost:8631/index.php

PHP CS Fixer[21:15:50.108000] rawResponse [object NovaJSFetchResponse]

PHP CS Fixer[21:15:50.108000] Server response

PHP CS Fixer[21:15:50.108000] {
 "exec": "   1) /Users/benjamin/Library/Application Support/Nova/Workspaces/9F22A600-630A-4D6B-AC66-8826E6E004FB/biati.phpcsfixer/index.php\n\nFixed all files in 0.008 seconds, 14.453 MB memory used\n",
 "content": "<?php\n\n/**\n * @internal\n *\n * @covers \\PhpCsFixer\\Error\\Error\n */\nfinal class ErrorTest extends TestCase\n{\n    public function testThatErrorTypeConstantValuesAreDifferent(): void\n    {\n        static::assertNotSame(Error::TYPE_INVALID, Error::TYPE_EXCEPTION);\n        static::assertNotSame(Error::TYPE_EXCEPTION, Error::TYPE_LINT);\n    }\n}\n",
 "command_errors": false,
 "id": "phpcsfixer",
 "success": true,
 "apple": true,
 "command": "php \"/Users/benjamin/Library/Application Support/Nova/Extensions/biati.phpcsfixer/php/php-cs-fixer-3.4.0\" fix \"/Users/benjamin/Library/Application Support/Nova/Workspaces/9F22A600-630A-4D6B-AC66-8826E6E004FB/biati.phpcsfixer/index.php\" --rules=@PSR12 --using-cache=yes --cache-file=/Users/benjamin/Library/Application\\ Support/Nova/Extensions/biati.phpcsfixer/php/.php-cs-fixer.cache"
}

PHP CS Fixer[21:15:50.109000] PHP formatted in server took 61006ms

PHP CS Fixer[21:15:50.110000] Updating document content

PHP CS Fixer[21:15:50.113000] Updating editor indent

PHP CS Fixer[21:15:50.113000] {
 "tabLength": 4,
 "softTabs": true
}

PHP CS Fixer[21:15:50.117000] Formatting process done

Indentation not supported in Blade @php blocks.

Indentation not supported in Blade @php blocks:

@php
  $blocks = parse_blocks( get_the_content() );
  foreach ( $blocks as $block ) {
    if ( 'acf/feature' !== $block['blockName'] ) {
      echo render_block( $block );
    }
  }
@endphp

Changes to:

@php
$blocks = parse_blocks( get_the_content() );
foreach ( $blocks as $block ) {
if ( 'acf/feature' !== $block['blockName'] ) {
echo render_block( $block );
}
}
@endphp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.