Skip to content

Commit c183ea0

Browse files
committed
Add a getProperties method to PHPParser_Node_Stmt_Class.
1 parent 971c63a commit c183ea0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

PHP-Parser/lib/PHPParser/Node/Stmt/Class.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ public function getMethods() {
7878
return $methods;
7979
}
8080

81+
public function getProperties() {
82+
$properties = array();
83+
foreach ($this->stmts as $stmt) {
84+
if ($stmt instanceof PHPParser_Node_Stmt_Property) {
85+
$stmt = $stmt->props[0];
86+
$properties[] = $stmt;
87+
}
88+
}
89+
return $properties;
90+
}
91+
8192
public static function verifyModifier($a, $b) {
8293
if ($a & 7 && $b & 7) {
8394
throw new PHPParser_Error('Multiple access type modifiers are not allowed');

0 commit comments

Comments
 (0)