Code Duplication    Length = 17-18 lines in 2 locations

src/PuliPlugin.php 2 locations

@@ 399-416 (lines=18) @@
396
        }
397
    }
398
399
    private function checkForNotFoundErrors(array $puliPackages, IOInterface $io)
400
    {
401
        /** @var PuliPackage[] $notFoundPackages */
402
        $notFoundPackages = array_filter($puliPackages,
403
            function (PuliPackage $package) {
404
                return PuliPackage::STATE_NOT_FOUND === $package->getState()
405
                && PuliPlugin::INSTALLER_NAME === $package->getInstallerName();
406
            });
407
408
        foreach ($notFoundPackages as $package) {
409
            $this->printPackageWarning(
410
                $io,
411
                'The package "%s" (at ./%s) could not be found',
412
                $package->getName(),
413
                $package->getInstallPath()
414
            );
415
        }
416
    }
417
418
    private function checkForNotLoadableErrors(array $puliPackages, IOInterface $io)
419
    {
@@ 418-434 (lines=17) @@
415
        }
416
    }
417
418
    private function checkForNotLoadableErrors(array $puliPackages, IOInterface $io)
419
    {
420
        /** @var PuliPackage[] $notLoadablePackages */
421
        $notLoadablePackages = array_filter($puliPackages, function (PuliPackage $package) {
422
            return PuliPackage::STATE_NOT_LOADABLE === $package->getState()
423
                && PuliPlugin::INSTALLER_NAME === $package->getInstallerName();
424
        });
425
426
        foreach ($notLoadablePackages as $package) {
427
            $this->printPackageWarning(
428
                $io,
429
                'The package "%s" (at ./%s) could not be loaded',
430
                $package->getName(),
431
                $package->getInstallPath()
432
            );
433
        }
434
    }
435
436
    private function adoptComposerName(array $puliPackages, IOInterface $io, Composer $composer)
437
    {