Skip to content

[Contributing] Fix Coding Standards example (esp. null return vs. void) #12974

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
Mar 6, 2020
Merged

[Contributing] Fix Coding Standards example (esp. null return vs. void) #12974

merged 1 commit into from
Mar 6, 2020

Conversation

guilliamxavier
Copy link
Contributor

Fix inconsistent return points and make the logic a bit more realistic (even if still dummy code)

@guilliamxavier
Copy link
Contributor Author

What's the matter with the "DOCtor-RST" lint failing?

@javiereguiluz
Copy link
Member

@guilliamxavier you can ignore the DOCtor-RST linter errors for this pull request.

About the proposed changes, let's ask @nicolas-grekas and @stof for a review. Thanks!

* @param bool $theSwitch Some switch to control the method's flow
*
* @return bool|void The resultant check if $theSwitch isn't false, void otherwise
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I have seen some @return void in the code, but below is explicitly stated

Omit the @return tag if the method does not return anything

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Just one minor note and GTM

@guilliamxavier
Copy link
Contributor Author

@nicolas-grekas: Thank you for reviewing, I have applied your suggested changes

@xabbuh xabbuh added this to the 3.4 milestone Feb 27, 2020
@javiereguiluz
Copy link
Member

Thank you @guilliamxavier.

@javiereguiluz javiereguiluz merged commit c8df8e4 into symfony:3.4 Mar 6, 2020
@guilliamxavier guilliamxavier deleted the patch-1 branch March 6, 2020 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants