8000 Updated the CS rule about return null; and return; by javiereguiluz · Pull Request #6614 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Updated the CS rule about return null; and return; #6614

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

Closed
wants to merge 3 commits into from
Closed
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
8 changes: 4 additions & 4 deletions contributing/code/standards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ example containing most features described below:
);

if (true === $dummy) {
return;
return null;
}

if ('string' === $dummy) {
Expand All @@ -109,7 +109,7 @@ example containing most features described below:
* @param mixed $value Some value to check against
* @param bool $theSwitch Some switch to control the method's flow
*
* @return bool|null The resultant check if $theSwitch isn't false, null otherwise
* @return bool|void The resultant check if $theSwitch isn't false, void otherwise
*/
private function reverseBoolean($value = null, $theSwitch = false)
{
Expand Down Expand Up @@ -143,8 +143,8 @@ Structure
* Add a blank line before ``return`` statements, unless the return is alone
inside a statement-group (like an ``if`` statement);

* Use just ``return;`` instead of ``return null;`` when a function must return
void early;
* Use ``return null;`` when a function explicitly returns ``null`` values and
use ``return;`` when the function returns ``void`` values;

* Use braces to indicate control structure body regardless of the number of
statements it contains;
Expand Down
0