PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PHP » PHP_Beautifier » Bug #8327

Layout of for loop

Details

Request #8327Layout of for loop
Submitted2006-07-31 10:24 UTC
Fromh dot stamerjohanns at iu-bremen dot de
Assignedclbustos
StatusClosed
PackagePHP_Beautifier
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2006-07-31 10:24 UTC] h dot stamerjohanns at iu-bremen dot de

Description:
------------
The filter "Pear" creates this for a simple for loop:
<?php
for ($i = 0 ; $i <= 10 ; $i++) {}
?>

There is one extra space before semicolon.

Test script:
---------------
Suggested patch:
--- Pear.filter.php 2006-07-31 12:06:31.000000000 +0200
+++ myPear.filter.php 2006-07-31 12:16:30.000000000 +0200
@@ -73,7 +73,7 @@
$this->oBeaut->addNewLineIndent();
} elseif ($this->oBeaut->getControlParenthesis() == T_FOR) {
$this->oBeaut->removeWhitespace();
- $this->oBeaut->add(" ".$sTag." ");
+ $this->oBeaut->add($sTag." ");
} else {
return PHP_Beautifier_Filter::BYPASS;

[2007-02-10 04:41 UTC] clbustos at php dot net

Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pear.php.net/get/PHP_Beautifier