| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function submit_button_text( $shortcode_prop ) { |
||
| 18 | $submit_button_text = ''; |
||
| 19 | switch( true ) { |
||
| 20 | case ! empty( $shortcode_prop ): |
||
| 21 | $submit_button_text = $shortcode_prop; |
||
| 22 | break; |
||
| 23 | |||
| 24 | case $this->form_data['form_settings']['yikes-easy-mc-submit-button-text']: |
||
| 25 | $submit_button_text = $this->form_data['form_settings']['yikes-easy-mc-submit-button-text']; |
||
| 26 | break; |
||
| 27 | |||
| 28 | default: |
||
| 29 | $submit_button_text = __( 'Submit', 'yikes-inc-easy-mailchimp-extender' ); |
||
| 30 | break; |
||
| 31 | } |
||
| 32 | return apply_filters( 'yikes-mailchimp-form-submit-button-text', $submit_button_text, $this->form_id ); |
||
| 33 | } |
||
| 34 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: