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 = []; 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,