Fix phpstan issues.

This commit is contained in:
James Cole
2026-03-04 06:34:04 +01:00
parent 48f039a275
commit 7d67fe52f9
19 changed files with 42 additions and 107 deletions

View File

@@ -114,11 +114,11 @@ class RepairsPostgresSequences extends Command
continue;
}
if ($nextId->nextval < $highestId->max) { // @phpstan-ignore-line
if ($nextId->nextval < $highestId->max) {
DB::select(sprintf('SELECT setval(\'%s_id_seq\', %d)', $tableToCheck, $highestId->max));
$highestId = DB::table($tableToCheck)->select(DB::raw('MAX(id)'))->first();
$nextId = DB::table($tableToCheck)->select(DB::raw(sprintf('nextval(\'%s_id_seq\')', $tableToCheck)))->first();
if ($nextId->nextval > $highestId->max) { // @phpstan-ignore-line
if ($nextId->nextval > $highestId->max) {
$this->friendlyInfo(sprintf('Table "%s" autoincrement corrected.', $tableToCheck));
}
if ($nextId->nextval <= $highestId->max) {