Skip to content
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

[11.x] Add multiple method signatures for where in PHPDoc block #54304

Draft
wants to merge 3 commits into
base: 11.x
Choose a base branch
from
Draft
Changes from 1 commit
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
Next Next commit
Add multiple method signatures for where in PHPDoc block
shaedrich authored Jan 22, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 6ac28e92a468dedd057a9355092e029bc711e2b4
8 changes: 8 additions & 0 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
@@ -31,6 +31,14 @@

use function Illuminate\Support\enum_value;

/**
* @method self where(string $column, $value)
* @method self where(string $column, string $operator, $value)
* @method self where(string $column, string $operator, $value, 'and'|'or' $boolean)
* @method self where(\Closure(): mixed)
* @method self where(array<string, mixed> $column)
* @method self where((array{string, 'and'|'or', mixed}|array{string, mixed}|array{column: string, operator?: 'and'|'or', value: mixed})[] $column)
*/
class Builder implements BuilderContract
{
/** @use \Illuminate\Database\Concerns\BuildsQueries<object> */
@@ -1009,7 +1017,7 @@
$value, $operator, func_num_args() === 2
);

return $this->where($column, $operator, $value, 'or');

Check failure on line 1020 in src/Illuminate/Database/Query/Builder.php

GitHub Actions / Source Code

Method Illuminate\Database\Query\Builder::where() invoked with 4 parameters, 1 required.
}

/**
@@ -1029,7 +1037,7 @@
}, $boolean.' not');
}

return $this->where($column, $operator, $value, $boolean.' not');

Check failure on line 1040 in src/Illuminate/Database/Query/Builder.php

GitHub Actions / Source Code

Method Illuminate\Database\Query\Builder::where() invoked with 4 parameters, 1 required.
}

/**
@@ -2244,7 +2252,7 @@
// clause on the query. Then we'll increment the parameter index values.
$bool = strtolower($connector);

$this->where(Str::snake($segment), '=', $parameters[$index], $bool);

Check failure on line 2255 in src/Illuminate/Database/Query/Builder.php

GitHub Actions / Source Code

Method Illuminate\Database\Query\Builder::where() invoked with 4 parameters, 1 required.
}

/**
@@ -2816,7 +2824,7 @@
$this->orders = $this->removeExistingOrdersFor($column);

if (! is_null($lastId)) {
$this->where($column, '<', $lastId);

Check failure on line 2827 in src/Illuminate/Database/Query/Builder.php

GitHub Actions / Source Code

Method Illuminate\Database\Query\Builder::where() invoked with 3 parameters, 1 required.
}

return $this->orderBy($column, 'desc')
@@ -2836,7 +2844,7 @@
$this->orders = $this->removeExistingOrdersFor($column);

if (! is_null($lastId)) {
$this->where($column, '>', $lastId);

Check failure on line 2847 in src/Illuminate/Database/Query/Builder.php

GitHub Actions / Source Code

Method Illuminate\Database\Query\Builder::where() invoked with 3 parameters, 1 required.
}

return $this->orderBy($column, 'asc')
@@ -3035,7 +3043,7 @@
*/
public function find($id, $columns = ['*'])
{
return $this->where('id', '=', $id)->first($columns);

Check failure on line 3046 in src/Illuminate/Database/Query/Builder.php

GitHub Actions / Source Code

Method Illuminate\Database\Query\Builder::where() invoked with 3 parameters, 1 required.
}

/**
@@ -4058,7 +4066,7 @@
// ID to let developers to simply and quickly remove a single row from this
// database without manually specifying the "where" clauses on the query.
if (! is_null($id)) {
$this->where($this->from.'.id', '=', $id);

Check failure on line 4069 in src/Illuminate/Database/Query/Builder.php

GitHub Actions / Source Code

Method Illuminate\Database\Query\Builder::where() invoked with 3 parameters, 1 required.
}

$this->applyBeforeQueryCallbacks();