예제 #1
0
 /**
  * @param  ValueObjectInterface $object
  * @return int
  */
 public function spaceship(ValueObjectInterface $object)
 {
     return $this->getValue() < $object->getValue() ? -1 : ($this->getValue() > $object->getValue() ? 1 : 0);
 }
예제 #2
0
 /**
  * @param  ValueObjectInterface $object
  * @return static
  */
 public function exponentiation(ValueObjectInterface $object)
 {
     return new static(pow($this->getValue(), $object->getValue()));
 }