plugin-php
plugin-php copied to clipboard
Prettier PHP Plugin
**Prettier 1.14.3** **PHP Plugin 0.9.0** ```sh # Options (if any): --single-quote ``` **Input:** ```php $var = $var // Comment ['foo'] // Comment // Comment ['bar'] // Comment // Comment ['baz']...
Input: ```php inlineinline} ``` Note the extra closing tag that has been added, which makes the code invalid, and that the comment is duplicated, which is unexpected. If you comment...
> **Note:** This very same issue has been open for a pretty long time over at [the Prettier repo](https://github.com/prettier/prettier/issues/807). It's gotten positive signals from maintainers, but nobody has taken on...
Input: ``` test ``` Output: ``` test ``` ?> should be on next line
**Prettier 1.14.3** **PHP Plugin 0.9.0** ```sh # Options (if any): --single-quote ``` **Input:** ```php function wp_admin_bar_header() { ?> #wpadminbar { display:none; } #wpadminbar { display:none; } #wpadminbar { display:none; }
As mentioned in #950, the tests produce a strange behavior with indentation of PHP code blocks in markdown. Even when no `tabWidth` is configured in the [markdown test](https://github.com/prettier/plugin-php/tree/master/tests/markdown) (currently it...
**Prettier 1.14.3** **PHP Plugin 0.9.0** **Input:** ```php $var = MB_STRTOLOWER($class); ``` **Output:** ```php $var = MB_STRTOLOWER($class); ``` **Expected behavior:** ```php $var = mb_strtolower($class); ``` We can have list of built-in...
**Prettier 1.14.3** **PHP Plugin 0.8.0** **Input:** ```php $var = $this->{$key}; $var = $this->value->{$method}(); ``` **Output:** ```php $var = $this->$key; $var = $this->value->$method(); ``` **Expected behavior:** Need vote :+1: for `$this->{$key}`...
Update braceStyle to PSR-2 option to PSR-12, and deprecated PSR-2 PSR-2 and PSR-12 produce the exact same output. Fixes #2060
Hello, I am trying to use this with psr-12 standard, but I think I am doing something wrong. I want to use this plugin before PHP_CodeSniffer, which uses the PSR-12...