PHPMD は、このテストでは else ブロックを避けるべきだと言っていますが、その場合、それらを削除する方法が見つかりません。
コードは次のとおりです。
if ($fight->c1 == NULL) {
if ($fight->c2 == NULL) {
// C1 and C2 Is Bye
$this->assertEquals($parentFight->$toUpdate, NULL);
}
else {
// C1 Is Bye
$this->assertEquals($parentFight->$toUpdate, $fight->c2);
}
}
else {
if ($fight->c2 == NULL) {
// C2 Is Bye
$this->assertEquals($parentFight->$toUpdate, $fight->c1);
}
else {
// C1 and C2 Are all set
$this->assertEquals($parentFight->$toUpdate, NULL);
}
}
何か案が???