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

Remove unneeded Return type in Docblock of Illuminate\Database\Eloquent\Builder.php->get() #48228

Conversation

FrazerFlanagan
Copy link

Remove unneeded static[] from ret type in docblock of Illuminate\Database\Eloquent\Builder->get()

This function only returns a collection from L:725

        return $builder->getModel()->newCollection($models);

@nunomaduro nunomaduro merged commit 86b76dc into laravel:10.x Aug 29, 2023
19 checks passed
Copy link
Member

@GrahamCampbell GrahamCampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is incomplete. There are other methods with the same bug, too.

nunomaduro added a commit that referenced this pull request Aug 29, 2023
…-static-array-ret-type-from-db-eloquent-builder-get"

This reverts commit 86b76dc, reversing
changes made to c779c11.
@FrazerFlanagan FrazerFlanagan changed the title Remove unneeded Return type in Docblock of Illuminate\Database\Eloquent\Builder.php Remove unneeded Return type in Docblock of Illuminate\Database\Eloquent\Builder.php->get() Aug 29, 2023
@localusercamp
Copy link
Contributor

This PR is incomplete. There are other methods with the same bug, too.

I created a discussion and issue a long time ago about this weird stuff, but nobody paid attention to them.
This must be fixed.

@GrahamCampbell
Copy link
Member

This PR has been reverted again.

@darkspock
Copy link

Hi, leaving the static[] causes phpstan/larastan to fail, and actually is a problem. If you use get()->all(), you can not get sure get() returns a Collection...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants