code: public function getLastBatchNumber(): int
      {
          $stmt = $this->pdo->query("select max(batch) from {$this->table}");
          $stmt->execute();
  
          return (int) $stmt->fetch(PDO::FETCH_ASSOC)['max'];
      }
docs: Get the last migration batch number.
  
  @return int