11<?php
2+
23/**
34 * Bluz composer plugin
45 *
@@ -155,7 +156,7 @@ public function copyProjectExtraFiles(Event $event): void
155156 public function copyModuleFiles (PackageEvent $ event ): void
156157 {
157158 $ package = $ this ->extractPackage ($ event );
158- $ this ->packagePath = $ this ->vendorPath .DS . $ package ->getName ();
159+ $ this ->packagePath = $ this ->vendorPath . DS . $ package ->getName ();
159160 if ($ package ->getType () === 'bluz-module ' && file_exists ($ this ->packagePath )) {
160161 if ($ package ->getExtra () && isset ($ package ->getExtra ()['copy-files ' ])) {
161162 $ this ->copyExtras ($ package ->getExtra ()['copy-files ' ]);
@@ -173,7 +174,7 @@ public function copyModuleFiles(PackageEvent $event): void
173174 public function removeModuleFiles (PackageEvent $ event ): void
174175 {
175176 $ package = $ this ->extractPackage ($ event );
176- $ this ->packagePath = $ this ->vendorPath .DS . $ package ->getName ();
177+ $ this ->packagePath = $ this ->vendorPath . DS . $ package ->getName ();
177178 if ($ package ->getType () === 'bluz-module ' && file_exists ($ this ->packagePath )) {
178179 if ($ package ->getExtra () && isset ($ package ->getExtra ()['copy-files ' ])) {
179180 $ this ->removeExtras ($ package ->getExtra ()['copy-files ' ]);
@@ -222,12 +223,12 @@ protected function copyModule(): void
222223 /**
223224 * copyExtras
224225 *
225- * @param array $files
226+ * @param array $files
226227 *
227228 * @return void
228229 * @throws \InvalidArgumentException
229230 */
230- protected function copyExtras ($ files ): void
231+ protected function copyExtras (array $ files ): void
231232 {
232233 foreach ($ files as $ source => $ target ) {
233234 $ this ->copy (
@@ -246,7 +247,7 @@ protected function copyExtras($files): void
246247 * @return void
247248 * @throws \InvalidArgumentException
248249 */
249- protected function copy ($ source , $ target ): void
250+ protected function copy (string $ source , string $ target ): void
250251 {
251252 // skip, if not exists
252253 if (!file_exists ($ source )) {
@@ -288,7 +289,7 @@ protected function copy($source, $target): void
288289 }
289290
290291 if (is_dir ($ source )) {
291- $ finder = new Finder ;
292+ $ finder = new Finder () ;
292293 $ finder ->files ()->in ($ source );
293294
294295 foreach ($ finder as $ file ) {
@@ -341,11 +342,11 @@ protected function removeModule(): void
341342 /**
342343 * removeExtras
343344 *
344- * @param array $files
345+ * @param array $files
345346 *
346347 * @return void
347348 */
348- protected function removeExtras ($ files ): void
349+ protected function removeExtras (array $ files ): void
349350 {
350351 foreach ($ files as $ source => $ target ) {
351352 $ this ->installer ->getIo ()->write (
@@ -367,13 +368,15 @@ protected function remove($directory): void
367368 if (!is_dir ($ sourcePath )) {
368369 return ;
369370 }
370- foreach ($ iterator = new \RecursiveIteratorIterator (
371- new \RecursiveDirectoryIterator (
372- $ sourcePath ,
373- \RecursiveDirectoryIterator::SKIP_DOTS
374- ),
375- \RecursiveIteratorIterator::CHILD_FIRST
376- ) as $ item ) {
371+ foreach (
372+ $ iterator = new \RecursiveIteratorIterator (
373+ new \RecursiveDirectoryIterator (
374+ $ sourcePath ,
375+ \RecursiveDirectoryIterator::SKIP_DOTS
376+ ),
377+ \RecursiveIteratorIterator::CHILD_FIRST
378+ ) as $ item
379+ ) {
377380 // path to copied file
378381 $ current = PATH_ROOT . DS . $ directory . DS . $ iterator ->getSubPathName ();
379382
@@ -422,4 +425,14 @@ protected function remove($directory): void
422425 }
423426 }
424427 }
428+
429+ public function deactivate (Composer $ composer , IOInterface $ io )
430+ {
431+ // TODO: Implement deactivate() method.
432+ }
433+
434+ public function uninstall (Composer $ composer , IOInterface $ io )
435+ {
436+ // TODO: Implement uninstall() method.
437+ }
425438}
0 commit comments