dbh = $dbh; } /** * Find vote row by bug id and IP. */ public function findOneByIdAndIp(int $id, string $ip): array { $sql = 'SELECT bug, ip FROM bugdb_votes WHERE bug = ? AND ip = ? LIMIT 1'; $statement = $this->dbh->prepare($sql); $statement->execute([$id, $ip]); $result = $statement->fetch(); return $result === false ? [] : $result; } }