-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
[REF] - Simplify redundant calls to empty()
function
#32043
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
The `empty()` function will automatically handle the case where the first part of the expression is not set, so there's no need to add an extra call to `empty()`.
@civicrm-builder retest this please |
@@ -112,7 +112,7 @@ public static function getTypeAttributes(SimpleXMLElement $fieldXML) { | |||
*/ | |||
public static function getSize(SimpleXMLElement $fieldXML): string { | |||
// Extract from <size> tag if supplied | |||
if (!empty($fieldXML->html) && !empty($fieldXML->html->size)) { | |||
if (!empty($fieldXML->html->size)) { |
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.
wouldn't this one still get upset?
@@ -39,7 +39,7 @@ public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $mod | |||
if ($mid && $continue) { | |||
//CRM-15979 - check if abtest exist for mailing then redirect accordingly | |||
$abtest = CRM_Mailing_BAO_MailingAB::getABTest($mid); | |||
if (!empty($abtest) && !empty($abtest->id)) { | |||
if (!empty($abtest->id)) { |
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.
I feel like this would upset php 8.x if $abtest
is null
@eileenmcnaughton I did a little more research and reports are mixed about how safe this change would be. Better leave it alone. |
Overview
Overly-verbose code cleanup.
Technical Details
The
empty()
function will automatically handle the case where the first part of the expression is not set, so there's no need to add an extra call toempty()
.