本文整理汇总了PHP中PHP_PMD_AbstractNode::getImage方法的典型用法代码示例。如果您正苦于以下问题:PHP PHP_PMD_AbstractNode::getImage方法的具体用法?PHP PHP_PMD_AbstractNode::getImage怎么用?PHP PHP_PMD_AbstractNode::getImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHP_PMD_AbstractNode
的用法示例。
在下文中一共展示了PHP_PMD_AbstractNode::getImage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkNodeImage
/**
* {@inheritdoc}
*/
protected function checkNodeImage(PHP_PMD_AbstractNode $node)
{
$excludedVariables = explode('|', $this->getStringProperty('excludeVariables'));
if (!in_array($node->getImage(), $excludedVariables)) {
parent::checkNodeImage($node);
}
}
示例2: apply
public function apply(PHP_PMD_AbstractNode $node)
{
$staticReferences = $node->findChildrenOfType('ClassOrInterfaceReference');
foreach ($staticReferences as $reference) {
if ($this->isReferenceInParameter($reference)) {
continue;
}
$this->addViolation($reference, array($reference->getImage(), $node->getImage()));
}
}
示例3: apply
public function apply(PHP_PMD_AbstractNode $node)
{
foreach ($node->findChildrenOfType('FormalParameter') as $param) {
$declarator = $param->getFirstChildOfType('VariableDeclarator');
$value = $declarator->getValue();
if (!$this->isBooleanValue($value)) {
continue;
}
$this->addViolation($param, array($node->getImage(), $declarator->getImage()));
}
}
示例4: apply
public function apply(PHP_PMD_AbstractNode $node)
{
return;
// not good enough, if, elseif,... nest each other and get detected by this rule :(
foreach ($node->findChildrenOfType('ScopeStatement') as $scope) {
if (!$this->isNestedScope($scope)) {
continue;
}
$this->addViolation($scope, array($node->getImage()));
}
}
示例5: apply
public function apply(PHP_PMD_AbstractNode $node)
{
foreach ($node->findChildrenOfType('ScopeStatement') as $scope) {
$parent = $scope->getParent();
if (!$this->isIfOrElseIfStatement($parent)) {
continue;
}
if (!$this->isElseScope($scope, $parent)) {
continue;
}
$this->addViolation($scope, array($node->getImage()));
}
}
示例6: isNotSuperGlobal
/**
* Tests if the given variable represents one of the PHP super globals
* that are available in scopes.
*
* @param PHP_PMD_AbstractNode $variable The currently analyzed variable node.
*
* @return boolean
*/
protected function isNotSuperGlobal(PHP_PMD_AbstractNode $variable)
{
return !isset(self::$_superGlobals[$variable->getImage()]);
}
示例7: isNotProcessed
/**
* Checks if the given node was already processed.
*
* @param PHP_PMD_AbstractNode $node The node to check.
*
* @return boolean
*/
protected function isNotProcessed(PHP_PMD_AbstractNode $node)
{
return !isset($this->processedVariables[$node->getImage()]);
}