 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
leborgne
Joined: 10 Feb 2009 Posts: 1
|
Posted: Tue Feb 10, 2009 12:14 pm Post subject: PHP_Beautifier and blank lines |
|
|
hello
i've just try it yesterday, integrating the call into eclipse/aptana.
I got one problem, it remove empty lines in my code.
Is it possible to avoid this ?
here is my config script
i work with wamp 2.0
| Code: | @ECHO OFF
SET PHP=D:\wamp\bin\php\php5.2.8\php.exe
SET BEAUTIFY=D:\wamp\bin\php\php5.2.8\php_beautifier
%PHP% -d output_buffering=1 -f %BEAUTIFY% -- --filters "Lowercase()" --input %1 --output %1~
%PHP% -d output_buffering=1 -f %BEAUTIFY% -- -l "ListClassFunction() IndentStyles(style=k&r) NewLines(before=if:else:switch:T_CLASS:public:T_FUNCTION)" -t2 --input %1~
del %1~ |
here is a sample script to beautify
| Code: | <?php
# this is a test
phpinfo();
if(true){$var1 = 'test'; $var3 = 'test';} else {echo 'test ici';}
switch (true) {
case 1:
echo 'here'; break;
case 2:
echo 'there';
break;
}CLASS test { PUBLIC $t1; PUBLIC $t2;
protected $t3;
protected $t4;
private $t5;
private $t6;
public function __construct(){
$this->t1 = 1;
$this->t2 = 2;
}
}function foo(){ echo 'bar';}
$a = array(array(1,2,3,4),array(4,5,6),array(7,8,8));
?>
|
and here is the result
| Code: | <?php
/**
* Class and Function List:
* Function list:
* - __construct()
* - foo()
* Classes list:
* - test
*/
# this is a test
phpinfo();
if (true) {
$var1 = 'test';
$var3 = 'test';
}
else {
echo 'test ici';
}
switch (true) {
case 1:
echo 'here';
break;
case 2:
echo 'there';
break;
}
class test {
public $t1;
public $t2;
protected $t3;
protected $t4;
private $t5;
private $t6;
public
function __construct() {
$this->t1 = 1;
$this->t2 = 2;
}
}
function foo() {
echo 'bar';
}
$a = array(array(1, 2, 3, 4), array(4, 5, 6), array(7, 8, 8));
?>
|
i'de like to keep blank line if possible
and don't put a new line in function if there is public/private ...
does anyone have an experience with this module ?
thx
john |
|
| Back to top |
|
 |
Noahh
Joined: 13 Mar 2010 Posts: 1
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|