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

[10.x] Fix return static in docblock of Eloquent and Query Builders #48285

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
30 changes: 15 additions & 15 deletions src/Illuminate/Database/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function __construct(QueryBuilder $query)
* Create and return an un-saved model instance.
*
* @param array $attributes
* @return \Illuminate\Database\Eloquent\Model|static
* @return \Illuminate\Database\Eloquent\Model
*/
public function make(array $attributes = [])
{
Expand Down Expand Up @@ -311,7 +311,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
* @param mixed $operator
* @param mixed $value
* @param string $boolean
* @return \Illuminate\Database\Eloquent\Model|static|null
* @return \Illuminate\Database\Eloquent\Model|null
*/
public function firstWhere($column, $operator = null, $value = null, $boolean = 'and')
{
Expand Down Expand Up @@ -436,7 +436,7 @@ public function fromQuery($query, $bindings = [])
*
* @param mixed $id
* @param array|string $columns
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static[]|static|null
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|null
*/
public function find($id, $columns = ['*'])
{
Expand Down Expand Up @@ -470,7 +470,7 @@ public function findMany($ids, $columns = ['*'])
*
* @param mixed $id
* @param array|string $columns
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static|static[]
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection
*
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model>
*/
Expand Down Expand Up @@ -504,7 +504,7 @@ public function findOrFail($id, $columns = ['*'])
*
* @param mixed $id
* @param array|string $columns
* @return \Illuminate\Database\Eloquent\Model|static
* @return \Illuminate\Database\Eloquent\Model
*/
public function findOrNew($id, $columns = ['*'])
{
Expand All @@ -521,7 +521,7 @@ public function findOrNew($id, $columns = ['*'])
* @param mixed $id
* @param \Closure|array|string $columns
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static[]|static|mixed
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|mixed
*/
public function findOr($id, $columns = ['*'], Closure $callback = null)
{
Expand All @@ -543,7 +543,7 @@ public function findOr($id, $columns = ['*'], Closure $callback = null)
*
* @param array $attributes
* @param array $values
* @return \Illuminate\Database\Eloquent\Model|static
* @return \Illuminate\Database\Eloquent\Model
*/
public function firstOrNew(array $attributes = [], array $values = [])
{
Expand All @@ -559,7 +559,7 @@ public function firstOrNew(array $attributes = [], array $values = [])
*
* @param array $attributes
* @param array $values
* @return \Illuminate\Database\Eloquent\Model|static
* @return \Illuminate\Database\Eloquent\Model
*/
public function firstOrCreate(array $attributes = [], array $values = [])
{
Expand Down Expand Up @@ -591,7 +591,7 @@ public function createOrFirst(array $attributes = [], array $values = [])
*
* @param array $attributes
* @param array $values
* @return \Illuminate\Database\Eloquent\Model|static
* @return \Illuminate\Database\Eloquent\Model
*/
public function updateOrCreate(array $attributes, array $values = [])
{
Expand All @@ -606,7 +606,7 @@ public function updateOrCreate(array $attributes, array $values = [])
* Execute the query and get the first result or throw an exception.
*
* @param array|string $columns
* @return \Illuminate\Database\Eloquent\Model|static
* @return \Illuminate\Database\Eloquent\Model
*
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model>
*/
Expand All @@ -624,7 +624,7 @@ public function firstOrFail($columns = ['*'])
*
* @param \Closure|array|string $columns
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Model|static|mixed
* @return \Illuminate\Database\Eloquent\Model|mixed
*/
public function firstOr($columns = ['*'], Closure $callback = null)
{
Expand Down Expand Up @@ -709,7 +709,7 @@ public function valueOrFail($column)
* Execute the query as a "select" statement.
*
* @param array|string $columns
* @return \Illuminate\Database\Eloquent\Collection|static[]
* @return \Illuminate\Database\Eloquent\Collection
*/
public function get($columns = ['*'])
{
Expand All @@ -729,7 +729,7 @@ public function get($columns = ['*'])
* Get the hydrated models without eager loading.
*
* @param array|string $columns
* @return \Illuminate\Database\Eloquent\Model[]|static[]
* @return \Illuminate\Database\Eloquent\Model[]
*/
public function getModels($columns = ['*'])
{
Expand Down Expand Up @@ -1530,7 +1530,7 @@ public function withOnly($relations)
* Create a new instance of the model being queried.
*
* @param array $attributes
* @return \Illuminate\Database\Eloquent\Model|static
* @return \Illuminate\Database\Eloquent\Model
*/
public function newModelInstance($attributes = [])
{
Expand Down Expand Up @@ -1818,7 +1818,7 @@ protected function defaultKeyName()
/**
* Get the model instance being queried.
*
* @return \Illuminate\Database\Eloquent\Model|static
* @return \Illuminate\Database\Eloquent\Model
*/
public function getModel()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2655,7 +2655,7 @@ public function toRawSql()
*
* @param int|string $id
* @param array|string $columns
* @return mixed|static
* @return mixed
*/
public function find($id, $columns = ['*'])
{
Expand All @@ -2668,7 +2668,7 @@ public function find($id, $columns = ['*'])
* @param mixed $id
* @param \Closure|array|string $columns
* @param \Closure|null $callback
* @return mixed|static
* @return mixed
*/
public function findOr($id, $columns = ['*'], Closure $callback = null)
{
Expand Down