本文整理匯總了PHP中Phan\Language\Context::hasSuppressIssue方法的典型用法代碼示例。如果您正苦於以下問題:PHP Context::hasSuppressIssue方法的具體用法?PHP Context::hasSuppressIssue怎麽用?PHP Context::hasSuppressIssue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Phan\Language\Context
的用法示例。
在下文中一共展示了Context::hasSuppressIssue方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: maybeEmitWithParameters
/**
* @param CodeBase $code_base
* The code base within which we're operating
*
* @param Context $context
* The context in which the node we're going to be looking
* at exits.
*
* @param string $issue_type
* The type of issue to emit such as Issue::ParentlessClass
*
* @param int $lineno
* The line number where the issue was found
*
* @param array parameters
* Template parameters for the issue's error message
*
* @return void
*/
public static function maybeEmitWithParameters(CodeBase $code_base, Context $context, string $issue_type, int $lineno, array $parameters)
{
if ($context->hasSuppressIssue($code_base, $issue_type)) {
return;
}
Issue::emitWithParameters($issue_type, $context->getFile(), $lineno, $parameters);
}
示例2: maybeEmitWithParameters
/**
* @param CodeBase $code_base
* The code base within which we're operating
*
* @param Context $context
* The context in which the node we're going to be looking
* at exits.
*
* @param string $issue_type
* The type of issue to emit such as Issue::ParentlessClass
*
* @param int $lineno
* The line number where the issue was found
*
* @param array parameters
* Template parameters for the issue's error message
*
* @return void
*/
public static function maybeEmitWithParameters(CodeBase $code_base, Context $context, string $issue_type, int $lineno, array $parameters)
{
// If this issue type has been suppressed in
// the config, ignore it
if (in_array($issue_type, Config::get()->suppress_issue_types ?? [])) {
return;
}
if ($context->hasSuppressIssue($code_base, $issue_type)) {
return;
}
Issue::emitWithParameters($issue_type, $context->getFile(), $lineno, $parameters);
}
示例3: maybeEmitWithParameters
/**
* @param CodeBase $code_base
* The code base within which we're operating
*
* @param Context $context
* The context in which the node we're going to be looking
* at exits.
*
* @param string $issue_type
* The type of issue to emit such as Issue::ParentlessClass
*
* @param int $lineno
* The line number where the issue was found
*
* @param array parameters
* Template parameters for the issue's error message
*
* @return void
*/
public static function maybeEmitWithParameters(CodeBase $code_base, Context $context, string $issue_type, int $lineno, array $parameters)
{
// If this issue type has been suppressed in
// the config, ignore it
if (!Config::get()->disable_suppression && in_array($issue_type, Config::get()->suppress_issue_types ?? [])) {
return;
}
// If a white-list of allowed issue types is defined,
// only emit issues on the white-list
if (!Config::get()->disable_suppression && count(Config::get()->whitelist_issue_types) > 0 && !in_array($issue_type, Config::get()->whitelist_issue_types ?? [])) {
return;
}
if (!Config::get()->disable_suppression && $context->hasSuppressIssue($code_base, $issue_type)) {
return;
}
Issue::emitWithParameters($issue_type, $context->getFile(), $lineno, $parameters);
}