Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use another variable assignment with a combined operator #1442

Open
elfring opened this issue Nov 23, 2021 · 0 comments
Open

Use another variable assignment with a combined operator #1442

elfring opened this issue Nov 23, 2021 · 0 comments

Comments

@elfring
Copy link

elfring commented Nov 23, 2021

馃憖 Some source code analysis tools can help to find opportunities for improving software components.
馃挱 I propose to increase the usage of combined operators accordingly.

diff --git a/includes/types/CMB2_Type_Multi_Base.php b/includes/types/CMB2_Type_Multi_Base.php
index c43c2af..b711c5d 100644
--- a/includes/types/CMB2_Type_Multi_Base.php
+++ b/includes/types/CMB2_Type_Multi_Base.php
@@ -87,7 +87,7 @@ abstract class CMB2_Type_Multi_Base extends CMB2_Type_Base {
                if ( $option_none = $field->args( 'show_option_none' ) ) {
                        $options[''] = $option_none;
                }
-               $options = $options + (array) $field->options();
+               $options += (array) $field->options();
                foreach ( $options as $opt_value => $opt_label ) {
 
                        // Clone args & modify for just this item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant