remove space between ")" and "," when using ArrayNested filter#4
Open
kcivey wants to merge 1 commit intoclbustos:masterfrom
survos:remove-space-before-comma
Open
remove space between ")" and "," when using ArrayNested filter#4kcivey wants to merge 1 commit intoclbustos:masterfrom survos:remove-space-before-comma
kcivey wants to merge 1 commit intoclbustos:masterfrom
survos:remove-space-before-comma
Conversation
|
Replace content in pear/php/Beautifier/Filter/ArrayNested.filter.php as this: - $aMyArray = array( - array( - array( - array( - 'el'=>1, - 'el'=>2 - ) - ) - ) - ); - - @category PHP - @Package PHP_Beautifier - @subpackage Filter - @author Claudio Bustos cdx@users.sourceforge.com - @copyright 2004-2010 Claudio Bustos - @link http://pear.php.net/package/PHP_Beautifier - @link http://beautifyphp.sourceforge.net - @license http://www.php.net/license/3_0.txt PHP License 3.0 - @Version Release: 0.1.15 */ class PHP_Beautifier_Filter_ArrayNested extends PHP_Beautifier_Filter { public function t_parenthesis_open($sTag) { $this->oBeaut->add($sTag); if ($this->oBeaut->getControlParenthesis() == T_ARRAY) { $this->oBeaut->addNewLine(); $this->oBeaut->incIndent(); $this->oBeaut->addIndent(); } } public function t_parenthesis_close($sTag) { $this->oBeaut->removeWhitespace(); if ($this->oBeaut->getControlParenthesis() == T_ARRAY) { $this->oBeaut->decIndent(); if ($this->oBeaut->getPreviousTokenContent() != '(') { $this->oBeaut->addNewLine(); $this->oBeaut->addIndent(); } $this->oBeaut->add($sTag); } else { $this->oBeaut->add($sTag); } } public function t_comma($sTag) { if ($this->oBeaut->getControlParenthesis() != T_ARRAY) { $this->oBeaut->add($sTag); } else { $this->oBeaut->add($sTag); $this->oBeaut->addNewLine(); $this->oBeaut->addIndent(); } } } ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm assuming the space before the comma after an array when using the ArrayNested filter is unintentional. This patch gets rid of it.