From 6fdc3eb46b637409ba82ca578760caedb3d0ba38 Mon Sep 17 00:00:00 2001 From: "origami11@yandex.ru" Date: Fri, 28 Nov 2025 17:44:08 +0300 Subject: [PATCH] =?UTF-8?q?chore:=20=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Controller/Component.php | 6 ++++-- src/Database/IdGenerator.php | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Controller/Component.php b/src/Controller/Component.php index 77a742a..85f54f2 100644 --- a/src/Controller/Component.php +++ b/src/Controller/Component.php @@ -206,8 +206,10 @@ class Component /** * Создает модель - * @param class-string $modelName - * @return mixed + * + * @template T + * @param class-string $modelName + * @return T */ public function getModel($modelName) { diff --git a/src/Database/IdGenerator.php b/src/Database/IdGenerator.php index 4cd3d3d..6cad31a 100644 --- a/src/Database/IdGenerator.php +++ b/src/Database/IdGenerator.php @@ -35,6 +35,9 @@ class IdGenerator { } else { $result = $this->db->fetchOneArray("SELECT last_insert_rowid() AS nextval"); } + if (!$result) { + throw new \Exception("nextval failed"); + } return (int)$result['nextval']; } }