FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=14754&edit=1

ID: 14754
Updated by: clbustos@surnet.cl
Reported By: fidian at rumkin dot com
Summary: Comment at end of function throws off control
sequence
-Status: Open
+Status: Closed
Type: Bug
Package: PHP_Beautifier
Operating System: Linux (various)
Package Version: 0.1.14
PHP Version: 5.2.4
-Assigned To:
+Assigned To: clbustos
-Roadmap Versions:
+Roadmap Versions: 1.0.0RC1
New Comment:

-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: clbustos
-Roadmap Versions:
+Roadmap Versions: 1.0.0RC1
This bug has been fixed in SVN.

If this was a documentation problem, the fix will appear on
pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should
be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.

Thanks for the patch!


Previous Comments:
------------------------------------------------------------------------

[2008-10-06 15:35:36] fidian

Description:
------------
If you add a comment at the end of a function inside a class, the
closing brace thinks it is not the ending brace of the function.

Test script:
---------------
<?PHP
class Z {
public function a() {
echo "hi";
}
private function b() {
echo "hi"; // Comment
}
private function c() {
echo "hi";
}
}
----------------------------------------
<?php
class PHP_Beautifier_Filter_BBY extends PHP_Beautifier_Filter {
function t_access($sTag) {

$this->oBeaut->add($this->oBeaut->getTokenName($this->oBeaut->getControlSeq()));
return PHP_Beautifier_Filter::BYPASS;
}
}

Expected result:
----------------
<?PHP
class Z {
T_CLASSfunction a() {
echo "hi";
}
T_CLASSfunction b() {
echo "hi"; // Comment

}
T_CLASSfunction c() {
echo "hi";
}
}


Actual result:
--------------
<?PHP
class Z {
T_CLASSfunction a() {
echo "hi";
}
T_CLASSfunction b() {
echo "hi"; // Comment

}
T_FUNCTIONfunction c() {
echo "hi";
}
}

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMar 16, '10 at 5:58a
activeMar 16, '10 at 5:58a
posts1
users1
websitepear.php.net

1 user in discussion

Clbustos: 1 post

People

Translate

site design / logo © 2022 Grokbase