? ? Success

User tests: Successful: Unsuccessful:

avatar nonumber
nonumber
4 Mar 2015

This series of Pull Requests improve some basic code styles.
Mostly if/else syntax improvements, focussing on removing else statements which follow returns (or continues in loops).
Also de-nesting of if structures by adding early returns/elses.

Example:

function foobar($foo, $bar)
{
   if($foo > $bar)
   {
      return $foo;
   } else {
      return $bar;
   }
}

Can be changed to:

function foobar($foo, $bar)
{
   if($foo > $bar)
   {
      return $foo;
   }

   return $bar;
}

PS: This only illustrates the 'issue' with the useless else statements.

Current PRs in this series:

avatar nonumber nonumber - open - 4 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - change - 4 Mar 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 4 Mar 2015
Title
 Edit Improved syntax: elses after returns/continues [com_banners]
Edit Improved syntax: elses after returns/continues [com_banners]
avatar zero-24 zero-24 - change - 6 Mar 2015
Category Code style
avatar nonumber nonumber - change - 7 Mar 2015
Title
 Edit Improved syntax: elses after returns/continues [com_banners]
 Edit Improved syntax: Reducing use of else statements, adding early returns [com_banners]
avatar nonumber nonumber - change - 8 Mar 2015
Title
 Edit Improved syntax: Reducing use of else statements, adding early returns [com_banners]
Edit Improved syntax: Reducing use of else statements, adding early returns [com_banners]
avatar nonumber nonumber - change - 8 Mar 2015
Title
 Edit Improved syntax: Reducing use of else statements, adding early returns [com_banners]
Improved syntax: Reducing use of else statements, adding early returns [com_banners]
avatar nonumber nonumber - change - 8 Mar 2015
Title
Improved syntax: Reducing use of else statements, adding early returns [com_banners]
[CODE SYNTAX] Reducing use of else statements, adding early returns [com_banners]
avatar nonumber nonumber - change - 8 Mar 2015
Title
[CODE SYNTAX] Reducing use of else statements, adding early returns [com_banners]
[CODE STYLE] Reducing use of else statements, adding early returns [com_banners]
avatar nonumber nonumber - change - 8 Mar 2015
Title
[CODE SYNTAX] Reducing use of else statements, adding early returns [com_banners]
[CODE STYLE] Reducing use of else statements, adding early returns [com_banners]
avatar Mathewlenning
Mathewlenning - comment - 9 Mar 2015

Very nice work! Thanks for taking the initiative =^D

avatar brianteeman brianteeman - change - 23 Jun 2015
Labels Added: ?
avatar nonumber
nonumber - comment - 21 Jul 2015

If this doesn't find any interest within a week or 2, I'll close this PR and create new PRs with smaller fixes (one fix per PR).

avatar nonumber
nonumber - comment - 21 Jul 2015

Out of sync. Because of lack of interest, not going to update it.
Closing.

avatar nonumber nonumber - close - 22 Jul 2015
avatar nonumber nonumber - change - 22 Jul 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-07-22 12:55:41
Closed_By nonumber
avatar nonumber nonumber - close - 22 Jul 2015
avatar nonumber nonumber - head_ref_deleted - 24 Jul 2015

Add a Comment

Login with GitHub to post a comment