/**
  * @param Contract $contract
  *
  * @return SerializesData
  */
 private function getSerializerForRegisteredContract(Contract $contract)
 {
     return $this->serializerMap[$contract->toString()];
 }
 /**
  * @param CarriesCommitData $commitEnvelope
  *
  * @return mixed
  */
 private function getMetaDataFromCommitEnvelope(CarriesCommitData $commitEnvelope)
 {
     $metaDataContract = Contract::fromString($commitEnvelope->getMetaDataContract());
     return $this->unserializeDataWithContract($commitEnvelope->getMetaData(), $metaDataContract);
 }
Example #3
0
 public function testObjectsCanBeUsedAsId()
 {
     $contract = new Contract(new \stdClass());
     $this->assertEquals('stdClass', $contract->toString());
     $this->assertEquals('stdClass', (string) $contract);
 }
 /**
  * @throws DefaultSerializationContractIsNotRegistered
  */
 private function guardDefaultContractIsRegistered()
 {
     if (!$this->registry->isContractRegistered($this->defaultContract)) {
         throw new DefaultSerializationContractIsNotRegistered($this->defaultContract->toString());
     }
 }