phpauto formatting, spaces between operators and functions

I need to set up auto formatting for php to have spaces between functions e.g.

<?php
$one = 1;
$two = 2;
$three = 3;
if (true) {
     echo "Success";
}
for ($n = 1; $n<count($three); $n++) {
     $one++;
}
echo $one;
?>


to

<?php
$one = 1;
$two = 2;
$three = 3;

if (true) {
     echo "Success";
}

for ($n = 1; $n<count($three); $n++) {
     $one++;
}

echo $one;
?>


i know it used to cut lines if you have too many, but now with v6 even that does not work.

<?php
$one = 1;
$two = 2;
$three = 3;




if (true) {
     echo "Success";
}






for ($n = 1; $n<count($three); $n++) {
     $one++;
}


echo $one;
?>



this does not change.

1 comment
Comment actions Permalink

Hi Roman,

1. Automatically adding empty lines in such code (before/after specific code block -- for/if/etc) is not possible. Feel free to post Feature Request to the Issue Tracker.

2. Removing extra lines -- yes -- works fine. Please check your settings at "Settings | Code Style | PHP | Blank Lines | Keep Maximum Blank Lines --> In code"

screen01.png

0

Please sign in to leave a comment.