I think that this ```count($result) == 1``` and ```count($row) == 2``` is a bit confusing. Would you like to do a small refactor like:

```
if ($result = $this->query($stmt)) {
  if (isset($result[0]) && $row = $result[0]) {
      if (isset($row['Create Table'])) {
          $final .= preg_replace("/AUTO_INCREMENT=([0-9]*)/", "AUTO_INCREMENT=1", $row['Create Table']) . ";\n\n";
      } elseif (isset($row['Create View'])) {
          $views .= $row['Create View'] . ";\n\n";
      }
  }
}
```