本文整理匯總了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;
}