Skip to content

Commit

Permalink
Fix phpstan errors and update baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 2, 2024
1 parent a75e138 commit 8ff419f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ parameters:
count: 1
path: src/Db/Adapter/PdoAdapter.php

-
message: "#^Offset 'id' on array\\<string, mixed\\> in isset\\(\\) always exists and is not nullable\\.$#"
count: 2
path: src/Db/Adapter/PostgresAdapter.php

-
message: "#^Offset 'id' on array\\<string, mixed\\> in isset\\(\\) always exists and is not nullable\\.$#"
count: 2
Expand Down
6 changes: 5 additions & 1 deletion src/Db/Adapter/PostgresAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ public function hasTable(string $tableName): bool
$this->getConnection()->quote($parts['table'])
)
);
if (!$result) {
return false;

Check warning on line 224 in src/Db/Adapter/PostgresAdapter.php

View check run for this annotation

Codecov / codecov/patch

src/Db/Adapter/PostgresAdapter.php#L218-L224

Added lines #L218 - L224 were not covered by tests
}

return $result->rowCount() === 1;

Check warning on line 227 in src/Db/Adapter/PostgresAdapter.php

View check run for this annotation

Codecov / codecov/patch

src/Db/Adapter/PostgresAdapter.php#L227

Added line #L227 was not covered by tests
}
Expand Down Expand Up @@ -1658,7 +1661,8 @@ public function bulkinsert(Table $table, array $rows): void
$override = self::OVERRIDE_SYSTEM_VALUE . ' ';

Check warning on line 1661 in src/Db/Adapter/PostgresAdapter.php

View check run for this annotation

Codecov / codecov/patch

src/Db/Adapter/PostgresAdapter.php#L1659-L1661

Added lines #L1659 - L1661 were not covered by tests
}

$sql .= '(' . implode(', ', array_map([$this, 'quoteColumnName'], $keys)) . ') ' . $override . 'VALUES ';
$callback = fn ($key) => $this->quoteColumnName($key);
$sql .= '(' . implode(', ', array_map($callback, $keys)) . ') ' . $override . 'VALUES ';

Check warning on line 1665 in src/Db/Adapter/PostgresAdapter.php

View check run for this annotation

Codecov / codecov/patch

src/Db/Adapter/PostgresAdapter.php#L1664-L1665

Added lines #L1664 - L1665 were not covered by tests

if ($this->isDryRunEnabled()) {
$values = array_map(function ($row) {
Expand Down

0 comments on commit 8ff419f

Please sign in to comment.