Code Duplication    Length = 17-18 lines in 2 locations

src/PuliPlugin.php 2 locations

@@ 364-381 (lines=18) @@
361
        }
362
    }
363
364
    private function checkForNotFoundErrors(array $puliPackages, IOInterface $io)
365
    {
366
        /** @var PuliPackage[] $notFoundPackages */
367
        $notFoundPackages = array_filter($puliPackages,
368
            function (PuliPackage $package) {
369
                return PuliPackage::STATE_NOT_FOUND === $package->getState()
370
                && PuliPlugin::INSTALLER_NAME === $package->getInstallerName();
371
            });
372
373
        foreach ($notFoundPackages as $package) {
374
            $this->printPackageWarning(
375
                $io,
376
                'The package "%s" (at ./%s) could not be found',
377
                $package->getName(),
378
                $package->getInstallPath()
379
            );
380
        }
381
    }
382
383
    private function checkForNotLoadableErrors(array $puliPackages, IOInterface $io)
384
    {
@@ 383-399 (lines=17) @@
380
        }
381
    }
382
383
    private function checkForNotLoadableErrors(array $puliPackages, IOInterface $io)
384
    {
385
        /** @var PuliPackage[] $notLoadablePackages */
386
        $notLoadablePackages = array_filter($puliPackages, function (PuliPackage $package) {
387
            return PuliPackage::STATE_NOT_LOADABLE === $package->getState()
388
                && PuliPlugin::INSTALLER_NAME === $package->getInstallerName();
389
        });
390
391
        foreach ($notLoadablePackages as $package) {
392
            $this->printPackageWarning(
393
                $io,
394
                'The package "%s" (at ./%s) could not be loaded',
395
                $package->getName(),
396
                $package->getInstallPath()
397
            );
398
        }
399
    }
400
401
    private function adoptComposerName(array $puliPackages, IOInterface $io, Composer $composer)
402
    {