Add missing doc and pretty print for Stmt_Declare

This commit is contained in:
nikic 2011-09-23 18:53:11 +02:00
parent ea65ea7a32
commit 8bd8e815c9
3 changed files with 17 additions and 0 deletions

View File

@ -1,5 +1,9 @@
<?php <?php
/**
* @property PHPParser_Node_Stmt_DeclareDeclare[] $declares List of declares
* @property PHPParser_Node[] $stmts Statements
*/
class PHPParser_Node_Stmt_Declare extends PHPParser_Node_Stmt class PHPParser_Node_Stmt_Declare extends PHPParser_Node_Stmt
{ {
} }

View File

@ -1,5 +1,9 @@
<?php <?php
/**
* @property string $key Key
* @property PHPParser_Node_Expr $value Value
*/
class PHPParser_Node_Stmt_DeclareDeclare extends PHPParser_Node_Stmt class PHPParser_Node_Stmt_DeclareDeclare extends PHPParser_Node_Stmt
{ {
} }

View File

@ -495,6 +495,15 @@ class PHPParser_PrettyPrinter_Zend extends PHPParser_PrettyPrinterAbstract
return $node->name . ' = ' . $this->p($node->value); return $node->name . ' = ' . $this->p($node->value);
} }
public function pStmt_Declare(PHPParser_Node_Stmt_Declare $node) {
return 'declare (' . $this->pCommaSeparated($node->declares) . ') {'
. "\n" . $this->pStmts($node->stmts) . "\n" . '}';
}
public function pStmt_DeclareDeclare(PHPParser_Node_Stmt_DeclareDeclare $node) {
return $node->key . ' = ' . $node->value;
}
// Control flow // Control flow
public function pStmt_If(PHPParser_Node_Stmt_If $node) { public function pStmt_If(PHPParser_Node_Stmt_If $node) {