From f29f52eb28bb084c3cbe6b23348810664dd765ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20H=C5=AFla?= Date: Thu, 7 Sep 2017 10:42:46 +0200 Subject: [PATCH] Fluent: fixed TypeError, query() may return Result|int --- src/Dibi/Fluent.php | 5 ++++- tests/dibi/Fluent.fetch.phpt | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Dibi/Fluent.php b/src/Dibi/Fluent.php index f05db1be..21007604 100644 --- a/src/Dibi/Fluent.php +++ b/src/Dibi/Fluent.php @@ -384,7 +384,10 @@ class Fluent implements IDataSource } - private function query($args): Result + /** + * @return Result|int + */ + private function query($args) { $res = $this->connection->query($args); foreach ($this->setups as $setup) { diff --git a/tests/dibi/Fluent.fetch.phpt b/tests/dibi/Fluent.fetch.phpt index 5b928b7c..a5537ca5 100644 --- a/tests/dibi/Fluent.fetch.phpt +++ b/tests/dibi/Fluent.fetch.phpt @@ -50,3 +50,8 @@ if (!in_array($config['system'], ['odbc', 'sqlsrv'], true)) { ], ], $res->fetchAssoc('name,title')); } + + +// affected rows +$res = $conn->update('products', ['title' => 'new'])->execute(); +Assert::same(3, $res);