-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 parentheses in site components #13190
Remove unnecessary parentheses in site components #13190
Conversation
@@ -139,7 +139,7 @@ public function display($tpl = null) | |||
// Check the access to the newsfeed | |||
$levels = $user->getAuthorisedViewLevels(); | |||
|
|||
if (!in_array($item->access, $levels) or ((in_array($item->access, $levels) and (!in_array($item->category_access, $levels))))) | |||
if (!in_array($item->access, $levels) or in_array($item->access, $levels) and (!in_array($item->category_access, $levels))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO we should keep the paranthesis when a or
and a and
exists because of code redability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe keep only one pair instead of both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, just cond1 || (cond2 && cond3)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personal taste ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not doing changes besides the parentheses in this PR, to make reveiewer's lives easier ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and get it accepted faster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgt41 all or
and
/ ||
&&
should IMO be normalized, but that is another PR
…t to have it ungrouped for readability
I have tested this item ✅ successfully on 3b3a4b7 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13190. |
1 similar comment
I have tested this item ✅ successfully on 3b3a4b7 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13190. |
can't we also chnage the |
and remove spaces here: |
@infograf768 Let's do this in another PR. This also might need some discussion. I want to keep these PRs streamlined, so that they can be accepted faster. |
I have tested this item ✅ successfully on ae3d4e0 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13190. |
I have tested this item ✅ successfully on ae3d4e0 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13190. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13190. |
Summary of Changes
This PR is part of a set to try to separate some of the changes done in some of my previous batch PR's for site/components, which are still on hold (#12290, #12292, #12293, #12294).
Testing Instructions
None, should not change behavior
Documentation Changes Required
None.