-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Remove unnecessary condition #16412
Remove unnecessary condition #16412
Conversation
The check ```!empty($this->item)``` is unneeded at this point. It is possible to join the statements of if conditions at the lines 72 and 77.
Not sure if that is accurate. |
Well, but check |
Imho, the isset should indeed be sufficient, because it will also return false if the item doesn't exist. So we gain nothing by explictiely checking the existence of the item prior to it. I tried to restart the drone test. looks like an unrelated error to me. |
@Bakual, why |
@nvyush you can ignore the jenkins failure for now, we are testing a new setup. It is important that the Required checks pass and the drone test (code styles) should also pass. |
@rdeutz, thanks |
I have tested this item ✅ successfully on 60788fd This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16412. |
For new items the ID is always NULL. Even by saying a_id=0 in the url. So why not joining the two if-conditions? This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16412. |
@FPerisa You're right. They can be combined and remove the second if statement. |
Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/16412 |
See PR #20254 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16412. |
The check
!empty($this->item)
is unneeded at this point.It is possible to join the statements of if conditions at the lines 72 and 77.
Pull Request for Issue #16409.
Summary of Changes
Unnecessary condition is removed.
The statements of equivalent conditions is joined.
Testing Instructions
Code review.
Expected result
Actual result
Documentation Changes Required
Not needed.