/**
  * Get a list of all migrations, sorted alphabetically.
  *
  * @return Migration[]
  */
 public function getAllMigrations()
 {
     $iterator = new \DirectoryIterator($this->configuration->getMigrationsDirectory());
     $migrations = [];
     foreach ($iterator as $file) {
         $fileName = (string) $file;
         if ($fileName === '.' || $fileName === '..') {
             continue;
         } else {
             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;
 }