Code Duplication    Length = 10-11 lines in 2 locations

src/Composer/Installer/AframeComponentInstaller.php 2 locations

@@ 122-132 (lines=11) @@
119
        $this->supportedByName($package->getPrettyName());
120
        $this->setComponentPath();
121
        
122
        if ($this->supportedByName($package->getPrettyName())) {
123
            $this->io->info(sprintf("Installing A-Frame Component %s", $this->aframe_component_name));
124
            
125
            if (! is_dir($this->getComponentSrcDistPath($package))) {
126
                $this->io->warning(sprintf('A-Frame Component %s can not be used since missing dist directory!', $this->aframe_component_name));
127
            } else {
128
                $this->filesystem->ensureDirectoryExists($this->getComponentPath());
129
                
130
                $this->copy($this->getComponentSrcDistPath($package), $this->getComponentPath());
131
            }
132
        }
133
    }
134
135
    /**
@@ 156-165 (lines=10) @@
153
        $this->supportedByName($target->getPrettyName());
154
        $this->setComponentPath();
155
        
156
        if ($this->supportedByName($target->getPrettyName())) {
157
            $this->io->info(sprintf("Updating A-Frame Component %s", $this->aframe_component_name));
158
            if (! is_dir($this->getComponentSrcDistPath($target))) {
159
                $this->io->warning(sprintf('A-Frame Component %s can not be used since missing dist directory!', $this->aframe_component_name));
160
            } else {
161
                $this->filesystem->removeDirectory($this->getComponentPath());
162
                $this->filesystem->ensureDirectoryExists($this->getComponentPath());
163
                $this->copy($this->getComponentSrcDistPath($target), $this->getComponentPath());
164
            }
165
        }
166
    }
167
168
    /**