Completed
Pull Request — master (#1580)
by Stephanie
57s
created
classes/models/FrmFormApi.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
 			if ( isset( $addon['categories'] ) ) {
106 106
 				$cats = array_intersect( $this->skip_categories(), $addon['categories'] );
107 107
 				if ( ! empty( $cats ) ) {
108
-					unset( $addons[ $k ] );
108
+					unset( $addons[$k] );
109 109
 					continue;
110 110
 				}
111 111
 			}
112 112
 
113 113
 			if ( ! array_key_exists( 'is_new', $addon ) && array_key_exists( 'released', $addon ) ) {
114
-				$addons[ $k ]['is_new'] = $this->is_new( $addon );
114
+				$addons[$k]['is_new'] = $this->is_new( $addon );
115 115
 			}
116 116
 		}
117 117
 
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
 					return $addon;
154 154
 				}
155 155
 			}
156
-		} elseif ( isset( $addons[ $download_id ] ) ) {
157
-			$plugin = $addons[ $download_id ];
156
+		} elseif ( isset( $addons[$download_id] ) ) {
157
+			$plugin = $addons[$download_id];
158 158
 		}
159 159
 
160 160
 		return $plugin;
Please login to merge, or discard this patch.
classes/helpers/FrmFormsListHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 		$page     = $this->get_pagenum();
21 21
 		$per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' );
22 22
 
23
-		$mode    = self::get_param(
23
+		$mode = self::get_param(
24 24
 			array(
25 25
 				'param'   => 'mode',
26 26
 				'default' => 'list',
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
 				'default' => 'name',
33 33
 			)
34 34
 		);
35
-		$order   = self::get_param(
35
+		$order = self::get_param(
36 36
 			array(
37 37
 				'param'   => 'order',
38 38
 				'default' => 'ASC',
39 39
 			)
40 40
 		);
41
-		$start   = self::get_param(
41
+		$start = self::get_param(
42 42
 			array(
43 43
 				'param'   => 'start',
44 44
 				'default' => ( $page - 1 ) * $per_page,
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 		$counts    = FrmForm::get_count();
163 163
 		$form_type = FrmAppHelper::simple_get( 'form_type', 'sanitize_title', 'published' );
164 164
 
165
-		if ( isset( $statuses[ $form_type ] ) ) {
165
+		if ( isset( $statuses[$form_type] ) ) {
166 166
 			$counts->$form_type = $this->total_items;
167 167
 		}
168 168
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 			if ( $counts->{$status} || 'draft' !== $status ) {
185 185
 				/* translators: %1$s: Status, %2$s: Number of items */
186
-				$links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>';
186
+				$links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>';
187 187
 			}
188 188
 
189 189
 			unset( $status, $name );
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 	private function get_actions( &$actions, $item, $edit_link ) {
349 349
 		$new_actions = FrmFormsHelper::get_action_links( $item->id, $item );
350 350
 		foreach ( $new_actions as $link => $action ) {
351
-			$new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' );
351
+			$new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' );
352 352
 		}
353 353
 
354 354
 		if ( 'trash' == $this->status ) {
Please login to merge, or discard this patch.
deprecated/FrmDeprecated.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		FrmAppHelper::permission_check( 'frm_edit_forms' );
28 28
 
29 29
 		$action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action';
30
-		$action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[ $action ];
30
+		$action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[$action];
31 31
 
32 32
 		if ( $action === 'create' ) {
33 33
 			FrmFormsController::update( $values );
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		}
36 36
 
37 37
 		$values = FrmFormsHelper::setup_new_vars( $values );
38
-		$id   = FrmForm::create( $values );
38
+		$id = FrmForm::create( $values );
39 39
 		$values['id'] = $id;
40 40
 
41 41
 		FrmFormsController::edit( $values );
Please login to merge, or discard this patch.
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -448,8 +448,8 @@  discard block
 block discarded – undo
448 448
 	 */
449 449
 	public static function get_shortcode_tag( $shortcodes, $short_key, $args ) {
450 450
 		_deprecated_function( __FUNCTION__, '3.0', 'FrmShortcodeHelper::get_shortcode_tag' );
451
-        return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args );
452
-    }
451
+		return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args );
452
+	}
453 453
 
454 454
 	/**
455 455
 	 * @deprecated 3.01
@@ -459,55 +459,55 @@  discard block
 block discarded – undo
459 459
 		return FrmStylesHelper::get_single_label_positions();
460 460
 	}
461 461
 
462
-    /**
463
-     * @deprecated 3.02.03
464
-     */
465
-    public static function jquery_themes() {
462
+	/**
463
+	 * @deprecated 3.02.03
464
+	 */
465
+	public static function jquery_themes() {
466 466
 		_deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_themes' );
467 467
 
468
-        $themes = array(
469
-            'ui-lightness'  => 'UI Lightness',
470
-            'ui-darkness'   => 'UI Darkness',
471
-            'smoothness'    => 'Smoothness',
472
-            'start'         => 'Start',
473
-            'redmond'       => 'Redmond',
474
-            'sunny'         => 'Sunny',
475
-            'overcast'      => 'Overcast',
476
-            'le-frog'       => 'Le Frog',
477
-            'flick'         => 'Flick',
468
+		$themes = array(
469
+			'ui-lightness'  => 'UI Lightness',
470
+			'ui-darkness'   => 'UI Darkness',
471
+			'smoothness'    => 'Smoothness',
472
+			'start'         => 'Start',
473
+			'redmond'       => 'Redmond',
474
+			'sunny'         => 'Sunny',
475
+			'overcast'      => 'Overcast',
476
+			'le-frog'       => 'Le Frog',
477
+			'flick'         => 'Flick',
478 478
 			'pepper-grinder' => 'Pepper Grinder',
479
-            'eggplant'      => 'Eggplant',
480
-            'dark-hive'     => 'Dark Hive',
481
-            'cupertino'     => 'Cupertino',
482
-            'south-street'  => 'South Street',
483
-            'blitzer'       => 'Blitzer',
484
-            'humanity'      => 'Humanity',
485
-            'hot-sneaks'    => 'Hot Sneaks',
486
-            'excite-bike'   => 'Excite Bike',
487
-            'vader'         => 'Vader',
488
-            'dot-luv'       => 'Dot Luv',
489
-            'mint-choc'     => 'Mint Choc',
490
-            'black-tie'     => 'Black Tie',
491
-            'trontastic'    => 'Trontastic',
492
-            'swanky-purse'  => 'Swanky Purse',
493
-        );
479
+			'eggplant'      => 'Eggplant',
480
+			'dark-hive'     => 'Dark Hive',
481
+			'cupertino'     => 'Cupertino',
482
+			'south-street'  => 'South Street',
483
+			'blitzer'       => 'Blitzer',
484
+			'humanity'      => 'Humanity',
485
+			'hot-sneaks'    => 'Hot Sneaks',
486
+			'excite-bike'   => 'Excite Bike',
487
+			'vader'         => 'Vader',
488
+			'dot-luv'       => 'Dot Luv',
489
+			'mint-choc'     => 'Mint Choc',
490
+			'black-tie'     => 'Black Tie',
491
+			'trontastic'    => 'Trontastic',
492
+			'swanky-purse'  => 'Swanky Purse',
493
+		);
494 494
 
495 495
 		$themes = apply_filters( 'frm_jquery_themes', $themes );
496
-        return $themes;
497
-    }
496
+		return $themes;
497
+	}
498 498
 
499
-    /**
500
-     * @deprecated 3.02.03
501
-     */
502
-    public static function enqueue_jquery_css() {
499
+	/**
500
+	 * @deprecated 3.02.03
501
+	 */
502
+	public static function enqueue_jquery_css() {
503 503
 		_deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::enqueue_jquery_css' );
504 504
 
505 505
 		$form = self::get_form_for_page();
506 506
 		$theme_css = FrmStylesController::get_style_val( 'theme_css', $form );
507
-        if ( $theme_css != -1 ) {
507
+		if ( $theme_css != -1 ) {
508 508
 			wp_enqueue_style( 'jquery-theme', self::jquery_css_url( $theme_css ), array(), FrmAppHelper::plugin_version() );
509
-        }
510
-    }
509
+		}
510
+	}
511 511
 
512 512
 	/**
513 513
 	 * @deprecated 3.02.03
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 		}
521 521
 
522 522
 		return FrmProStylesController::jquery_css_url( $theme_css );
523
-    }
523
+	}
524 524
 
525 525
 	/**
526 526
 	 * @deprecated 3.02.03
Please login to merge, or discard this patch.
classes/models/FrmReviews.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
 		$show_intervals = array( 50, 200, 500 );
81 81
 		$asked          = $this->review_status['asked'];
82 82
 
83
-		if ( ! isset( $show_intervals[ $asked ] ) ) {
83
+		if ( ! isset( $show_intervals[$asked] ) ) {
84 84
 			return;
85 85
 		}
86 86
 
87 87
 		$entries = FrmEntry::getRecordCount();
88
-		$count   = $show_intervals[ $asked ];
88
+		$count   = $show_intervals[$asked];
89 89
 		$user    = wp_get_current_user();
90 90
 
91 91
 		// Only show review request if the site has collected enough entries
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		$requests = $message->get_messages();
135 135
 		$key      = $this->inbox_key . ( $asked ? $asked : '' );
136 136
 
137
-		if ( isset( $requests[ $key ] ) ) {
137
+		if ( isset( $requests[$key] ) ) {
138 138
 			return;
139 139
 		}
140 140
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 * @return bool
174 174
 	 */
175 175
 	private function has_later_request( $requests, $asked ) {
176
-		return isset( $requests[ $this->inbox_key . ( $asked + 1 ) ] ) || isset( $requests[ $this->inbox_key . ( $asked + 2 ) ] );
176
+		return isset( $requests[$this->inbox_key . ( $asked + 1 )] ) || isset( $requests[$this->inbox_key . ( $asked + 2 )] );
177 177
 	}
178 178
 
179 179
 	/**
Please login to merge, or discard this patch.
classes/models/FrmTableHTMLGenerator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 * @return void
87 87
 	 */
88 88
 	private function init_style_settings( $atts ) {
89
-		$style_settings       = array(
89
+		$style_settings = array(
90 90
 			'border_color' => 'dddddd',
91 91
 			'bg_color'     => 'f7f7f7',
92 92
 			'text_color'   => '444444',
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
 		$this->style_settings = apply_filters( 'frm_show_entry_styles', $style_settings );
98 98
 
99 99
 		foreach ( $this->style_settings as $key => $setting ) {
100
-			if ( isset( $atts[ $key ] ) && $atts[ $key ] !== '' ) {
101
-				$this->style_settings[ $key ] = $atts[ $key ];
100
+			if ( isset( $atts[$key] ) && $atts[$key] !== '' ) {
101
+				$this->style_settings[$key] = $atts[$key];
102 102
 			}
103 103
 
104 104
 			if ( $this->is_color_setting( $key ) ) {
105
-				$this->style_settings[ $key ] = $this->get_color_markup( $this->style_settings[ $key ] );
105
+				$this->style_settings[$key] = $this->get_color_markup( $this->style_settings[$key] );
106 106
 			}
107 107
 		}
108 108
 
Please login to merge, or discard this patch.
classes/models/FrmFormState.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 * @return void
60 60
 	 */
61 61
 	public function set( $key, $value ) {
62
-		$this->state[ $key ] = $value;
62
+		$this->state[$key] = $value;
63 63
 	}
64 64
 
65 65
 	/**
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 	}
76 76
 
77 77
 	public function get( $key, $default ) {
78
-		if ( isset( $this->state[ $key ] ) ) {
79
-			return $this->state[ $key ];
78
+		if ( isset( $this->state[$key] ) ) {
79
+			return $this->state[$key];
80 80
 		}
81 81
 		return $default;
82 82
 	}
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	private function compressed_state() {
172 172
 		$compressed = array();
173 173
 		foreach ( $this->state as $key => $value ) {
174
-			$compressed[ self::compressed_key( $key ) ] = $value;
174
+			$compressed[self::compressed_key( $key )] = $value;
175 175
 		}
176 176
 		return $compressed;
177 177
 	}
Please login to merge, or discard this patch.
classes/helpers/FrmSerializedStringParserHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,12 +65,12 @@
 block discarded – undo
65 65
 				$string->read( 1 );
66 66
 
67 67
 				$val = array();
68
-				for ( $i = 0; $i < $count; $i++ ) {
68
+				for ( $i = 0; $i < $count; $i ++ ) {
69 69
 					$array_key   = $this->do_parse( $string );
70 70
 					$array_value = $this->do_parse( $string );
71 71
 
72 72
 					if ( ! is_array( $array_key ) ) {
73
-						$val[ $array_key ] = $array_value;
73
+						$val[$array_key] = $array_value;
74 74
 					}
75 75
 				}
76 76
 
Please login to merge, or discard this patch.
classes/helpers/FrmOnSubmitHelper.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -240,26 +240,26 @@  discard block
 block discarded – undo
240 240
 	public static function populate_on_submit_data( &$form_options, $action = null, $event = 'create' ) {
241 241
 		$opt = 'update' === $event ? 'edit_' : 'success_';
242 242
 		if ( ! $action || ! is_object( $action ) ) {
243
-			$form_options[ $opt . 'action' ] = self::get_default_action_type();
244
-			$form_options[ $opt . 'msg' ]    = self::get_default_msg();
243
+			$form_options[$opt . 'action'] = self::get_default_action_type();
244
+			$form_options[$opt . 'msg']    = self::get_default_msg();
245 245
 
246 246
 			return;
247 247
 		}
248 248
 
249
-		$form_options[ $opt . 'action' ] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message';
249
+		$form_options[$opt . 'action'] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message';
250 250
 
251
-		switch ( $form_options[ $opt . 'action' ] ) {
251
+		switch ( $form_options[$opt . 'action'] ) {
252 252
 			case 'redirect':
253
-				$form_options[ $opt . 'url' ]    = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : '';
253
+				$form_options[$opt . 'url']    = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : '';
254 254
 				$form_options['open_in_new_tab'] = ! empty( $action->post_content['open_in_new_tab'] );
255 255
 				break;
256 256
 
257 257
 			case 'page':
258
-				$form_options[ $opt . 'page_id' ] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : '';
258
+				$form_options[$opt . 'page_id'] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : '';
259 259
 				break;
260 260
 
261 261
 			default:
262
-				$form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg();
262
+				$form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg();
263 263
 				$form_options['show_form']    = ! empty( $action->post_content['show_form'] );
264 264
 		}
265 265
 	}
@@ -348,20 +348,20 @@  discard block
 block discarded – undo
348 348
 	private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) {
349 349
 		$opt  = 'update' === $event ? 'edit_' : 'success_';
350 350
 		$data = array(
351
-			'success_action' => isset( $form_options[ $opt . 'action' ] ) ? $form_options[ $opt . 'action' ] : self::get_default_action_type(),
351
+			'success_action' => isset( $form_options[$opt . 'action'] ) ? $form_options[$opt . 'action'] : self::get_default_action_type(),
352 352
 		);
353 353
 
354 354
 		switch ( $data['success_action'] ) {
355 355
 			case 'redirect':
356
-				$data['success_url'] = isset( $form_options[ $opt . 'url' ] ) ? $form_options[ $opt . 'url' ] : '';
356
+				$data['success_url'] = isset( $form_options[$opt . 'url'] ) ? $form_options[$opt . 'url'] : '';
357 357
 				break;
358 358
 
359 359
 			case 'page':
360
-				$data['success_page_id'] = isset( $form_options[ $opt . 'page_id' ] ) ? $form_options[ $opt . 'page_id' ] : '';
360
+				$data['success_page_id'] = isset( $form_options[$opt . 'page_id'] ) ? $form_options[$opt . 'page_id'] : '';
361 361
 				break;
362 362
 
363 363
 			default:
364
-				$data['success_msg'] = isset( $form_options[ $opt . 'msg' ] ) ? $form_options[ $opt . 'msg' ] : self::get_default_msg();
364
+				$data['success_msg'] = isset( $form_options[$opt . 'msg'] ) ? $form_options[$opt . 'msg'] : self::get_default_msg();
365 365
 				$data['show_form']   = ! empty( $form_options['show_form'] );
366 366
 		}
367 367
 
Please login to merge, or discard this patch.
classes/controllers/FrmSimpleBlocksController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
 			return false;
77 77
 		}
78 78
 
79
-		return $addons[ $addon_id ];
79
+		return $addons[$addon_id];
80 80
 	}
81 81
 
82 82
 	/**
Please login to merge, or discard this patch.