| Summary: | Enable Keep 'else if' on one line' by default for PSR2 | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Michal Niewrzal <wywrzal> |
| Component: | PDT | Assignee: | PHP Core <php.core-inbox> |
| Status: | CLOSED FIXED | QA Contact: | Sylvia Tancheva <silviya> |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | All | ||
| See Also: |
https://git.eclipse.org/r/83019 https://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=a229c7ad0e4dcb916d8c4637874dab83459fc55c |
||
| Whiteboard: | |||
New Gerrit change created: https://git.eclipse.org/r/83019 Gerrit change https://git.eclipse.org/r/83019 was merged to [master]. Commit: http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=a229c7ad0e4dcb916d8c4637874dab83459fc55c Verified, closing |
Option Keep 'else if' on one line' is disabled by default for PSR2 and in my opinion can be very irritating and it doesn't fit current style of programming. Before formatting: <?php function cmp_dept($a, $b) { if ($a['dept'] > $b['dept']) { return 1; } else if ($a['dept'] < $b['dept']) { return false; } else if ($a['dept'] < $b['dept']) { return 0; } } Result: <?php function cmp_dept($a, $b) { if ($a['dept'] > $b['dept']) { return 1; } else if ($a['dept'] < $b['dept']) { return false; } else if ($a['dept'] < $b['dept']) { return 0; } }