Beispiel #1
0
 /**
  * sameValueAs.
  *
  * @param ValueObjectInterface|static $valueObject
  *
  * @return bool
  */
 public function sameValueAs(ValueObjectInterface $valueObject)
 {
     if (!Util::classEquals($this, $valueObject)) {
         return false;
     }
     return $this->amount()->sameValueAs($valueObject->amount()) && $this->currency()->sameValueAs($valueObject->currency());
 }
 protected function assertSameClass(NumberInterface $number)
 {
     if (!Util::classEquals($this, $number)) {
         throw new InvalidArgumentException($number, array(Util::className($this)));
     }
 }