Skip to content

Commit

Permalink
Add PHPDoc about boolean values in scalar() and queryScalar() m…
Browse files Browse the repository at this point in the history
…ethods (#918)
  • Loading branch information
Tigrov authored Jan 12, 2025
1 parent 828b5db commit 30aca10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Command/CommandInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/Query/QueryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 30aca10

Please sign in to comment.