? Failure

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
11 Oct 2020

Summary of Changes

Return is unnecessary as the last statement in a void method

Testing Instructions

Code review

avatar PhilETaylor PhilETaylor - open - 11 Oct 2020
avatar PhilETaylor PhilETaylor - change - 11 Oct 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Oct 2020
Category Front End Plugins
avatar PhilETaylor PhilETaylor - change - 11 Oct 2020
Title
Return is unnecessary as the last statement in a void method
[4] Return is unnecessary as the last statement in a void method
avatar PhilETaylor PhilETaylor - edited - 11 Oct 2020
avatar HLeithner
HLeithner - comment - 11 Oct 2020

In the catch blocks in plugins/system/redirect/redirect.php are 2 returns missing. Don't know if they are mean as "early return" at least they are unneeded.

avatar PhilETaylor
PhilETaylor - comment - 11 Oct 2020

You don't need to return early within a if/elseif/elseif/else block if no code follow the block, as PHP will simply be returning without further processing in that method anyway.

These are all "Code Smell" as reported by phpStorm.

avatar ceford ceford - test_item - 14 Oct 2020 - Tested successfully
avatar ceford
ceford - comment - 14 Oct 2020

I have tested this item successfully on 75a386c

Saw the code changes - seem OK. But in plugins/system/redirect/redirect.php the removed return is not the last statement in the method. It is the last statement in an if/elseif block.


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

avatar wilsonge wilsonge - change - 15 Oct 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-10-15 21:55:15
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 15 Oct 2020
avatar wilsonge wilsonge - merge - 15 Oct 2020
avatar wilsonge
wilsonge - comment - 15 Oct 2020

LGTM. Thanks!

Add a Comment

Login with GitHub to post a comment