public function execute() { $typeName = $this->typeDescriptor->getName(); if ($this->rootPackageFile->hasTypeDescriptor($typeName)) { $this->previousDescriptor = $this->rootPackageFile->getTypeDescriptor($typeName); } $this->rootPackageFile->addTypeDescriptor($this->typeDescriptor); }
/** * {@inheritdoc} */ public function execute() { if (!$this->rootPackageFile->hasTypeDescriptor($this->typeName)) { return; } $this->previousDescriptor = $this->rootPackageFile->getTypeDescriptor($this->typeName); $this->rootPackageFile->removeTypeDescriptor($this->typeName); }