mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-04 02:07:59 +01:00
1366e833a1
Class_, Interface_ and Trait_ extend the ClassLike node, which provides the getMethods() method.
24 lines
462 B
PHP
24 lines
462 B
PHP
<?php
|
|
|
|
namespace PhpParser\Node\Stmt;
|
|
|
|
use PhpParser\Node;
|
|
|
|
/**
|
|
* Class, interface or trait.
|
|
*
|
|
* @property string $name Name
|
|
* @property Node[] $stmts Statements
|
|
*/
|
|
abstract class ClassLike extends Node\Stmt {
|
|
public function getMethods() {
|
|
$methods = array();
|
|
foreach ($this->stmts as $stmt) {
|
|
if ($stmt instanceof ClassMethod) {
|
|
$methods[] = $stmt;
|
|
}
|
|
}
|
|
return $methods;
|
|
}
|
|
}
|