isSubtypeOf() abstract public method

Checks that this user type is a subtype of the given $type instance.
Since: 1.0.6
abstract public isSubtypeOf ( AbstractASTType $type ) : boolean
$type AbstractASTType
return boolean
Example #1
0
 /**
  * Calculates the coupling between the given types.
  *
  * @param  \PDepend\Source\AST\AbstractASTType $declaringType
  * @param  \PDepend\Source\AST\AbstractASTType $coupledType
  * @return void
  * @since  0.10.2
  */
 private function calculateCoupling(AbstractASTType $declaringType, AbstractASTType $coupledType = null)
 {
     $this->initDependencyMap($declaringType);
     if (null === $coupledType) {
         return;
     }
     if ($coupledType->isSubtypeOf($declaringType) || $declaringType->isSubtypeOf($coupledType)) {
         return;
     }
     $this->initDependencyMap($coupledType);
     $this->dependencyMap[$declaringType->getId()]['ce'][$coupledType->getId()] = true;
     $this->dependencyMap[$coupledType->getId()]['ca'][$declaringType->getId()] = true;
 }