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 #7818

Curly brackets being treated as method body

Details

Submitted2006-06-06 07:31 UTC
Fromstudio at peptolab dot com
Assignedclbustos
StatusClosed
PackagePHP_Beautifier
PHP Version5.1.4
OSAny
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