Skip to content

Commit

Permalink
Defend against (impossible) null error
Browse files Browse the repository at this point in the history
  • Loading branch information
bakert committed Oct 8, 2024
1 parent 6bf6710 commit 19b0419
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion gatherling/Models/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static function getConnection(): mysqli
$CONFIG['db_password']
);
if (mysqli_connect_errno()) {
throw new Exception(mysqli_connect_error());
throw new Exception((string) mysqli_connect_error());
}
$db_selected = $instance->select_db($CONFIG['db_database']);
if (!$db_selected) {
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,6 @@ parameters:
count: 1
path: gatherling/Models/Database.php

-
message: "#^Parameter \\#1 \\$message of class Exception constructor expects string, string\\|null given\\.$#"
count: 1
path: gatherling/Models/Database.php

-
message: "#^Parameter \\#1 \\$query of method mysqli\\:\\:prepare\\(\\) expects string, mixed given\\.$#"
count: 2
Expand Down

0 comments on commit 19b0419

Please sign in to comment.