本文整理汇总了PHP中Phan\CodeBase::getMethodListByName方法的典型用法代码示例。如果您正苦于以下问题:PHP CodeBase::getMethodListByName方法的具体用法?PHP CodeBase::getMethodListByName怎么用?PHP CodeBase::getMethodListByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phan\CodeBase
的用法示例。
在下文中一共展示了CodeBase::getMethodListByName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: visitMethodCall
/**
* @param Node $node
* A node to parse
*
* @return Context
* A new or an unchanged context resulting from
* parsing the node
*/
public function visitMethodCall(Node $node) : Context
{
$method_name = $node->children['method'];
if (!is_string($method_name)) {
return $this->context;
}
try {
$method = (new ContextNode($this->code_base, $this->context, $node))->getMethod($method_name, false);
} catch (IssueException $exception) {
$exception->getIssueInstance()();
return $this->context;
} catch (NodeException $exception) {
// If we can't figure out the class for this method
// call, cry YOLO and mark every method with that
// name with a reference.
if (Config::get()->dead_code_detection) {
foreach ($this->code_base->getMethodListByName($method_name) as $method) {
$method->addReference($this->context);
}
}
// Swallow it
return $this->context;
}
// Check the call for paraemter and argument types
$this->analyzeCallToMethod($this->code_base, $method, $node);
return $this->context;
}