8000 [12.x] remove `@return` docblocks on constructors by browner12 · Pull Request #55076 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[12.x] remove @return docblocks on constructors #55076

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 3 commits into from
Mar 19, 2025

Conversation

browner12
Copy link
Contributor

PHP constructors don't really return anything, so the docblock is kind of unnecessary. this also brings consistency since we have some that use the tag and some that do not.

we have a total of 557 constructors in the framework, so we definitely used it more than we didn't, but my personal opinion is this direction makes more sense.

https://docs.phpdoc.org/guide/references/phpdoc/tags/return.html#return #702
https://www.php.net/manual/en/language.oop5.decon.php

PHP constructors don't really return anything, so the docblock is kind of unnecessary. this also brings consistency since we have some that use the tag and some that do not.

we have a total of 557 constructors in the framework, so we definitely used it more than we didn't, but my personal opinion is this direction makes more sense.

https://docs.phpdoc.org/guide/references/phpdoc/tags/return.html#return
laravel#702
https://www.php.net/manual/en/language.oop5.decon.php
@taylorotwell taylorotwell merged commit 8f0e00b into laravel:12.x Mar 19, 2025
39 checks passed
@browner12 browner12 deleted the AB-constructor-return branch March 19, 2025 20:17
mohammadrasoulasghari added a commit to mohammadrasoulasghari/laravel-framework that referenced this pull request Mar 22, 2025
- Remove unnecessary @return tags from class constructors
- Improve docblock consistency across the framework
- Follow PHP documentation standards as constructors don't return values

Refs: laravel#55076
taylorotwell pushed a commit that referenced this pull request Mar 22, 2025
< 8000 /batch-deferred-content>
- Remove unnecessary @return tags from class constructors
- Improve docblock consistency across the framework
- Follow PHP documentation standards as constructors don't return values

Refs: #55076
@AJenbo
Copy link
Contributor
AJenbo commented Apr 5, 2025

Nice work

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.

3 participants
0