Пример #1
0
 public function testObjectsCanBeUsedAsId()
 {
     $contract = new Contract(new \stdClass());
     $this->assertEquals('stdClass', $contract->toString());
     $this->assertEquals('stdClass', (string) $contract);
 }
Пример #2
0
 /**
  * @param Contract $contract
  *
  * @return SerializesData
  */
 private function getSerializerForRegisteredContract(Contract $contract)
 {
     return $this->serializerMap[$contract->toString()];
 }
 /**
  * @throws DefaultSerializationContractIsNotRegistered
  */
 private function guardDefaultContractIsRegistered()
 {
     if (!$this->registry->isContractRegistered($this->defaultContract)) {
         throw new DefaultSerializationContractIsNotRegistered($this->defaultContract->toString());
     }
 }