? Failure

User tests: Successful: Unsuccessful:

avatar nonumber
nonumber
3 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 - 3 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - change - 3 Mar 2015
Labels Added: ?
avatar wilsonge
wilsonge - comment - 3 Mar 2015

At a quick overview only a couple of places I feel what you're changing is not for the better. You obviously need to fix the two errors in travis for code style. But overall :+1: (obviously this is going to need 2 thorough in practice tests)

avatar zero-24 zero-24 - change - 7 Mar 2015
Category Code style
avatar nonumber nonumber - change - 8 Mar 2015
Title
[CODE SYNTAX] Reducing use of else statements, adding early returns [com_admin]
[CODE STYLE] Reducing use of else statements, adding early returns [com_admin]
avatar yvesh yvesh - test_item - 14 Mar 2015 - Tested successfully
avatar yvesh
yvesh - comment - 14 Mar 2015

Tested and works fine :+1:


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6286.
avatar nonumber
nonumber - comment - 10 Apr 2015

All synced up.
One more test...

avatar Klipper
Klipper - comment - 10 Apr 2015

@test no problems found in 3 views: help, profile and sysinfo

avatar zero-24 zero-24 - change - 10 Apr 2015
Status Pending Ready to Commit
avatar zero-24 zero-24 - alter_testresult - 10 Apr 2015 - Klipper: Tested successfully
avatar zero-24
zero-24 - comment - 10 Apr 2015

RTC Thanks :smile:


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6286.

avatar zero-24 zero-24 - change - 10 Apr 2015
Labels Added: ?
avatar roland-d roland-d - change - 28 Apr 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-04-28 20:08:23
Closed_By roland-d
Labels Removed: ? ?
avatar roland-d roland-d - close - 28 Apr 2015
avatar zero-24 zero-24 - close - 28 Apr 2015
avatar roland-d roland-d - close - 28 Apr 2015
avatar zero-24 zero-24 - change - 14 Oct 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment