Home » PHP » PHP_Beautifier » Bug #7818
Curly brackets being treated as method body
Details
| Submitted | 2006-06-06 07:31 UTC |
|---|---|
| From | studio at peptolab dot com |
| Assigned | clbustos |
| Status | Closed |
| Package | PHP_Beautifier |
| PHP Version | 5.1.4 |
| OS | Any |
| Roadmaps | (Not assigned) |
Comments
[2006-06-06 07:31 UTC] studio at peptolab dot com
Description:
------------
Where curly brackets are used to indicate a variable class
property, PHP_Beautifier adds extra whitespace as if it were
parsing a class method or function.
Test script:
---------------
php_beautifier -l "Pear()" -r 'myfile.php' beautified.php
With the snippet:-
<?php
protected function _build($defaults = false)
{
$form = new myForm();
$form->addElement('header');
foreach($this->_table->getFields() as $field) {
$field->createElement($form, $this->_table->{$field->id}, $defaults);
}
return $form;
}
?>
Expected result:
----------------
$field->createElement($form, $this->_table->{$field->id},
$defaults);
Actual result:
--------------
$field->createElement($form, $this->_table->
{
$field->id
}, $defaults);
[2006-06-06 23:07 UTC] clbustos at php dot net
Solved. Wait for next version.
[2006-06-07 01:47 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
Thank for the support.
Fixed on v0.1.10