| Conditions | 1 |
| Paths | 1 |
| Total Lines | 68 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 84 | public function mailchimp_form() { |
||
| 85 | ?> |
||
| 86 | <div class="mailchimp_form"> |
||
| 87 | <div class="section"> |
||
| 88 | <div class="section_toggler"> |
||
| 89 | <span class="section_title"><?php echo esc_html__( 'Text Elements', 'jetpack' ); ?></span> |
||
| 90 | </div> |
||
| 91 | <div class="section_content"> |
||
| 92 | <div class="field"> |
||
| 93 | <label for="jetpack_mailchimp_email"><?php echo esc_html__( 'Email Placeholder', 'jetpack' ); ?></label> |
||
| 94 | <input type="text" placeholder="<?php echo esc_html__( 'Enter your email', 'jetpack' ); ?>" value="" id="jetpack_mailchimp_email"> |
||
| 95 | </div> |
||
| 96 | </div> |
||
| 97 | </div> |
||
| 98 | <div class="section"> |
||
| 99 | <div class="section_toggler"> |
||
| 100 | <span class="section_title"><?php echo esc_html__( 'Notifications', 'jetpack' ); ?></span> |
||
| 101 | </div> |
||
| 102 | <div class="section_content"> |
||
| 103 | <div class="field"> |
||
| 104 | <label for="jetpack_mailchimp_processing_text"><?php echo esc_html__( 'Processing', 'jetpack' ); ?></label> |
||
| 105 | <input type="text" placeholder="<?php echo esc_html__( 'Processing', 'jetpack' ); ?>" value="" id="jetpack_mailchimp_processing_text"> |
||
| 106 | </div> |
||
| 107 | <div class="field"> |
||
| 108 | <label for="jetpack_mailchimp_success_text"><?php echo esc_html__( 'Success text', 'jetpack' ); ?></label> |
||
| 109 | <input type="text" placeholder="<?php echo esc_html__( 'Success! You\'re on the list.', 'jetpack' ); ?>" value="" id="jetpack_mailchimp_success_text"> |
||
| 110 | </div> |
||
| 111 | <div class="field"> |
||
| 112 | <label for="jetpack_mailchimp_error_text"><?php echo esc_html__( 'Error text', 'jetpack' ); ?></label> |
||
| 113 | <input type="text" placeholder="<?php echo esc_html__( 'Whoops! There was an error and we couldn\'t process your subscription. Please reload the page and try again.', 'jetpack' ); ?>" value="" id="jetpack_mailchimp_error_text"> |
||
| 114 | </div> |
||
| 115 | </div> |
||
| 116 | </div> |
||
| 117 | <div class="section"> |
||
| 118 | <div class="section_toggler"> |
||
| 119 | <span class="section_title"><?php echo esc_html__( 'Mailchimp Groups', 'jetpack' ); ?></span> |
||
| 120 | </div> |
||
| 121 | <div class="section_content"> |
||
| 122 | <a href=""><?php echo esc_html__( 'Learn about groups', 'jetpack' ); ?></a> |
||
| 123 | </div> |
||
| 124 | </div> |
||
| 125 | <div class="section"> |
||
| 126 | <div class="section_toggler"> |
||
| 127 | <span class="section_title"><?php echo esc_html__( 'Signup Location Tracking', 'jetpack' ); ?></span> |
||
| 128 | </div> |
||
| 129 | <div class="section_content"> |
||
| 130 | <div class="field"> |
||
| 131 | <label for="jetpack_mailchimp_signup_tag"><?php echo esc_html__( 'Signup Field Tag', 'jetpack' ); ?></label> |
||
| 132 | <input type="text" placeholder="<?php echo esc_html__( 'SIGNUP', 'jetpack' ); ?>" value="" id="jetpack_mailchimp_signup_tag"> |
||
| 133 | </div> |
||
| 134 | <div class="field"> |
||
| 135 | <label for="jetpack_mailchimp_signup_value"><?php echo esc_html__( 'Signup Field Value', 'jetpack' ); ?></label> |
||
| 136 | <input type="text" placeholder="<?php echo esc_html__( 'website', 'jetpack' ); ?>" value="" id="jetpack_mailchimp_signup_value"> |
||
| 137 | </div> |
||
| 138 | <a href=""><?php echo esc_html__( 'Learn about signup location tracking(opens in a new tab)', 'jetpack' ); ?></a> |
||
| 139 | </div> |
||
| 140 | </div> |
||
| 141 | <div class="section"> |
||
| 142 | <div class="section_toggler"> |
||
| 143 | <span class="section_title"><?php echo esc_html__( 'Mailchimp Groups', 'jetpack' ); ?></span> |
||
| 144 | </div> |
||
| 145 | <div class="section_content"> |
||
| 146 | <a href=""><?php echo esc_html__( 'Manage Connection', 'jetpack' ); ?></a> |
||
| 147 | </div> |
||
| 148 | </div> |
||
| 149 | </div> |
||
| 150 | <?php |
||
| 151 | } |
||
| 152 | |||
| 187 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: