From 145df6b7b9fdfeaef88afeb685109567dea6c8c5 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Fri, 24 Oct 2025 16:28:54 +0300 Subject: [PATCH 1/2] Remove `false` from result of "returning" methods in `CommandInterface` --- src/Command.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Command.php b/src/Command.php index 9652c4b..a1921cc 100644 --- a/src/Command.php +++ b/src/Command.php @@ -33,16 +33,13 @@ final class Command extends AbstractPdoCommand ColumnType::BIGINT, ]; - public function insertReturningPks(string $table, array|QueryInterface $columns): array|false + public function insertReturningPks(string $table, array|QueryInterface $columns): array { $tableSchema = $this->db->getSchema()->getTableSchema($table); $returnColumns = $tableSchema?->getPrimaryKey() ?? []; if ($returnColumns === []) { - if ($this->insert($table, $columns)->execute() === 0) { - return false; - } - + $this->insert($table, $columns)->execute(); return []; } /** @var TableSchema $tableSchema */ @@ -97,9 +94,7 @@ public function insertReturningPks(string $table, array|QueryInterface $columns) unset($value); - if ($this->execute() === 0) { - return false; - } + $this->execute(); $result = []; From e86d74e9bb280c5c1e60c581c81e4040de8092ef Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Fri, 24 Oct 2025 16:33:14 +0300 Subject: [PATCH 2/2] fix psalm --- src/Schema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Schema.php b/src/Schema.php index c85bba8..c18a2ad 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -266,7 +266,7 @@ protected function loadTableIndexes(string $tableName): array $columnNames = []; } - /** @var string[] $columnNames */ + /** @var list $columnNames */ $result[$name] = new Index( $name, $columnNames,