Skip to content

[12.x] Use int<0, max> as docblock return type for database operations that return a count #56117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3262,7 +3262,7 @@ protected function ensureOrderForCursorPagination($shouldReverse = false)
* Get the count of the total records for the paginator.
*
* @param array<string|\Illuminate\Contracts\Database\Query\Expression> $columns
* @return int
* @return int<0, max>
*/
public function getCountForPagination($columns = ['*'])
{
Expand Down Expand Up @@ -3551,7 +3551,7 @@ public function doesntExistOr(Closure $callback)
* Retrieve the "count" result of the query.
*
* @param \Illuminate\Contracts\Database\Query\Expression|string $columns
* @return int
* @return int<0, max>
*/
public function count($columns = '*')
{
Expand Down Expand Up @@ -3753,7 +3753,7 @@ public function insert(array $values)
/**
* Insert new records into the database while ignoring errors.
*
* @return int
* @return int<0, max>
*/
public function insertOrIgnore(array $values)
{
Expand Down Expand Up @@ -3835,7 +3835,7 @@ public function insertOrIgnoreUsing(array $columns, $query)
/**
* Update records in the database.
*
* @return int
* @return int<0, max>
*/
public function update(array $values)
{
Expand Down Expand Up @@ -3953,7 +3953,7 @@ public function upsert(array $values, array|string $uniqueBy, ?array $update = n
*
* @param string $column
* @param float|int $amount
* @return int
* @return int<0, max>
*
* @throws \InvalidArgumentException
*/
Expand All @@ -3971,7 +3971,7 @@ public function increment($column, $amount = 1, array $extra = [])
*
* @param array<string, float|int|numeric-string> $columns
* @param array<string, mixed> $extra
* @return int
* @return int<0, max>
*
* @throws \InvalidArgumentException
*/
Expand All @@ -3995,7 +3995,7 @@ public function incrementEach(array $columns, array $extra = [])
*
* @param string $column
* @param float|int $amount
* @return int
* @return int<0, max>
*
* @throws \InvalidArgumentException
*/
Expand All @@ -4013,7 +4013,7 @@ public function decrement($column, $amount = 1, array $extra = [])
*
* @param array<string, float|int|numeric-string> $columns
* @param array<string, mixed> $extra
* @return int
* @return int<0, max>
*
* @throws \InvalidArgumentException
*/
Expand Down