/**
* 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;
}