getMigrationHistory() protected method

protected getMigrationHistory ( $limit )
 /**
  * @inheritdoc
  */
 protected function getMigrationHistory($limit)
 {
     $history = parent::getMigrationHistory($limit);
     foreach ($history as $name => $time) {
         if (!$this->migrationExists($name)) {
             unset($history[$name]);
         }
     }
     return $history;
 }
 protected function getMigrationHistory($limit)
 {
     if ($this->moduleId) {
         $module = Yii::$app->getModule($this->moduleId);
         if ($module === null) {
             throw new Exception('Module "' . $this->moduleId . '" not found');
         }
         $migrationHistory = parent::getMigrationHistory(false);
         $modulesMigration = $this->getModuleMigrations($this->moduleId);
         $filteredMigration = [];
         foreach ($migrationHistory as $key => $migration) {
             if (isset($modulesMigration[$key])) {
                 $filteredMigration[$key] = $migration;
             }
         }
         $migrationHistory = $filteredMigration;
     } else {
         $migrationHistory = parent::getMigrationHistory($limit);
     }
     return $migrationHistory;
 }