plugin-php
plugin-php copied to clipboard
Prettier PHP Plugin
**@prettier/plugin-php v0.24.0** [Playground link](https://loilo.github.io/prettier-php-playground/#N4IgDgTgpgLjCWUIHkwIPYDsDOIBcok8mMA6vACYwAW+AHAAwA0IMAhgEblW14AsLAK7YoAFU648AMzYAbES2zEA5rKgBFQehhR8M+VBZhqYAGpIlWfCDoA6PiBYwIbeLJUBhdAFtvbAAoAEv74zoKGIBwuAMZQAMowAJ5q1mBIALTRuCzQAI6C8ND+Lsp+enIKIMQiEDDFbKVs5QYAvixQFPAw6Cho8FiSoGzYMM0ibVWYYIKjeCAAPAD8xmAAOpjrmFAA7gAE0bLD2LvALXh4B0cA3CAtQA) **Input:** ```php
In my (admittedly specific) use case the plugin is unable to find `composer.json`, which is plainly present in the root of the workspace. #### Environment Running VS Code with a...
If I have a line like so: ```php $timestamp = (new DateTimeImmutable())->format(DATE_ATOM); ``` Prettier will reformat it as: ```php $timestamp = new DateTimeImmutable()->format(DATE_ATOM) ``` which is not valid PHP code.
Description: When formatting code with Prettier in PHP 8.4, parentheses are incorrectly added to a static property when instantiating an object. This causes a syntax error and breaks the application....
In v0.24.0: ```php
**@prettier/plugin-php v0.23.0** [Playground link](https://loilo.github.io/prettier-php-playground/#N4IgDgTgpgLjCWUIHkwIPYDsDOIBcok8mMA6vACYwAW+AHAAwA0IMAhgEblW14AsLAK7YoAFU648AMzYAbES2zEA5rKgBFQehhR8M+VBZhqYAGpIlWfCDoA6PiBYwIbeLJUBhdAFtvbAAoAEv74zoKGIBwuAMZQAMowAJ5q1mBIALTRuCzQAI6C8ND+Lsp+enIKIMQiEDDFbKVs5QYAvixQFPAw6Cho8FiSoGzYMM0ibVWYYIKjeCAAPAD8xmAAOpiYUADu6wDEANoAMmwAXokAunv7Xt7TOhTnAARXol1qABQA5AlsUlKfAEpLphorJhthHlAAB46TAUCE3MBYKAkR7AdaPTGPaYcdzRR4AEg6XRUjwAvI99ucANwYrE4vGEqJsEHUKDYWmYFqckAtIA) **Input:** ```php
The `Deprecated` attribute is being copied from the `TYPES` constant to the neighbouring `$attributes` property for some reason. I have to remove it manually whenever I format this file. **@prettier/plugin-php...
**@prettier/plugin-php v0.22.4** [Playground link](https://loilo.github.io/prettier-php-playground/#N4IgDgTgpgLjCWUIHkwIPYDsDOIBcok8mMA6vACYwAW+AHAAwA0IMAhgEblW14AsLAK7YoAFU648AMzYAbES2zEA5rKgBFQehhR8M+VBZhqYAGpIlWfCACsAOj4gWMCG3iyVAYXQBbH2wAFAAkA-BdBQxAOVwBjKABlGABPNWswJABaGNwWaABHQXhoANdlfz05BRBiEQgYErYytgqDAF8WKAp4GHQUNHgsSVA2bBgWkXbqzDBBMbwQAB4AfmMwAB1MDagY6nQAAn8YHb2ACgASdHTXDEwASj3gDb3nl7WQbF26t6Y9t+g5WRJPYANyQQNkWGUe0uNz2ACY3nsALwAPj28V8UE8shG2Dw0jcEEBABlIQBZWC7CgAOTYPjE1DYMAASoIcMhMOdgWwIPBOGofgBtN4fXowb6-d6fcUgAC6tyYG1aIFaQA) **Input:** ```php
The plugin is currently wrapping variable static method calls before the double-colon `::`. This seems wrong to me, but at least warrants some further discussion. It doesn't appear to be...