Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adapt Eclipse PHP code formatter for Symfony coding standards

How do I adapt Eclipse PHP code formatter for Symfony coding standards?

Especially I want to get rid of spaces around concatenation operator which the code formatter adds with any of default profiles as of writing.

$a = $b->bar.'*'.$c->baz; // not $b->bar . '*' . $c->baz

Code formatter allows to export and import a profile in XML, but it isn't clear which directive in it is responsible for the above spaces.


See this slightly modified PSR-2 profile I used as a starting point, without success.

like image 464
sanmai Avatar asked May 17 '16 03:05

sanmai


People also ask

How can I get beautify code in Eclipse?

Go to Source | Format Document or press Ctrl+Shift+F.


1 Answers

Sadly this is not possible without editing source. You can rather change source code your self or ask a feature request to make it happened, which no one knows if someone will do it.

Here are editable preferences and I don't see anywhere that.

https://github.com/eclipse/pdt/blob/master/plugins/org.eclipse.php.formatter.core/src/org/eclipse/php/formatter/core/CodeFormatterPreferences.java

like image 154
flakerimi Avatar answered Sep 28 '22 21:09

flakerimi