/** * {@inheritdoc} */ public function execute() { // sanity check if ($this->bindingDescriptor->isLoaded()) { return; } $typeName = $this->bindingDescriptor->getTypeName(); $typeDescriptor = $this->typeDescriptors->contains($typeName) ? $this->typeDescriptors->getFirst($typeName) : null; $this->bindingDescriptor->load($this->containingPackage, $typeDescriptor); $uuid = $this->bindingDescriptor->getUuid(); if ($this->bindingDescriptors->contains($uuid)) { $this->previousDescriptor = $this->bindingDescriptors->get($uuid); } $this->bindingDescriptors->add($this->bindingDescriptor); }
/** * {@inheritdoc} */ public function execute() { // sanity check if (!$this->bindingDescriptor->isLoaded()) { return; } $this->containingPackage = $this->bindingDescriptor->getContainingPackage(); $this->typeDescriptor = $this->bindingDescriptor->getTypeDescriptor(); $uuid = $this->bindingDescriptor->getUuid(); // never fails with the check in the beginning $this->bindingDescriptor->unload(); if ($this->bindingDescriptors->contains($uuid) && $this->bindingDescriptor === $this->bindingDescriptors->get($uuid)) { // never fails $this->bindingDescriptors->remove($uuid); $this->wasRemoved = true; } }
/** * {@inheritdoc} */ public function execute() { if (!$this->snapshotTaken) { throw new LogicException('takeSnapshot() was not called'); } // Remember for rollback() $this->enabledBindingAfter = null; if ($this->bindingDescriptors->contains($this->uuid)) { $bindingDescriptor = $this->bindingDescriptors->get($this->uuid); if ($bindingDescriptor->isEnabled()) { // Clone so that rollback() works if the binding is unloaded $this->enabledBindingAfter = clone $bindingDescriptor; } } $this->syncBindingUuid($this->enabledBindingBefore, $this->enabledBindingAfter); }
private function getUuidsByTypeName($typeName) { $uuids = array(); foreach ($this->bindingDescriptors->getUuids() as $uuid) { if ($typeName === $this->bindingDescriptors->get($uuid)->getTypeName()) { $uuids[$uuid->toString()] = $uuid; } } return $uuids; }
/** * {@inheritdoc} */ public function postExecute() { $this->reloadBindingDescriptor($this->bindingDescriptors->get($this->uuid)); }