src/Mongrate/Service/MigrationService.php
public function getAllMigrations()
    {
        $iterator = new \DirectoryIterator($this->configuration->getMigrationsDirectory());
        $migrations = [];

        foreach ($iterator as $file) {
            $fileName = (string) $file;

            if ($fileName === '.'|| $fileName === '..') {
                continue;
            }

            if (!is_dir($file->getPathname())) {
                // Ignore files that might be in the migrations directory, like documentation or
                // a .gitignore or .gitkeep file.
                continue;
            }

            $name = new Name($fileName);
            $isApplied = $this->isMigrationApplied($name);

            $migrations[] = new Migration($name, $isApplied);
        }

        usort($migrations, function (Migration $a, Migration $b) {
            return strcmp($a->getName(), $b->getName());
        });

        return $migrations;
    }
public function getAllMigrations()
    {
        $iterator = new \DirectoryIterator($this->configuration->getMigrationsDirectory());
        $migrations = [];

        foreach ($iterator as $file) {
            $fileName = (string) $file;

            if ($fileName === '.'|| $fileName === '..') {
                continue;
            }

            if (!is_dir($file->getPathname())) {
                // Ignore files that might be in the migrations directory, like documentation or
                // a .gitignore or .gitkeep file.
                continue;
            }

            $name = new Name($fileName);
            $isApplied = $this->isMigrationApplied($name);

            $migrations[] = new Migration($name, $isApplied);
        }

        usort($migrations, function (Migration $a, Migration $b) {
            return strcmp($a->getName(), $b->getName());
        });

        return $migrations;
    }
public function getAllMigrations ( ) { $ iterator = new \ DirectoryIterator ( $ this -> configuration -> getMigrationsDirectory ( ) ) ; $ migrations = [ ] ; foreach ( $ iterator as $ file ) { $ fileName = ( string ) $ file ; if ( $ fileName === '.' || $ fileName === '..' ) { continue ; } if ( ! is_dir ( $ file -> getPathname ( ) ) ) { // Ignore files that might be in the migrations directory, like documentation or // a .gitignore or .gitkeep file. continue ; } $ name = new Name ( $ fileName ) ; $ isApplied = $ this -> isMigrationApplied ( $ name ) ; $ migrations [ ] = new Migration ( $ name , $ isApplied ) ; } usort ( $ migrations , function ( Migration $ a , Migration $ b ) { return strcmp ( $ a -> getName ( ) , $ b -> getName ( ) ) ; } ) ; return $ migrations ; }
Get a list of all migrations, sorted alphabetically.

@return Migration[]
Get a list of all migrations sorted alphabetically .