Пример #1
0
 /**
  * {@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());
     }
 }
Пример #2
0
 /**
  * {@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;
     }
 }