Beispiel #1
0
 /**
  * This method extracts all property postfix nodes from the given class and
  * removes all fields from the <b>$_fields</b> property that are accessed by
  * one of the postfix nodes.
  *
  * @param PHP_PMD_Node_Class $class The context class instance.
  *
  * @return void
  */
 private function _removeUsedFields(PHP_PMD_Node_Class $class)
 {
     foreach ($class->findChildrenOfType('PropertyPostfix') as $postfix) {
         if ($this->isInScopeOfClass($class, $postfix)) {
             $this->_removeUsedField($postfix);
         }
     }
 }
Beispiel #2
0
 /**
  * This method removes all used methods from the given methods array.
  *
  * @param PHP_PMD_Node_Class         $class   The context class instance.
  * @param array(PHP_PMD_Node_Method) $methods All collected private methods.
  *
  * @return array(PHP_PMD_AbstractNode)
  */
 private function _removeUsedMethods(PHP_PMD_Node_Class $class, array $methods)
 {
     foreach ($class->findChildrenOfType('MethodPostfix') as $postfix) {
         if ($this->_isClassScope($class, $postfix)) {
             unset($methods[strtolower($postfix->getImage())]);
         }
     }
     return $methods;
 }