示例#1
0
 /**
  * {@inheritdoc}
  */
 public function getBinding(Uuid $uuid)
 {
     throw NoSuchBindingException::forUuid($uuid);
 }
 /**
  * {@inheritdoc}
  */
 public function getBinding(Uuid $uuid)
 {
     if (!isset($this->keysByUuid[$uuid->toString()])) {
         throw NoSuchBindingException::forUuid($uuid);
     }
     $key = $this->keysByUuid[$uuid->toString()];
     if (!isset($this->bindingsByKey[$key])) {
         $this->loadBindingsForKey($key);
     }
     foreach ($this->bindingsByKey[$key] as $binding) {
         if ($binding->getUuid()->equals($uuid)) {
             return $binding;
         }
     }
     // This does not happen except if someone plays with the key-value store
     // contents (or there's a bug here..)
     throw new RuntimeException('The discovery is corrupt. Please rebuild it.');
 }
示例#3
0
 /**
  * {@inheritdoc}
  */
 public function getBinding(Uuid $uuid)
 {
     if (!isset($this->bindings[$uuid->toString()])) {
         throw NoSuchBindingException::forUuid($uuid);
     }
     return $this->bindings[$uuid->toString()];
 }