mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-11-30 04:19:30 +01:00
Fix some pretty printing issues
This commit is contained in:
parent
8a3074db38
commit
e6b356af45
@ -18,6 +18,10 @@ abstract class NodeAbstract implements IteratorAggregate
|
||||
return $this->subNodes[$name];
|
||||
}
|
||||
|
||||
public function __isset($name) {
|
||||
return isset($this->subNodes[$name]);
|
||||
}
|
||||
|
||||
public function getType() {
|
||||
return substr(get_class($this), 5);
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ class PrettyPrinter_Zend extends PrettyPrinterAbstract
|
||||
|
||||
public function pStmt_ClassMethod(Node_Stmt_ClassMethod $node) {
|
||||
return $this->pModifiers($node->type)
|
||||
. 'function ' . $node->name
|
||||
. 'function ' . ($node->byRef ? '&' : '') . $node->name
|
||||
. '(' . $this->pCommaSeparated($node->params) . ')'
|
||||
. (null !== $node->stmts
|
||||
? "\n" . '{' . "\n" . $this->pIndent($this->pStmts($node->stmts)) . '}'
|
||||
|
@ -120,7 +120,7 @@ abstract class PrettyPrinterAbstract
|
||||
if (isset($this->precedanceMap[$type])) {
|
||||
$precedence = $this->precedanceMap[$type];
|
||||
|
||||
if ($precedence > $this->precedenceStack[$this->precedenceStackPos]) {
|
||||
if ($precedence >= $this->precedenceStack[$this->precedenceStackPos]) {
|
||||
$this->precedenceStack[++$this->precedenceStackPos] = $precedence;
|
||||
$return = '(' . $this->{'p' . $type}($node) . ')';
|
||||
--$this->precedenceStackPos;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$DIR = '../../symfonySandbox';
|
||||
$DIR = '../../Symfony';
|
||||
|
||||
function __autoload($class) {
|
||||
is_file($file = '../lib/' . strtr($class, '_', '/') . '.php') && require_once $file;
|
||||
|
Loading…
Reference in New Issue
Block a user