Code Duplication    Length = 20-21 lines in 2 locations

src/Phinx/Migration/Manager.php 2 locations

@@ 843-862 (lines=20) @@
840
     *
841
     * @return string[]
842
     */
843
    protected function getMigrationFiles()
844
    {
845
        $config = $this->getConfig();
846
        $paths = $config->getMigrationPaths($this->getEnvironmentName(), $this->getDbRef());
847
        $files = [];
848
849
        foreach ($paths as $path) {
850
            $files = array_merge(
851
                $files,
852
                Util::glob($path . DIRECTORY_SEPARATOR . '*.php')
853
            );
854
        }
855
        // glob() can return the same file multiple times
856
        // This will cause the migration to fail with a
857
        // false assumption of duplicate migrations
858
        // http://php.net/manual/en/function.glob.php#110340
859
        $files = array_unique($files);
860
861
        return $files;
862
    }
863
864
    /**
865
     * Sets the database seeders.
@@ 989-1009 (lines=21) @@
986
     *
987
     * @return string[]
988
     */
989
    protected function getSeedFiles()
990
    {
991
        $config = $this->getConfig();
992
        $paths = $config->getSeedPaths($this->getEnvironmentName(), $this->getDbRef());
993
994
        $files = [];
995
996
        foreach ($paths as $path) {
997
            $files = array_merge(
998
                $files,
999
                Util::glob($path . DIRECTORY_SEPARATOR . '*.php')
1000
            );
1001
        }
1002
        // glob() can return the same file multiple times
1003
        // This will cause the migration to fail with a
1004
        // false assumption of duplicate migrations
1005
        // http://php.net/manual/en/function.glob.php#110340
1006
        $files = array_unique($files);
1007
1008
        return $files;
1009
    }
1010
1011
    /**
1012
     * Sets the config.