Code Duplication    Length = 21-21 lines in 2 locations

src/Handler/MapCommandHandler.php 1 location

@@ 360-380 (lines=21) @@
357
     * @param IO  $io               The I/O.
358
     * @param int $pathMappingState The {@link PathMappingState} constant.
359
     */
360
    private function printPathMappingStateHeader(IO $io, $pathMappingState)
361
    {
362
        switch ($pathMappingState) {
363
            case PathMappingState::ENABLED:
364
                $io->writeLine('The following path mappings are currently enabled:');
365
                $io->writeLine('');
366
367
                return;
368
            case PathMappingState::NOT_FOUND:
369
                $io->writeLine('The target paths of the following path mappings were not found:');
370
                $io->writeLine('');
371
372
                return;
373
            case PathMappingState::CONFLICT:
374
                $io->writeLine('Some path mappings have conflicting paths:');
375
                $io->writeLine(' (add the package names to the "override-order" key in puli.json to resolve)');
376
                $io->writeLine('');
377
378
                return;
379
        }
380
    }
381
382
    private function mappingsEqual(PathMapping $mapping1, PathMapping $mapping2)
383
    {

src/Handler/PackageCommandHandler.php 1 location

@@ 290-310 (lines=21) @@
287
     * @param IO  $io           The I/O.
288
     * @param int $packageState The {@link PackageState} constant.
289
     */
290
    private function printPackageState(IO $io, $packageState)
291
    {
292
        switch ($packageState) {
293
            case PackageState::ENABLED:
294
                $io->writeLine('The following packages are currently enabled:');
295
                $io->writeLine('');
296
297
                return;
298
            case PackageState::NOT_FOUND:
299
                $io->writeLine('The following packages could not be found:');
300
                $io->writeLine(' (use "puli package --clean" to remove)');
301
                $io->writeLine('');
302
303
                return;
304
            case PackageState::NOT_LOADABLE:
305
                $io->writeLine('The following packages could not be loaded:');
306
                $io->writeLine('');
307
308
                return;
309
        }
310
    }
311
312
    /**
313
     * Prints a list of packages in a table.