From 30aca100e00f88e1b77201d0630a1e83b1b5180f Mon Sep 17 00:00:00 2001 From: Sergei Tigrov Date: Sun, 12 Jan 2025 20:14:55 +0700 Subject: [PATCH] Add PHPDoc about `boolean` values in `scalar()` and `queryScalar()` methods (#918) --- src/Command/CommandInterface.php | 2 +- src/Query/QueryInterface.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Command/CommandInterface.php b/src/Command/CommandInterface.php index 975cb9abf..6df6685f3 100644 --- a/src/Command/CommandInterface.php +++ b/src/Command/CommandInterface.php @@ -680,8 +680,8 @@ public function queryOne(): array|null; /** * Execute the SQL statement and returns the value of the first column in the first row of data. - * * This method is best used when you need only a single value. + * Do not use this method for `boolean` values as it returns `false` if there is no value. * * @throws Exception * @throws Throwable If execution failed. diff --git a/src/Query/QueryInterface.php b/src/Query/QueryInterface.php index 75ed79905..da42a8fcc 100644 --- a/src/Query/QueryInterface.php +++ b/src/Query/QueryInterface.php @@ -288,8 +288,8 @@ public function prepare(QueryBuilderInterface $builder): self; /** * Returns the query results as a scalar value. - * * The value returned will be the first column in the first row of the query results. + * Do not use this method for `boolean` values as it returns `false` if the query result is empty. * * @throws Exception * @throws InvalidConfigException