public function rollback()
 {
     if ($this->previousDescriptor) {
         $this->rootModuleFile->addTypeDescriptor($this->previousDescriptor);
     } else {
         $this->rootModuleFile->removeTypeDescriptor($this->typeDescriptor->getTypeName());
     }
 }
 /**
  * {@inheritdoc}
  */
 public function rollback()
 {
     // sanity check
     if (!$this->typeDescriptor->isLoaded()) {
         return;
     }
     $typeName = $this->typeDescriptor->getTypeName();
     // never fails with the check before
     $this->typeDescriptor->unload();
     if ($this->previousDescriptor && $this->previousDescriptor->isLoaded()) {
         // never fails
         $this->typeDescriptors->add($this->previousDescriptor);
     } else {
         // never fails
         $this->typeDescriptors->remove($typeName, $this->containingPackage->getName());
     }
 }
 /**
  * {@inheritdoc}
  */
 public function execute()
 {
     // sanity check
     if (!$this->typeDescriptor->isLoaded()) {
         return;
     }
     // never fails with the check before
     $this->containingModule = $this->typeDescriptor->getContainingModule();
     $typeName = $this->typeDescriptor->getTypeName();
     $moduleName = $this->containingModule->getName();
     // never fails with the check before
     $this->typeDescriptor->unload();
     if ($this->typeDescriptors->contains($typeName, $moduleName) && $this->typeDescriptor === $this->typeDescriptors->get($typeName, $moduleName)) {
         // never fails
         $this->typeDescriptors->remove($typeName, $moduleName);
         $this->wasRemoved = true;
     }
 }
Beispiel #4
0
 private function unloadTypeDescriptor(BindingTypeDescriptor $typeDescriptor)
 {
     $typeName = $typeDescriptor->getTypeName();
     return new InterceptedOperation(new UnloadTypeDescriptor($typeDescriptor, $this->typeDescriptors), array(new UpdateDuplicateMarksForTypeName($typeName, $this->typeDescriptors), new ReloadBindingDescriptorsByTypeName($typeName, $this->bindingDescriptors, $this->typeDescriptors)));
 }
 private function typesEqual(BindingTypeDescriptor $descriptor1, BindingTypeDescriptor $descriptor2)
 {
     return $descriptor1->getTypeName() === $descriptor2->getTypeName() && $descriptor1->getDescription() === $descriptor2->getDescription() && $descriptor1->getParameterDescriptions() === $descriptor2->getParameterDescriptions() && $descriptor1->getType()->getParameters() === $descriptor2->getType()->getParameters();
 }
Beispiel #6
0
 /**
  * {@inheritdoc}
  */
 public function rollback()
 {
     $this->discovery->unbind($this->bindingDescriptor->getQuery(), $this->bindingDescriptor->getTypeName(), $this->bindingDescriptor->getParameterValues(), $this->bindingDescriptor->getLanguage());
 }
Beispiel #7
0
 /**
  * Adds a type descriptor.
  *
  * @param BindingTypeDescriptor $descriptor The type descriptor.
  */
 public function addTypeDescriptor(BindingTypeDescriptor $descriptor)
 {
     $this->typeDescriptors[$descriptor->getTypeName()] = $descriptor;
 }
 /**
  * {@inheritdoc}
  */
 public function rollback()
 {
     $this->discovery->removeBindingType($this->typeDescriptor->getTypeName());
 }