$addition = new AdditionOperator('SimplePHPEasyPlus\Number\SimpleNumber');
String constants are almost as bad code smell as the addition operator. SimpleNumber class should provide a static method that returns its reflection. Something like this:
public static function getReflection()
{
return new ReflectionClass(get_called_class());
}
AdditionOperator could use ReflectionClass::newInstance() instead of new $resultClass() and the line mentioned above would look much cleaner then:
$addition = new AdditionOperator(SimpleNumber::getReflection());
I don't really like this line from the readme:
String constants are almost as bad code smell as the addition operator. SimpleNumber class should provide a static method that returns its reflection. Something like this:
AdditionOperator could use
ReflectionClass::newInstance()
instead ofnew $resultClass()
and the line mentioned above would look much cleaner then: