Exemple #1
0
 /**
  * This method will return <b>true</b> when the given variable node is
  * not the child of a property postfix node.
  *
  * @param PHP_PMD_AbstractNode $variable The currently analyzed variable node.
  *
  * @return boolean
  */
 private function _isNotStaticPostfix(PHP_PMD_AbstractNode $variable)
 {
     $parent = $variable->getParent();
     if (is_object($parent) && $parent->isInstanceOf('PropertyPostfix')) {
         return !($parent->getParent()->getImage() === '::');
     }
     return true;
 }
 /**
  * Checks if the given node is a direct or indirect child of a node with
  * the given type.
  *
  * @param PHP_PMD_AbstractNode $node The context source code node.
  * @param string               $type Possible parent type.
  *
  * @return boolean
  */
 private function isChildOf(PHP_PMD_AbstractNode $node, $type)
 {
     $parent = $node->getParent();
     while (is_object($parent)) {
         if ($parent->isInstanceOf($type)) {
             return true;
         }
         $parent = $parent->getParent();
     }
     return false;
 }
 /**
  * Checks if the given node is a direct or indirect child of a node with
  * the given type.
  *
  * @param PHP_PMD_AbstractNode $node The context source code node.
  * @param string               $type Possible parent type.
  *
  * @return boolean
  */
 private function _isChildOf(PHP_PMD_AbstractNode $node, $type)
 {
     $parent = $node->getParent();
     if ($parent->isInstanceOf($type)) {
         return true;
     }
     return false;
 }