-
-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
We have a class like this--
class Math
{
public static function minimumOf(BigNumber $a, BigNumber $b): BigNumber
{
return $a->isLessThanOrEqualTo($b) ? $a : $b;
}
public static function maximumOf(BigNumber $a, BigNumber $b): BigNumber
{
return $a->isGreaterThanOrEqualTo($b) ? $a : $b;
}
}Now, if we pass instances of BigDecimal to minimumOf and want to plus a number to BigNumber that is returned (an instance of BigDecimal, that's not possible because plus and minus don't exist in the abstract class. What I need to do now is call another method in the chain toBigDecimal before being able to do so. It's not clean. I see no problem adding them to the abstract class. What do you say?
Metadata
Metadata
Assignees
Labels
No labels