Rename pSafe to pNoIndent

Matches the function more closely
This commit is contained in:
nikic 2012-10-31 17:50:54 +01:00
parent df17d62b40
commit fc56da59ce
2 changed files with 3 additions and 3 deletions

View File

@ -70,7 +70,7 @@ class PHPParser_PrettyPrinter_Zend extends PHPParser_PrettyPrinterAbstract
// Scalars
public function pScalar_String(PHPParser_Node_Scalar_String $node) {
return '\'' . $this->pSafe(addcslashes($node->value, '\'\\')) . '\'';
return '\'' . $this->pNoIndent(addcslashes($node->value, '\'\\')) . '\'';
}
public function pScalar_Encapsed(PHPParser_Node_Scalar_Encapsed $node) {
@ -672,7 +672,7 @@ class PHPParser_PrettyPrinter_Zend extends PHPParser_PrettyPrinterAbstract
}
public function pStmt_InlineHTML(PHPParser_Node_Stmt_InlineHTML $node) {
return '?>' . $this->pSafe(
return '?>' . $this->pNoIndent(
("\n" === $node->value[0] || "\r" === $node->value[0] ? "\n" : '')
. $node->value
) . '<?php ';

View File

@ -207,7 +207,7 @@ abstract class PHPParser_PrettyPrinterAbstract
*
* @return mixed String marked with $this->noIndentToken's.
*/
protected function pSafe($string) {
protected function pNoIndent($string) {
return str_replace("\n", "\n" . $this->noIndentToken, $string);
}