Completed
Pull Request — master (#659)
by Burhan
46s
created
classes/models/FrmSettings.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,8 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	private function translate_settings( $settings ) {
59
-		if ( $settings ) { //workaround for W3 total cache conflict
59
+		if ( $settings ) {
60
+//workaround for W3 total cache conflict
60 61
 			return unserialize( serialize( $settings ) );
61 62
 		}
62 63
 
@@ -68,7 +69,8 @@  discard block
 block discarded – undo
68 69
 		}
69 70
 
70 71
 		// If unserializing didn't work
71
-		if ( $settings ) { //workaround for W3 total cache conflict
72
+		if ( $settings ) {
73
+//workaround for W3 total cache conflict
72 74
 			$settings = unserialize( serialize( $settings ) );
73 75
 		} else {
74 76
 			$settings = $this;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 		}
162 162
 
163 163
 		foreach ( $settings as $setting => $default ) {
164
-			if ( isset( $params[ 'frm_' . $setting ] ) ) {
165
-				$this->{$setting} = $params[ 'frm_' . $setting ];
164
+			if ( isset( $params['frm_' . $setting] ) ) {
165
+				$this->{$setting} = $params['frm_' . $setting];
166 166
 			} elseif ( ! isset( $this->{$setting} ) ) {
167 167
 				$this->{$setting} = $default;
168 168
 			}
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 
271 271
 		$checkboxes = array( 'mu_menu', 're_multi', 'use_html', 'jquery_css', 'accordion_js', 'fade_form', 'no_ips', 'tracking', 'admin_bar' );
272 272
 		foreach ( $checkboxes as $set ) {
273
-			$this->$set = isset( $params[ 'frm_' . $set ] ) ? $params[ 'frm_' . $set ] : 0;
273
+			$this->$set = isset( $params['frm_' . $set] ) ? $params['frm_' . $set] : 0;
274 274
 		}
275 275
 	}
276 276
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 		$frm_roles = FrmAppHelper::frm_capabilities();
281 281
 		$roles     = get_editable_roles();
282 282
 		foreach ( $frm_roles as $frm_role => $frm_role_description ) {
283
-			$this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' );
283
+			$this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' );
284 284
 
285 285
 			// Make sure administrators always have permissions
286 286
 			if ( ! in_array( 'administrator', $this->$frm_role ) ) {
Please login to merge, or discard this patch.
classes/models/FrmCreateFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
 
147 147
 		$next_dir = '';
148 148
 		foreach ( $dir_names as $dir ) {
149
-			$next_dir      .= '/' . $dir;
149
+			$next_dir .= '/' . $dir;
150 150
 			$needed_dirs[] = $this->uploads['basedir'] . $next_dir;
151 151
 		}
152 152
 
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
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * @param array $atts
72 72
 	 */
73 73
 	private function init_style_settings( $atts ) {
74
-		$style_settings       = array(
74
+		$style_settings = array(
75 75
 			'border_color' => 'dddddd',
76 76
 			'bg_color'     => 'f7f7f7',
77 77
 			'text_color'   => '444444',
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
 		$this->style_settings = apply_filters( 'frm_show_entry_styles', $style_settings );
83 83
 
84 84
 		foreach ( $this->style_settings as $key => $setting ) {
85
-			if ( isset( $atts[ $key ] ) && $atts[ $key ] !== '' ) {
86
-				$this->style_settings[ $key ] = $atts[ $key ];
85
+			if ( isset( $atts[$key] ) && $atts[$key] !== '' ) {
86
+				$this->style_settings[$key] = $atts[$key];
87 87
 			}
88 88
 
89 89
 			if ( $this->is_color_setting( $key ) ) {
90
-				$this->style_settings[ $key ] = $this->get_color_markup( $this->style_settings[ $key ] );
90
+				$this->style_settings[$key] = $this->get_color_markup( $this->style_settings[$key] );
91 91
 			}
92 92
 		}
93 93
 
Please login to merge, or discard this patch.
classes/models/FrmFieldValue.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,8 @@
 block discarded – undo
59 59
 	protected function init_saved_value( $entry ) {
60 60
 		if ( $this->field->type === 'html' ) {
61 61
 			$this->saved_value = $this->field->description;
62
-		} elseif ( isset( $entry->metas[ $this->field->id ] ) ) {
63
-			$this->saved_value = $entry->metas[ $this->field->id ];
62
+		} elseif ( isset( $entry->metas[$this->field->id] ) ) {
63
+			$this->saved_value = $entry->metas[$this->field->id];
64 64
 		} else {
65 65
 			$this->saved_value = '';
66 66
 		}
Please login to merge, or discard this patch.
classes/views/frm-form-actions/_action_inside.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 	$event_labels = FrmFormAction::trigger_labels();
37 37
 	foreach ( $action_control->action_options['event'] as $event ) {
38 38
 		?>
39
-		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event ); ?></option>
39
+		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[$event] ) ? $event_labels[$event] : $event ); ?></option>
40 40
 <?php } ?>
41 41
 		</select>
42 42
 	</p>
Please login to merge, or discard this patch.
classes/views/frm-form-actions/default_actions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 class FrmDefPostAction extends FrmFormAction {
4 4
 	public function __construct() {
5 5
 		$action_ops = FrmFormAction::default_action_opts( 'frm_wordpress_icon frm-inverse frm_show_upgrade' );
6
-		$action_ops['color']   = 'rgb(0,160,210)';
6
+		$action_ops['color'] = 'rgb(0,160,210)';
7 7
 
8 8
 		parent::__construct( 'wppost', __( 'Create Post', 'formidable' ), $action_ops );
9 9
 	}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 class FrmDefMlcmpAction extends FrmFormAction {
43 43
 	public function __construct() {
44 44
 		$action_ops = FrmFormAction::default_action_opts( 'frm_mailchimp_icon frm_show_upgrade frm-inverse' );
45
-		$action_ops['color']   = 'var(--dark-grey)';
45
+		$action_ops['color'] = 'var(--dark-grey)';
46 46
 
47 47
 		parent::__construct( 'mailchimp', 'MailChimp', $action_ops );
48 48
 	}
Please login to merge, or discard this patch.
classes/helpers/FrmTipsHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	}
297 297
 
298 298
 	public static function get_banner_tip() {
299
-		$tips       = array(
299
+		$tips = array(
300 300
 			array(
301 301
 				'link' => array(
302 302
 					'medium'  => 'banner',
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 			),
324 324
 		);
325 325
 		$random     = rand( 0, count( $tips ) - 1 );
326
-		$tip        = $tips[ $random ];
326
+		$tip        = $tips[$random];
327 327
 		$tip['num'] = $random;
328 328
 
329 329
 		return $tip;
@@ -332,6 +332,6 @@  discard block
 block discarded – undo
332 332
 	public static function get_random_tip( $tips ) {
333 333
 		$random = rand( 0, count( $tips ) - 1 );
334 334
 
335
-		return $tips[ $random ];
335
+		return $tips[$random];
336 336
 	}
337 337
 }
Please login to merge, or discard this patch.
classes/helpers/FrmFormsListHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 		$page     = $this->get_pagenum();
19 19
 		$per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' );
20 20
 
21
-		$mode    = self::get_param(
21
+		$mode = self::get_param(
22 22
 			array(
23 23
 				'param'   => 'mode',
24 24
 				'default' => 'list',
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 				'default' => 'name',
31 31
 			)
32 32
 		);
33
-		$order   = self::get_param(
33
+		$order = self::get_param(
34 34
 			array(
35 35
 				'param'   => 'order',
36 36
 				'default' => 'ASC',
37 37
 			)
38 38
 		);
39
-		$start   = self::get_param(
39
+		$start = self::get_param(
40 40
 			array(
41 41
 				'param'   => 'start',
42 42
 				'default' => ( $page - 1 ) * $per_page,
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
 			if ( $counts->{$status} || 'draft' !== $status ) {
179 179
 				/* translators: %1$s: Status, %2$s: Number of items */
180
-				$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>';
180
+				$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>';
181 181
 			}
182 182
 
183 183
 			unset( $status, $name );
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	private function get_actions( &$actions, $item, $edit_link ) {
283 283
 		$new_actions = FrmFormsHelper::get_action_links( $item->id, $item );
284 284
 		foreach ( $new_actions as $link => $action ) {
285
-			$new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' );
285
+			$new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' );
286 286
 		}
287 287
 
288 288
 		if ( 'trash' == $this->status ) {
Please login to merge, or discard this patch.
classes/helpers/FrmShortcodeHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 		}
62 62
 
63 63
 		$with_tags = $args['conditional_check'] ? 3 : 2;
64
-		if ( ! empty( $shortcodes[ $with_tags ][ $short_key ] ) ) {
65
-			$tag  = str_replace( '[' . $prefix, '', $shortcodes[0][ $short_key ] );
64
+		if ( ! empty( $shortcodes[$with_tags][$short_key] ) ) {
65
+			$tag  = str_replace( '[' . $prefix, '', $shortcodes[0][$short_key] );
66 66
 			$tag  = str_replace( ']', '', $tag );
67 67
 			$tag  = str_replace( chr( 194 ) . chr( 160 ), ' ', $tag );
68 68
 			$tags = preg_split( '/\s+/', $tag, 2 );
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 				$tag = $tags[0];
71 71
 			}
72 72
 		} else {
73
-			$tag = $shortcodes[ $with_tags - 1 ][ $short_key ];
73
+			$tag = $shortcodes[$with_tags - 1][$short_key];
74 74
 		}
75 75
 
76 76
 		return $tag;
Please login to merge, or discard this patch.