Various improvements
This commit is contained in:
@@ -35,12 +35,10 @@ class PostRepositoryMedoo
|
||||
{
|
||||
$row = $this->db->get('post', ['id', 'title', 'content'], ['id' => $id]);
|
||||
|
||||
// Medoo peut retourner false ou empty si rien trouvé — normaliser en null.
|
||||
if (empty($row) || $row === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Forcer types et clés attendues
|
||||
return [
|
||||
'id' => (int)($row['id'] ?? 0),
|
||||
'title' => (string)($row['title'] ?? ''),
|
||||
|
||||
Reference in New Issue
Block a user