当前位置: 首页>>代码示例>>PHP>>正文


PHP PHP_PMD_AbstractNode::getName方法代码示例

本文整理汇总了PHP中PHP_PMD_AbstractNode::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP PHP_PMD_AbstractNode::getName方法的具体用法?PHP PHP_PMD_AbstractNode::getName怎么用?PHP PHP_PMD_AbstractNode::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHP_PMD_AbstractNode的用法示例。


在下文中一共展示了PHP_PMD_AbstractNode::getName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: apply

 /**
  * This method checks if a method is not named in camelCase
  * and emits a rule violation.
  *
  * @param PHP_PMD_AbstractNode $node The context source code node.
  *
  * @return void
  */
 public function apply(PHP_PMD_AbstractNode $node)
 {
     if (!in_array($node->getName(), $this->ignoredMethods)) {
         if (!preg_match('/^[a-z][a-zA-Z0-9]*$/', $node->getName())) {
             $this->addViolation($node, array($node->getName()));
         }
     }
 }
开发者ID:syntropysoftware,项目名称:cryptoffice-frontend,代码行数:16,代码来源:CamelCaseMethodName.php

示例2: apply

 /**
  * Extracts all variable and variable declarator nodes from the given node
  * and checks the variable name length against the configured minimum
  * length.
  *
  * @param PHP_PMD_AbstractNode $node The context source code node.
  *
  * @return void
  */
 public function apply(PHP_PMD_AbstractNode $node)
 {
     if (strcasecmp($node->getName(), $node->getParentName()) !== 0) {
         return;
     }
     $this->addViolation($node);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:16,代码来源:ConstructorWithNameAsEnclosingClass.php

示例3: apply

 /**
  * Extracts all variable and variable declarator nodes from the given node
  * and checks the variable name length against the configured minimum
  * length.
  *
  * @param PHP_PMD_AbstractNode $node The context source code node.
  *
  * @return void
  */
 public function apply(PHP_PMD_AbstractNode $node)
 {
     if ($this->getIntProperty('minimum') <= strlen($node->getName())) {
         return;
     }
     $this->addViolation($node, array($node->getParentName(), $node->getName()));
 }
开发者ID:kingsj,项目名称:core,代码行数:16,代码来源:ShortMethodName.php

示例4: apply

 /**
  * This method checks if a class is not named in CamelCase
  * and emits a rule violation.
  *
  * @param PHP_PMD_AbstractNode $node The context source code node.
  *
  * @return void
  */
 public function apply(PHP_PMD_AbstractNode $node)
 {
     if (!preg_match('/^[A-Z][a-zA-Z0-9]*$/', $node->getName())) {
         $this->addViolation($node, array($node->getName()));
     }
 }
开发者ID:syntropysoftware,项目名称:cryptoffice-frontend,代码行数:14,代码来源:CamelCaseClassName.php

示例5: apply

 /**
  * This method checks if a given function or method contains an eval-expression
  * and emits a rule violation when it exists.
  *
  * @param PHP_PMD_AbstractNode $node The context source code node.
  *
  * @return void
  */
 public function apply(PHP_PMD_AbstractNode $node)
 {
     foreach ($node->findChildrenOfType('EvalExpression') as $eval) {
         $this->addViolation($eval, array($node->getType(), $node->getName()));
     }
 }
开发者ID:n2bh,项目名称:phpmd,代码行数:14,代码来源:EvalExpression.php

示例6: __construct

 /**
  * Constructs a new rule violation instance.
  *
  * @param PHP_PMD_AbstractRule $rule             PHP_PMD rule for violation.
  * @param PHP_PMD_AbstractNode $node             The source node of evil.
  * @param string               $violationMessage The error/report message.
  */
 public function __construct(PHP_PMD_AbstractRule $rule, PHP_PMD_AbstractNode $node, $violationMessage)
 {
     $this->_rule = $rule;
     $this->_node = $node;
     $this->_description = $violationMessage;
     if ($node instanceof PHP_PMD_Node_AbstractType) {
         $this->_className = $node->getName();
     } else {
         if ($node instanceof PHP_PMD_Node_Method) {
             $this->_className = $node->getParentName();
             $this->_CodeMethodName = $node->getName();
         } else {
             if ($node instanceof PHP_PMD_Node_Function) {
                 $this->_functionName = $node->getName();
             }
         }
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:25,代码来源:RuleViolation.php

示例7: apply

 /**
  * This method should implement the violation analysis algorithm of concrete
  * rule implementations. All extending classes must implement this method.
  *
  * @param PHP_PMD_AbstractNode $node The current context for analysis.
  *
  * @return void
  */
 public function apply(PHP_PMD_AbstractNode $node)
 {
     foreach ($node->findChildrenOfType('GotoStatement') as $goto) {
         $this->addViolation($goto, array($node->getType(), $node->getName()));
     }
 }
开发者ID:syntropysoftware,项目名称:cryptoffice-frontend,代码行数:14,代码来源:GotoStatement.php


注:本文中的PHP_PMD_AbstractNode::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。