function ClassLike::getMethod
Gets method with the given name defined directly in this class/interface/trait.
Parameters
string $name Name of the method (compared case-insensitively):
Return value
ClassMethod|null Method node or null if the method does not exist
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ Node/ Stmt/ ClassLike.php, line 100
Class
Namespace
PhpParser\Node\StmtCode
public function getMethod(string $name) : ?ClassMethod {
$lowerName = strtolower($name);
foreach ($this->stmts as $stmt) {
if ($stmt instanceof ClassMethod && $lowerName === $stmt->name
->toLowerString()) {
return $stmt;
}
}
return null;
}