plugin-php
plugin-php copied to clipboard
Prettier PHP Plugin
**@prettier/plugin-php v0.19.4** [Playground link](https://loilo.github.io/prettier-php-playground/#N4IgDgTgpgLjCWUIHkwIPYDsDOIBcok8mMA6vACYwAW+AHAAwA0IMAhgEblW14AsLAK7YoAFU648AMzYAbES2zEA5rKgBFQehhR8M+VBZhqYAGpIlWfCDoA6AIwgWMCG3iyVAYXQBbH2wAFAAkA-BdBQxAOVwBjKABlGABPNWswJABaGNwWaABHQXhoANdlfz05BRBiEQgYErYytgqDAF8WKAp4GHQUNHgsSVA2bBgWkXbqzDBBMbwQAB4AfmMwAB1MKExBHwACACE2CDxd4hhd4A3d692YkahdnVHdgF5dvgAmAG4N1o2NmKyEbYXYAMXQ6A2l0waxgMUG50OEAAkphwehXgcjng8E8YD9MH8YdMIGcwRCcUjUeicYDgV9dgB6RklM4gpEbJYAPhArSAA) **Input:** ```php ``` **Output:** ```php Parse Error : syntax error, unexpected '::' (T_DOUBLE_COLON) on line 11 9 | } 10 | > 11 | print Foo::BarInFoo::class;...
When a comment is added inside the argument of secondMethod below, it changes the way that the chained methods are wrapped in a way that doesn't seem intuitive for it...
**@prettier/plugin-php v0.19.3** [Playground link](https://loilo.github.io/prettier-php-playground/#N4IgDgTgpgLjCWUIHkwIPYDsDOIBcok8mMA6vACYwAW+AHAAwA0IMAhgEblW14AsLAK7YoAFU648AMzYAbES2zEA5rKgBFQehhR8M+VBZhqYAGpIlWfCDoA6AIwgWMCG3iyVAYXQBbH2wAFAAkA-BdBQxAOVwBjKABlGABPNWswJABaGNwWaABHQXhoANdlfz05BRBiEQgYErYytgqDAF8WKAp4GHQUNHgsSVA2bBgWkXbqzDBBMbwQAB4AfmMwAB1MDYACaBhBCEwtgBIaeGwMgD5ZLGUAWVhqdAoAOTYfKAAKba2f363vv5-AGAkE-E7UM6Xa6YZQldDpOpJV7vS5QABuUEwABkbkh7jQnsioM90AB3TxsYRQbCiahQAAi2hp6FIrjA5Bo3j8bA+tj5AEomMDQb9hb9+QBuECtIA) **Input:** ```php
**prettier version:** 2.8.3 **Prettier-PHP version:** 0.19.3 Steps to reproduce the behavior: open a .php file with html, php, and a script tag in it go down to the script tag...
Hi 👋 I don't know if many people would be interested, I think it would be nice to have an option to define a minimal indentation. like : ```sh --minimal-tab-indent:...
Hey, for use your (great) plugin, we need to use `--parser=php` on command line, i think it's good to add it on your doc :) he's specified but not everywhere...
When using simple conditions for early returns / guard statements the current formatting is quite verbose: ```php function test($arg1) { if (!$arg) return; for ($i = 0; $i < 10;...
**@prettier/plugin-php v0.19.2** [Playground link](https://loilo.github.io/prettier-php-playground/#N4IgDgTgpgLjCWUIHkwIPYDsDOIBcok8mMA6vACYwAW+AHAAwA0IMAhgEblW14AsLAK7YoAFU648AMzYAbES2zEA5rKgBFQehhR8MCIKgsw1MADUkSrPhB0AdAEYQLfW3iyVAYXQBbH2wAFAAkAvQMjEA4INgBjKABlGABPNRswJABaGNwWaABHQXhoAOjlf3wZeQjiEQgYErYytgq5EQBfFigKeBh0FDR4LElQNmwYFqqOkGIwQXG8EAAeAH4TMAAdTE2ANzYIAH0KQR8wAApThwACZcuAJku8S4BmAEprx74XgG4QNqA) **Input:** ```php
**Prettier 2.7.1** **PHP Plugin 0.19.1** ```sh # Options (if any): # our .prettierrc { "phpVersion": "8.1", "printWidth": 80, "tabWidth": 4, "useTabs": false, "singleQuote": true, "trailingCommaPHP": true, "braceStyle": "psr-2", "requirePragma": false,...
**@prettier/plugin-php v0.19.2** [Playground link](https://loilo.github.io/prettier-php-playground/#N4IgDgTgpgLjCWUIHkwIPYDsDOIBcok8mMA6vACYwAW+AHAAwA0IMAhgEblW14AsLAK7YoAFU648AMzYAbES2zEA5rKgBFQehhR8M+VBZhqYAGpIlWfCDoA6AIwgWMCG3iyVAYXQBbH2wAFAAkA-BdBQxAOVwBjKABlGABPNWswJABaGNwWaABHQXhoANdlfz05BRBiEQgYErYytgqDAF8WKAp4GHQUNHgsSVA2bBgWkXbqzDBBMbwQAB4AfmMwAB1MDYBiAG0AQVFRACUASQAhAFVRAFEAXQ2pQUwYjEwAAjZPgAoNt7fiGBvAAkHFBTF+bwA9JC3jR4Ng3jFfD4oCREWxhFAEWw4BB4BxZlBYeg3l1sNg2GB0mwIBCAcCYozwZgAJRvYAQgBuNIA+hRBD4wF8AOQ6UbClkAbg2rQ2IFaQA) **Input:** ```php