PHPMD says 'Else is never necessary' for the following code:
if (!isset($myArray[$myKey])) { // or in_array
$myArray[$myKey] = $myValue;
} else {
$myArray[$myKey] += $myValue;
}
Is it possible to write this code in a cleaner way without a PHPMD warning?
I know "? ... : ..." is an option but it's still if/else.