Completed
Pull Request — staging (#840)
by
unknown
33:11 queued 13:10
created
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,14 +97,14 @@  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
 		if ( false !== $description ) {
110 110
 			add_action( 'easy_forms_do_form_description', function( $view ) {
@@ -113,14 +113,14 @@  discard block
 block discarded – undo
113 113
 		}
114 114
 
115 115
 		return [
116
-			'title'                 => $form->form_title( $attr['title'], $attr['custom_title'], $form_data['form_name'] ),
116
+			'title'                 => $form->form_title( $attr[ 'title' ], $attr[ 'custom_title' ], $form_data[ 'form_name' ] ),
117 117
 			'description'           => $description,
118 118
 			'form_classes'          => $form->form_classes( $this->is_submitted ),
119 119
 			'edit_form_link'        => $form->edit_form_link(),
120 120
 			'submit_button_classes' => $form->submit_button_classes(),
121
-			'submit_button_text'    => $form->submit_button_text( $attr['submit'] ),
122
-			'ajax'                  => $attr['ajax'],
123
-			'form_settings'         => $form_data['form_settings'],
121
+			'submit_button_text'    => $form->submit_button_text( $attr[ 'submit' ] ),
122
+			'ajax'                  => $attr[ 'ajax' ],
123
+			'form_settings'         => $form_data[ 'form_settings' ],
124 124
 			'form_data'             => $form_data,
125 125
 			'form'                  => $form,
126 126
 			'form_id'               => $form_id,
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	 *
191 191
 	 * @return string Rendered HTML.
192 192
 	 */
193
-	public function render( array $context = [] ) {
193
+	public function render( array $context = [ ] ) {
194 194
 		try {
195 195
 			$this->enqueue_assets();
196 196
 			$view = new FormEscapedView( new NoOverrideLocationView( $this->get_view_uri() ) );
Please login to merge, or discard this patch.