Code Duplication    Length = 17-18 lines in 2 locations

src/Data/FileMigrationRunner.php 1 location

@@ 55-72 (lines=18) @@
52
    /**
53
     * @inheritdoc
54
     */
55
    public function migrate(ContainerInterface $container): void
56
    {
57
        // read & remember classes to migrate...
58
        assert($container->has(FileSystemInterface::class) === true);
59
        /** @var FileSystemInterface $fileSystem */
60
        $fileSystem = $container->get(FileSystemInterface::class);
61
62
        $path = $this->getMigrationsPath();
63
        assert($fileSystem->exists($path) === true);
64
65
        $this->getIO()->writeInfo("Migrations `$path` started." . PHP_EOL, IoInterface::VERBOSITY_VERBOSE);
66
67
        $migrationClasses = $fileSystem->requireFile($path);
68
        $this->setMigrationClasses($migrationClasses);
69
70
        // ... and run actual migration
71
        parent::migrate($container);
72
    }
73
74
    /**
75
     * @inheritdoc

src/Data/FileSeedRunner.php 1 location

@@ 61-77 (lines=17) @@
58
    /**
59
     * @inheritdoc
60
     */
61
    public function run(ContainerInterface $container): void
62
    {
63
        // read & remember seed classes...
64
        assert($container->has(FileSystemInterface::class) === true);
65
        /** @var FileSystemInterface $fileSystem */
66
        $fileSystem = $container->get(FileSystemInterface::class);
67
68
        $path = $this->getSeedsPath();
69
        assert($fileSystem->exists($path) === true);
70
        $this->getIO()->writeInfo("Seeds `$path` started." . PHP_EOL, IoInterface::VERBOSITY_VERBOSE);
71
72
        $seedClasses = $fileSystem->requireFile($path);
73
        $this->setSeedClasses($seedClasses);
74
75
        // ... and run actual seeding
76
        parent::run($container);
77
    }
78
79
    /**
80
     * @param string[] $seedClasses