Completed
Pull Request — staging (#840)
by
unknown
16:43
created
src/Form/FieldBuilder.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -11,59 +11,59 @@  discard block
 block discarded – undo
11 11
 
12 12
 trait FieldBuilder {
13 13
     protected function get_field_classes( $field ) {
14
-        $field_classes = [];
15
-        $label_classes = [];
14
+        $field_classes = [ ];
15
+        $label_classes = [ ];
16 16
 
17
-        if( $field['additional-classes'] != '' ) {
17
+        if ( $field[ 'additional-classes' ] != '' ) {
18 18
 
19
-            $field_classes = explode( ' ' , $field['additional-classes'] );
19
+            $field_classes = explode( ' ', $field[ 'additional-classes' ] );
20 20
 
21
-            if( in_array( 'field-left-half' , $field_classes ) ) {
22
-                $$label_classes[] = 'field-left-half';
23
-                $key = array_search( 'field-left-half' , $field_classes );
24
-                unset( $field_classes[$key] );
21
+            if ( in_array( 'field-left-half', $field_classes ) ) {
22
+                $$label_classes[ ] = 'field-left-half';
23
+                $key = array_search( 'field-left-half', $field_classes );
24
+                unset( $field_classes[ $key ] );
25 25
             } // input half right
26
-            if( in_array( 'field-right-half' , $field_classes ) ) {
27
-                $$label_classes[] = 'field-right-half';
28
-                $key = array_search( 'field-right-half' , $field_classes );
29
-                unset( $field_classes[$key] );
26
+            if ( in_array( 'field-right-half', $field_classes ) ) {
27
+                $$label_classes[ ] = 'field-right-half';
28
+                $key = array_search( 'field-right-half', $field_classes );
29
+                unset( $field_classes[ $key ] );
30 30
             } // input thirds (1/3 width, floated left)
31
-            if( in_array( 'field-third' , $field_classes ) ) {
32
-                $$label_classes[] = 'field-third';
33
-                $key = array_search( 'field-third' , $field_classes );
34
-                unset( $field_classes[$key] );
31
+            if ( in_array( 'field-third', $field_classes ) ) {
32
+                $$label_classes[ ] = 'field-third';
33
+                $key = array_search( 'field-third', $field_classes );
34
+                unset( $field_classes[ $key ] );
35 35
             } // 2 column radio
36
-            if( in_array( 'option-2-col' , $field_classes ) ) {
37
-                $$label_classes[] = 'option-2-col';
38
-                $key = array_search( 'option-2-col' , $field_classes );
39
-                unset( $field_classes[$key] );
36
+            if ( in_array( 'option-2-col', $field_classes ) ) {
37
+                $$label_classes[ ] = 'option-2-col';
38
+                $key = array_search( 'option-2-col', $field_classes );
39
+                unset( $field_classes[ $key ] );
40 40
             } // 3 column radio
41
-            if( in_array( 'option-3-col' , $field_classes ) ) {
42
-                $$label_classes[] = 'option-3-col';
43
-                $key = array_search( 'option-3-col' , $field_classes );
44
-                unset( $field_classes[$key] );
41
+            if ( in_array( 'option-3-col', $field_classes ) ) {
42
+                $$label_classes[ ] = 'option-3-col';
43
+                $key = array_search( 'option-3-col', $field_classes );
44
+                unset( $field_classes[ $key ] );
45 45
             } // 4 column radio
46
-            if( in_array( 'option-4-col' , $field_classes ) ) {
47
-                $$label_classes[] = 'option-4-col';
48
-                $key = array_search( 'option-4-col' , $field_classes );
49
-                unset( $field_classes[$key] );
46
+            if ( in_array( 'option-4-col', $field_classes ) ) {
47
+                $$label_classes[ ] = 'option-4-col';
48
+                $key = array_search( 'option-4-col', $field_classes );
49
+                unset( $field_classes[ $key ] );
50 50
             } // inline radio & checkboxes etc
51
-            if( in_array( 'option-inline' , $field_classes ) ) {
52
-                $$label_classes[] = 'option-inline';
53
-                $key = array_search( 'option-inline' , $field_classes );
54
-                unset( $field_classes[$key] );
51
+            if ( in_array( 'option-inline', $field_classes ) ) {
52
+                $$label_classes[ ] = 'option-inline';
53
+                $key = array_search( 'option-inline', $field_classes );
54
+                unset( $field_classes[ $key ] );
55 55
             }
56 56
         }
57 57
 
58 58
         // if the form is set to inline, add the inline class to our labels
59
-        if( $this->form_inline ) {
60
-            $label_classes[] = 'label-inline';
59
+        if ( $this->form_inline ) {
60
+            $label_classes[ ] = 'label-inline';
61 61
         }
62 62
         
63
-        if( isset( $field['hide-label'] ) ) {
64
-            if( absint( $field['hide-label'] ) === 1 ) {
63
+        if ( isset( $field[ 'hide-label' ] ) ) {
64
+            if ( absint( $field[ 'hide-label' ] ) === 1 ) {
65 65
                 $this->increase_hidden_label_count();
66
-                $field_classes[] = 'field-no-label';
66
+                $field_classes[ ] = 'field-no-label';
67 67
             }
68 68
         }
69 69
 
@@ -78,37 +78,37 @@  discard block
 block discarded – undo
78 78
     }
79 79
 
80 80
     protected function get_label( $field ) {
81
-        $label = [];
82
-        if( $field['type'] == 'email' ) {
83
-            $label['props']['visible'] = '';
81
+        $label = [ ];
82
+        if ( $field[ 'type' ] == 'email' ) {
83
+            $label[ 'props' ][ 'visible' ] = '';
84 84
         } else {
85
-            $label['props']['visible'] = isset( $field['hide'] ) ? 'style="display:none;"' : '';
85
+            $label[ 'props' ][ 'visible' ] = isset( $field[ 'hide' ] ) ? 'style="display:none;"' : '';
86 86
         }
87
-        if ( isset( $field['hide-label'] ) ) {
88
-            $label['hide-label'] = true;
87
+        if ( isset( $field[ 'hide-label' ] ) ) {
88
+            $label[ 'hide-label' ] = true;
89 89
         }
90
-        if ( isset( $field['label'] ) ) {
91
-            $label['value'] = $field['label'];
90
+        if ( isset( $field[ 'label' ] ) ) {
91
+            $label[ 'value' ] = $field[ 'label' ];
92 92
         }
93 93
         return $label;
94 94
     }
95 95
 
96 96
     protected function get_value( $field ) {
97 97
         // pass our default value through our filter to parse dynamic data by tag (used solely for 'text' type)
98
-        $default_value = ( isset( $field['default'] ) ? esc_attr( $field['default'] ) : '' );
98
+        $default_value = ( isset( $field[ 'default' ] ) ? esc_attr( $field[ 'default' ] ) : '' );
99 99
         $default_value = apply_filters( 'yikes-mailchimp-process-default-tag', $default_value );
100
-        return apply_filters( 'yikes-mailchimp-' . $field['merge'] . '-default-value', $default_value, $field, $this->form_id );
100
+        return apply_filters( 'yikes-mailchimp-' . $field[ 'merge' ] . '-default-value', $default_value, $field, $this->form_id );
101 101
     }
102 102
 
103 103
     protected function get_placeholder( $field ) {
104
-        return isset( $field['placeholder'] ) ? $field['placeholder'] : '';
104
+        return isset( $field[ 'placeholder' ] ) ? $field[ 'placeholder' ] : '';
105 105
     }
106 106
 
107 107
     protected function get_hidden( $field ) {
108 108
         $visible = true;
109 109
         // if both hide label and hide field are checked, we gotta hide the field!
110
-        if( isset( $field['hide' ] ) && $field['hide'] == 1 ) {
111
-            if( isset( $field['hide-label' ] ) && $field['hide-label'] == 1 ) {
110
+        if ( isset( $field[ 'hide' ] ) && $field[ 'hide' ] == 1 ) {
111
+            if ( isset( $field[ 'hide-label' ] ) && $field[ 'hide-label' ] == 1 ) {
112 112
                 $visible = false;
113 113
             }
114 114
         }
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
         $description_above = false;
121 121
         $description       = '';
122 122
 
123
-        if ( isset( $field['description'] ) && trim( $field['description'] ) !== '' ) {
123
+        if ( isset( $field[ 'description' ] ) && trim( $field[ 'description' ] ) !== '' ) {
124 124
             $show_description = true;
125
-            $description = $field['description'];
125
+            $description = $field[ 'description' ];
126 126
         }
127 127
 
128
-        if ( isset( $field['description_above'] ) && $field['description_above'] === '1' ) {
128
+        if ( isset( $field[ 'description_above' ] ) && $field[ 'description_above' ] === '1' ) {
129 129
             $description_above = true;
130 130
         }
131 131
         
Please login to merge, or discard this patch.
src/Form/OptinForm.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 * @since %VERSION%
87 87
 	 * @var array
88 88
 	 */
89
-	private $submitted_data = [];
89
+	private $submitted_data = [ ];
90 90
 
91 91
 	/**
92 92
 	 * The validated data for this form.
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 * @since %VERSION%
95 95
 	 * @var array
96 96
 	 */
97
-	private $valid_data = [];
97
+	private $valid_data = [ ];
98 98
 
99 99
 	/**
100 100
 	 * Admin CSS Class
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		$this->form_id           = $form_id;
119 119
 		$this->form_data         = $form_data;
120 120
 		$this->field_count       = $this->set_field_count();
121
-		$this->form_inline       = $form_data['form_settings']['yikes-easy-mc-inline-form'];
121
+		$this->form_inline       = $form_data[ 'form_settings' ][ 'yikes-easy-mc-inline-form' ];
122 122
 		$this->recaptcha         = ( new RecaptchaModel() )->setup( $attr );
123 123
 	}
124 124
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	private function admin_class() {
131 131
 		$is_admin = is_user_logged_in() && current_user_can(
132
-			apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' )
132
+			apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' )
133 133
 		);
134 134
 		return $is_admin ? ' admin-logged-in' : '';
135 135
 	}
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 * @since %VERSION%
162 162
 	 */
163 163
 	private function create_fields() {
164
-		$fields = [];
164
+		$fields = [ ];
165 165
 
166 166
 		// // Manually add the hidden nonce and referrer fields.
167 167
 		// $fields[] = new Hidden( "yikes_easy_mc_new_subscriber", wp_create_nonce( 'yikes_easy_mc_form_submit' ), $this->form_id );
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
 		// $fields[] = new Hidden( 'yikes-mailchimp-submitted-form', $this->form_id, $this->form_id );
178 178
 
179 179
 		// Add all of the active fields.
180
-		foreach ( $this->form_data['fields'] as $field ) {
181
-			if ( isset( $field['hide'] ) && (string) $field['hide'] === '1' ) {
180
+		foreach ( $this->form_data[ 'fields' ] as $field ) {
181
+			if ( isset( $field[ 'hide' ] ) && (string) $field[ 'hide' ] === '1' ) {
182 182
 				$this->reduce_field_count();
183 183
 			}
184 184
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	 *
194 194
 	 * @since %VERSION%
195 195
 	 */
196
-	public function render( array $context = [] ) {
196
+	public function render( array $context = [ ] ) {
197 197
 		foreach ( $this->fields as $field ) {
198 198
 			$field->render();
199 199
 		}
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 	 * @since %VERSION%
228 228
 	 */
229 229
 	public function validate_submission() {
230
-		$valid = [];
230
+		$valid = [ ];
231 231
 		foreach ( $this->fields as $field ) {
232 232
 			try {
233 233
 				$submitted = array_key_exists( $field->get_id(), $this->submitted_data )
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 		$classes     = $this->get_field_classes( $field );
309 309
 		$placeholder = $this->get_placeholder( $field );
310 310
 		$description = $this->get_description( $field );
311
-		$merge       = $field['merge'];
311
+		$merge       = $field[ 'merge' ];
312 312
 		$hidden      = $this->get_hidden( $field );
313 313
 		return [
314 314
 			new $type(
Please login to merge, or discard this patch.
src/Assets/ScriptAsset.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 *
74 74
 	 * @var array
75 75
 	 */
76
-	protected $localizations = [];
76
+	protected $localizations = [ ];
77 77
 
78 78
 	/**
79 79
 	 * Instantiate a ScriptAsset object.
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	public function __construct(
92 92
 		$handle,
93 93
 		$source,
94
-		$dependencies = [],
94
+		$dependencies = [ ],
95 95
 		$version = self::VERSION,
96 96
 		$in_footer = self::ENQUEUE_HEADER,
97 97
 		$external = false
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 * @return Closure
128 128
 	 */
129 129
 	protected function get_register_closure() {
130
-		return function () {
130
+		return function() {
131 131
 			if ( wp_script_is( $this->handle, 'registered' ) ) {
132 132
 				return;
133 133
 			}
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	 * @return Closure
151 151
 	 */
152 152
 	protected function get_enqueue_closure() {
153
-		return function () {
153
+		return function() {
154 154
 			if ( ! wp_script_is( $this->handle, 'registered' ) ) {
155 155
 				throw FailedToRegister::asset_not_registered( $this->handle );
156 156
 			}
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	 * @return Closure
172 172
 	 */
173 173
 	protected function get_dequeue_closure() {
174
-		return function () {
174
+		return function() {
175 175
 			wp_dequeue_script( $this->handle );
176 176
 		};
177 177
 	}
Please login to merge, or discard this patch.
views/recaptcha-box.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
 
19 19
 <div
20 20
     class="g-recaptcha"
21
-    data-sitekey="<?= esc_attr( $this->form->recaptcha['site_key'] ); ?>"
22
-    data-theme="<?= esc_attr( $this->form->recaptcha['theme'] ); ?>"
23
-    data-type="<?= esc_attr( $this->form->recaptcha['type'] ); ?>"
24
-    data-size="<?= esc_attr( $this->form->recaptcha['size'] ); ?>"
25
-    data-callback="<?= esc_attr( $this->form->recaptcha['success_callback'] ); ?>"
26
-    data-expired-callback="<?= esc_attr( $this->form->recaptcha['expired_callback'] ); ?>"
21
+    data-sitekey="<?= esc_attr( $this->form->recaptcha[ 'site_key' ] ); ?>"
22
+    data-theme="<?= esc_attr( $this->form->recaptcha[ 'theme' ] ); ?>"
23
+    data-type="<?= esc_attr( $this->form->recaptcha[ 'type' ] ); ?>"
24
+    data-size="<?= esc_attr( $this->form->recaptcha[ 'size' ] ); ?>"
25
+    data-callback="<?= esc_attr( $this->form->recaptcha[ 'success_callback' ] ); ?>"
26
+    data-expired-callback="<?= esc_attr( $this->form->recaptcha[ 'expired_callback' ] ); ?>"
27 27
 ></div>
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
src/Field/BaseInput.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 *
32 32
 	 * @var array
33 33
 	 */
34
-	private $classes = [];
34
+	private $classes = [ ];
35 35
 
36 36
 	/**
37 37
 	 * Field placeholder.
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 	}
91 91
 
92 92
 	public function field_classes() {
93
-		return $this->classes['field_classes'];
93
+		return $this->classes[ 'field_classes' ];
94 94
 	}
95 95
 
96 96
 	public function label_classes() {
97
-		return $this->classes['label_classes'];
97
+		return $this->classes[ 'label_classes' ];
98 98
 	}
99 99
 
100 100
 	public function get_name() {
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 	}
111 111
 
112 112
 	public function set_description( $description ) {
113
-		$this->show_desc   = $description['show_description'];
114
-		$this->desc_above  = $description['description_above'];
115
-		$this->description = $description['description'];
113
+		$this->show_desc   = $description[ 'show_description' ];
114
+		$this->desc_above  = $description[ 'description_above' ];
115
+		$this->description = $description[ 'description' ];
116 116
 	}
117 117
 
118 118
 	/**
@@ -122,12 +122,12 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	public function render() {
124 124
 		?>
125
-		<label for="<?= esc_attr( $this->get_id() ); ?>" class="<?= esc_html( implode( ' ' , $this->label_classes() ) ); ?>" <?= esc_html( implode( ' ' , $this->label['props'] ) ); ?> >
125
+		<label for="<?= esc_attr( $this->get_id() ); ?>" class="<?= esc_html( implode( ' ', $this->label_classes() ) ); ?>" <?= esc_html( implode( ' ', $this->label[ 'props' ] ) ); ?> >
126 126
 
127 127
 		<!-- dictate label visibility -->
128
-		<?php if ( ! isset( $this->label['hide-label'] ) ) { ?>
128
+		<?php if ( ! isset( $this->label[ 'hide-label' ] ) ) { ?>
129 129
 			<span class="<?= esc_attr( $this->merge ) . '-label'; ?>">
130
-				<?= esc_html( apply_filters( 'yikes-mailchimp-'. $this->merge .'-label' , esc_attr( $this->label['value'] ), $this->form_id ) ); ?>
130
+				<?= esc_html( apply_filters( 'yikes-mailchimp-' . $this->merge . '-label', esc_attr( $this->label[ 'value' ] ), $this->form_id ) ); ?>
131 131
 			</span>
132 132
 		<?php }
133 133
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         endif;
143 143
 		?>
144 144
 		<input type="<?= esc_attr( $this->get_type() ); ?>"
145
-			class="<?= esc_attr( implode( ' ' , $this->field_classes() ) ); ?>"
145
+			class="<?= esc_attr( implode( ' ', $this->field_classes() ) ); ?>"
146 146
 			name="<?= esc_attr( $this->get_name() ); ?>"
147 147
 			placeholder="<?= esc_attr( $this->get_placeholder() ); ?>"
148 148
 			id="<?= esc_attr( $this->get_id() ); ?>"
Please login to merge, or discard this patch.
src/Form/FormHelper.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 trait FormHelper {
6 6
     public function form_title( $title, $custom_title, $form_name ) {
7 7
         $form_title = '';
8
-        switch( true ) {
8
+        switch ( true ) {
9 9
             case ! empty( $custom_title ) && isset( $custom_title ):
10 10
                 $form_title = $custom_title;
11 11
             break;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 				 */
32 32
 				return apply_filters( 'yikes-mailchimp-form-description', $custom_description, $this->form_id );
33 33
 			} else {
34
-				return apply_filters( 'yikes-mailchimp-form-description', $this->form_data['form_description'], $this->form_id );
34
+				return apply_filters( 'yikes-mailchimp-form-description', $this->form_data[ 'form_description' ], $this->form_id );
35 35
 			}
36 36
 		} else {
37 37
             return false;
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
     }
40 40
 
41 41
     protected function reduce_field_count() {
42
-		$this->field_count = $this->field_count --;
42
+		$this->field_count = $this->field_count--;
43 43
 	}
44 44
 
45 45
 	protected function set_field_count() {
46
-		return isset( $this->form_data['fields'] ) ? count( $this->form_data['fields'] ) : 0;
46
+		return isset( $this->form_data[ 'fields' ] ) ? count( $this->form_data[ 'fields' ] ) : 0;
47 47
 	}
48 48
 
49 49
 	public function form_classes( bool $is_submitted ) {
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
             $form_classes .= ' yikes-mailchimp-form-inline';
53 53
         }
54 54
 
55
-        if ( $is_submitted && $this->form_data['submission_settings']['hide_form_post_signup'] == 1 ) {
56
-            $form_classes .=  ' yikes-easy-mc-display-none';
55
+        if ( $is_submitted && $this->form_data[ 'submission_settings' ][ 'hide_form_post_signup' ] == 1 ) {
56
+            $form_classes .= ' yikes-easy-mc-display-none';
57 57
         }
58 58
 
59
-        $form_classes .= $this->form_data['form_settings']['yikes-easy-mc-form-class-names'];
59
+        $form_classes .= $this->form_data[ 'form_settings' ][ 'yikes-easy-mc-form-class-names' ];
60 60
         return apply_filters( 'yikes-mailchimp-form-class', $form_classes, $this->form_id );
61 61
 	}
62 62
 
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 	}
66 66
     
67 67
     public function edit_form_link() {
68
-		if( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) {
68
+		if ( current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) {
69 69
 			$edit_form_link = '<span class="edit-link">';
70
-			$edit_form_link .= '<a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $this->form_id ) ) . '" title="' . __( 'Edit' , 'yikes-inc-easy-mailchimp-extender' ) . ' ' . ucwords( $this->form_data['form_name'] ) . '">' . __( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
70
+			$edit_form_link .= '<a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $this->form_id ) ) . '" title="' . __( 'Edit', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . ucwords( $this->form_data[ 'form_name' ] ) . '">' . __( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
71 71
 			$edit_form_link .= '</span>';
72
-			$edit_form_link = apply_filters( 'yikes-mailchimp-front-end-form-action-links', $edit_form_link, $this->form_id, ucwords( $this->form_data['form_name'] ) );
72
+			$edit_form_link = apply_filters( 'yikes-mailchimp-front-end-form-action-links', $edit_form_link, $this->form_id, ucwords( $this->form_data[ 'form_name' ] ) );
73 73
 		} else {
74 74
 			$edit_form_link = '';
75 75
 		}
Please login to merge, or discard this patch.
src/Shortcode/EasyFormsShortcode.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 final class EasyFormsShortcode extends BaseShortcode {
30 30
 
31
-    const TAG           = 'yikes-mailchimp';
31
+    const TAG = 'yikes-mailchimp';
32 32
 	const VIEW_URI      = 'views/easy-forms-shortcode';
33 33
 	const SUBMITTED_URI = 'views/easy-forms-shortcode-completed';
34 34
 	const DESC_URI      = 'views/easy-forms-shortcode-description';
@@ -97,28 +97,28 @@  discard block
 block discarded – undo
97 97
 	 * @throws InvalidPostID When the post ID is not valid.
98 98
 	 */
99 99
 	protected function get_context( array $attr ) {
100
-		$form_id   = $attr['form'] ? $attr['form'] : '1';
100
+		$form_id   = $attr[ 'form' ] ? $attr[ 'form' ] : '1';
101 101
 		$form_data = ( new EasyFormsModel() )->find( $form_id );
102 102
 
103 103
 		$this->is_submitted = $this->is_submitting_form();
104 104
 
105 105
 		// Set up the form object.
106 106
 		$form = $this->get_optin_form( $form_id, $form_data, $attr );
107
-		$description = $form->form_description( $attr['description'], $attr['custom_description'] );
107
+		$description = $form->form_description( $attr[ 'description' ], $attr[ 'custom_description' ] );
108 108
 		
109 109
 		add_action( 'easy_forms_do_form_description', function( $view ) {
110 110
 			echo $view->render_partial( static::DESC_URI ); // phpcs:ignore WordPress.Security.EscapeOutput
111 111
 		} );
112 112
 
113 113
 		return [
114
-			'title'                 => $form->form_title( $attr['title'], $attr['custom_title'], $form_data['form_name'] ),
114
+			'title'                 => $form->form_title( $attr[ 'title' ], $attr[ 'custom_title' ], $form_data[ 'form_name' ] ),
115 115
 			'description'           => $description,
116 116
 			'form_classes'          => $form->form_classes( $this->is_submitted ),
117 117
 			'edit_form_link'        => $form->edit_form_link(),
118 118
 			'submit_button_classes' => $form->submit_button_classes(),
119
-			'submit_button_text'    => $form->submit_button_text( $attr['submit'] ),
120
-			'ajax'                  => $attr['ajax'],
121
-			'form_settings'         => $form_data['form_settings'],
119
+			'submit_button_text'    => $form->submit_button_text( $attr[ 'submit' ] ),
120
+			'ajax'                  => $attr[ 'ajax' ],
121
+			'form_settings'         => $form_data[ 'form_settings' ],
122 122
 			'form_data'             => $form_data,
123 123
 			'form'                  => $form,
124 124
 			'form_id'               => $form_id,
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	 *
189 189
 	 * @return string Rendered HTML.
190 190
 	 */
191
-	public function render( array $context = [] ) {
191
+	public function render( array $context = [ ] ) {
192 192
 		try {
193 193
 			$this->enqueue_assets();
194 194
 			$view = new FormEscapedView( new NoOverrideLocationView( $this->get_view_uri() ) );
Please login to merge, or discard this patch.
views/easy-forms-shortcode.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	<?php do_action( 'easy_forms_do_form_description', $this ); ?>
49 49
 
50 50
 	<form method="POST"
51
-		id="<?= esc_attr( $form_data['form_name'] ); ?>-<?= absint( $form_id ); ?>"
51
+		id="<?= esc_attr( $form_data[ 'form_name' ] ); ?>-<?= absint( $form_id ); ?>"
52 52
 		class="<?= esc_attr( $form_classes ); ?>"
53 53
 		data-attr-form-id="<?= absint( $form_id ); ?>"
54 54
 	>
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 *	for non-admins
85 85
 */
86 86
 if ( ! current_user_can( 'manage_options' ) ) {
87
-	$impressions = $form_data['impressions'] + 1;
87
+	$impressions = $form_data[ 'impressions' ] + 1;
88 88
 
89 89
 	$form_data->update_form_field( $form_id, 'impressions', $impressions );
90 90
 }
Please login to merge, or discard this patch.