Skip to content

Commit ca80673

Browse files
committed
Phpstan fixes
1 parent bf4773a commit ca80673

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Exercise/DatabaseRead.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public function seed(PDO $db): void
5858
->exec('CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT, age INTEGER, gender TEXT)');
5959
$stmt = $db->prepare('INSERT INTO users (name, age, gender) VALUES (:name, :age, :gender)');
6060

61+
if ($stmt == false) {
62+
return;
63+
}
64+
6165
$names = [];
6266
for ($i = 0; $i < $this->faker->numberBetween(5, 15); $i++) {
6367
$name = $this->faker->name;
@@ -77,6 +81,10 @@ public function verify(PDO $db): bool
7781
$sql = 'SELECT name FROM users WHERE id = :id';
7882
$stmt = $db->prepare($sql);
7983

84+
if ($stmt == false) {
85+
return false;
86+
}
87+
8088
$stmt->execute([':id' => $this->randomRecord['id']]);
8189
$result = $stmt->fetchColumn();
8290

0 commit comments

Comments
 (0)