Completed
Pull Request — master (#1356)
by Stephanie
01:08
created
classes/models/FrmInbox.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 			return;
106 106
 		}
107 107
 
108
-		if ( isset( self::$messages[ $message['key'] ] ) && ! isset( $message['force'] ) ) {
108
+		if ( isset( self::$messages[$message['key']] ) && ! isset( $message['force'] ) ) {
109 109
 			// Don't replace messages unless required.
110 110
 			return;
111 111
 		}
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
 			return;
115 115
 		}
116 116
 
117
-		if ( isset( self::$messages[ $message['key'] ] ) ) {
117
+		if ( isset( self::$messages[$message['key']] ) ) {
118 118
 			// Move up and mark as new.
119
-			unset( self::$messages[ $message['key'] ] );
119
+			unset( self::$messages[$message['key']] );
120 120
 		}
121 121
 
122 122
 		$this->fill_message( $message );
123
-		self::$messages[ $message['key'] ] = $message;
123
+		self::$messages[$message['key']] = $message;
124 124
 
125 125
 		$this->update_list();
126 126
 
@@ -156,11 +156,11 @@  discard block
 block discarded – undo
156 156
 	private function clean_messages() {
157 157
 		$removed = false;
158 158
 		foreach ( self::$messages as $t => $message ) {
159
-			$read      = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' );
160
-			$dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' );
159
+			$read      = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][get_current_user_id()] ) && $message['read'][get_current_user_id()] < strtotime( '-1 month' );
160
+			$dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][get_current_user_id()] ) && $message['dismissed'][get_current_user_id()] < strtotime( '-1 week' );
161 161
 			$expired   = $this->is_expired( $message );
162 162
 			if ( $read || $expired || $dismissed ) {
163
-				unset( self::$messages[ $t ] );
163
+				unset( self::$messages[$t] );
164 164
 				$removed = true;
165 165
 			}
166 166
 		}
@@ -176,11 +176,11 @@  discard block
 block discarded – undo
176 176
 	public function filter_messages( &$messages, $type = 'unread' ) {
177 177
 		$user_id = get_current_user_id();
178 178
 		foreach ( $messages as $k => $message ) {
179
-			$dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][ $user_id ] );
179
+			$dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][$user_id] );
180 180
 			if ( empty( $k ) || $this->is_expired( $message ) || ( $dismissed && 'dismissed' !== $type ) || ( 'dismissed' === $type && ! $dismissed ) ) {
181
-				unset( $messages[ $k ] );
181
+				unset( $messages[$k] );
182 182
 			} elseif ( ! $this->is_for_user( $message ) ) {
183
-				unset( $messages[ $k ] );
183
+				unset( $messages[$k] );
184 184
 			}
185 185
 		}
186 186
 		$messages = apply_filters( 'frm_filter_inbox', $messages );
@@ -226,14 +226,14 @@  discard block
 block discarded – undo
226 226
 	 * @return void
227 227
 	 */
228 228
 	public function mark_read( $key ) {
229
-		if ( ! $key || ! isset( self::$messages[ $key ] ) ) {
229
+		if ( ! $key || ! isset( self::$messages[$key] ) ) {
230 230
 			return;
231 231
 		}
232 232
 
233
-		if ( ! isset( self::$messages[ $key ]['read'] ) ) {
234
-			self::$messages[ $key ]['read'] = array();
233
+		if ( ! isset( self::$messages[$key]['read'] ) ) {
234
+			self::$messages[$key]['read'] = array();
235 235
 		}
236
-		self::$messages[ $key ]['read'][ get_current_user_id() ] = time();
236
+		self::$messages[$key]['read'][get_current_user_id()] = time();
237 237
 
238 238
 		$this->update_list();
239 239
 	}
@@ -246,9 +246,9 @@  discard block
 block discarded – undo
246 246
 	 * @return void
247 247
 	 */
248 248
 	public function mark_unread( $key ) {
249
-		$is_read = isset( self::$messages[ $key ] ) && isset( self::$messages[ $key ]['read'] ) && isset( self::$messages[ $key ]['read'][ get_current_user_id() ] );
249
+		$is_read = isset( self::$messages[$key] ) && isset( self::$messages[$key]['read'] ) && isset( self::$messages[$key]['read'][get_current_user_id()] );
250 250
 		if ( $is_read ) {
251
-			unset( self::$messages[ $key ]['read'][ get_current_user_id() ] );
251
+			unset( self::$messages[$key]['read'][get_current_user_id()] );
252 252
 			$this->update_list();
253 253
 		}
254 254
 	}
@@ -264,14 +264,14 @@  discard block
 block discarded – undo
264 264
 			return;
265 265
 		}
266 266
 
267
-		if ( ! isset( self::$messages[ $key ] ) ) {
267
+		if ( ! isset( self::$messages[$key] ) ) {
268 268
 			return;
269 269
 		}
270 270
 
271
-		if ( ! isset( self::$messages[ $key ]['dismissed'] ) ) {
272
-			self::$messages[ $key ]['dismissed'] = array();
271
+		if ( ! isset( self::$messages[$key]['dismissed'] ) ) {
272
+			self::$messages[$key]['dismissed'] = array();
273 273
 		}
274
-		self::$messages[ $key ]['dismissed'][ get_current_user_id() ] = time();
274
+		self::$messages[$key]['dismissed'][get_current_user_id()] = time();
275 275
 
276 276
 		$this->update_list();
277 277
 	}
@@ -285,11 +285,11 @@  discard block
 block discarded – undo
285 285
 		$user_id = get_current_user_id();
286 286
 		foreach ( self::$messages as $key => $message ) {
287 287
 			if ( ! isset( $message['dismissed'] ) ) {
288
-				self::$messages[ $key ]['dismissed'] = array();
288
+				self::$messages[$key]['dismissed'] = array();
289 289
 			}
290 290
 
291
-			if ( ! isset( $message['dismissed'][ $user_id ] ) ) {
292
-				self::$messages[ $key ]['dismissed'][ $user_id ] = time();
291
+			if ( ! isset( $message['dismissed'][$user_id] ) ) {
292
+				self::$messages[$key]['dismissed'][$user_id] = time();
293 293
 			}
294 294
 		}
295 295
 		$this->update_list();
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
 		$messages = $this->get_messages( 'filter' );
300 300
 		$user_id  = get_current_user_id();
301 301
 		foreach ( $messages as $t => $message ) {
302
-			if ( isset( $message['read'] ) && isset( $message['read'][ $user_id ] ) ) {
303
-				unset( $messages[ $t ] );
302
+			if ( isset( $message['read'] ) && isset( $message['read'][$user_id] ) ) {
303
+				unset( $messages[$t] );
304 304
 			}
305 305
 		}
306 306
 		return $messages;
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
 	 * @return void
329 329
 	 */
330 330
 	public function remove( $key ) {
331
-		if ( isset( self::$messages[ $key ] ) ) {
332
-			unset( self::$messages[ $key ] );
331
+		if ( isset( self::$messages[$key] ) ) {
332
+			unset( self::$messages[$key] );
333 333
 			$this->update_list();
334 334
 		}
335 335
 	}
Please login to merge, or discard this patch.
stripe/helpers/FrmTransLiteAppHelper.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public static function show_status( $status ) {
68 68
 		$statuses = array_merge( self::get_payment_statuses(), self::get_subscription_statuses() );
69
-		return isset( $statuses[ $status ] ) ? $statuses[ $status ] : $status;
69
+		return isset( $statuses[$status] ) ? $statuses[$status] : $status;
70 70
 	}
71 71
 
72 72
 	/**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 */
152 152
 	public static function get_action_setting( $option, $atts ) {
153 153
 		$settings = self::get_action_settings( $atts );
154
-		$value    = isset( $settings[ $option ] ) ? $settings[ $option ] : '';
154
+		$value    = isset( $settings[$option] ) ? $settings[$option] : '';
155 155
 		return $value;
156 156
 	}
157 157
 
@@ -254,8 +254,8 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	public static function get_repeat_label_from_value( $value, $number ) {
256 256
 		$times = self::get_plural_repeat_times( $number );
257
-		if ( isset( $times[ $value ] ) ) {
258
-			$value = $times[ $value ];
257
+		if ( isset( $times[$value] ) ) {
258
+			$value = $times[$value];
259 259
 		}
260 260
 		return $value;
261 261
 	}
@@ -354,11 +354,11 @@  discard block
 block discarded – undo
354 354
 		foreach ( $payments as $payment ) {
355 355
 			list( $amount, $currency ) = self::get_amount_and_currency_from_payment( $payment );
356 356
 
357
-			if ( ! isset( $data[ $currency ] ) ) {
358
-				$data[ $currency ] = 0;
357
+			if ( ! isset( $data[$currency] ) ) {
358
+				$data[$currency] = 0;
359 359
 			}
360 360
 
361
-			$data[ $currency ] += floatval( $amount );
361
+			$data[$currency] += floatval( $amount );
362 362
 		}
363 363
 
364 364
 		return $data;
Please login to merge, or discard this patch.
classes/helpers/FrmListHelper.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
 			return $this->get_pagenum();
236 236
 		}
237 237
 
238
-		if ( isset( $this->_pagination_args[ $key ] ) ) {
239
-			return $this->_pagination_args[ $key ];
238
+		if ( isset( $this->_pagination_args[$key] ) ) {
239
+			return $this->_pagination_args[$key];
240 240
 		}
241 241
 	}
242 242
 
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
 	}
285 285
 
286 286
 	private function hidden_search_inputs( $param_name ) {
287
-		if ( ! empty( $_REQUEST[ $param_name ] ) ) {
288
-			$value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) );
287
+		if ( ! empty( $_REQUEST[$param_name] ) ) {
288
+			$value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) );
289 289
 			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />';
290 290
 		}
291 291
 	}
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
 		echo "<ul class='subsubsub'>\n";
331 331
 		foreach ( $views as $class => $view ) {
332
-			$views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
332
+			$views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
333 333
 		}
334 334
 		echo implode( " |</li>\n", $views ) . "</li>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
335 335
 		echo '</ul>';
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 			'next'  => __( 'Next page', 'formidable' ),
710 710
 		);
711 711
 
712
-		return $labels[ $link ];
712
+		return $labels[$link];
713 713
 	}
714 714
 
715 715
 	private function current_url() {
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
 
803 803
 		// If the primary column doesn't exist fall back to the
804 804
 		// first non-checkbox column.
805
-		if ( ! isset( $columns[ $default ] ) ) {
805
+		if ( ! isset( $columns[$default] ) ) {
806 806
 			$default = self::get_default_primary_column_name();
807 807
 		}
808 808
 
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
 		 */
817 817
 		$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
818 818
 
819
-		if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
819
+		if ( empty( $column ) || ! isset( $columns[$column] ) ) {
820 820
 			$column = $default;
821 821
 		}
822 822
 
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 			// In 4.3, we added a fourth argument for primary column.
839 839
 			$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
840 840
 			foreach ( $this->_column_headers as $key => $value ) {
841
-				$column_headers[ $key ] = $value;
841
+				$column_headers[$key] = $value;
842 842
 			}
843 843
 
844 844
 			return $column_headers;
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
 				$data[1] = false;
872 872
 			}
873 873
 
874
-			$sortable[ $id ] = $data;
874
+			$sortable[$id] = $data;
875 875
 		}
876 876
 
877 877
 		$primary = $this->get_primary_column_name();
@@ -948,8 +948,8 @@  discard block
 block discarded – undo
948 948
 				$class[] = 'column-primary';
949 949
 			}
950 950
 
951
-			if ( isset( $sortable[ $column_key ] ) ) {
952
-				list( $orderby, $desc_first ) = $sortable[ $column_key ];
951
+			if ( isset( $sortable[$column_key] ) ) {
952
+				list( $orderby, $desc_first ) = $sortable[$column_key];
953 953
 
954 954
 				if ( $current_orderby == $orderby ) {
955 955
 					$order   = 'asc' == $current_order ? 'desc' : 'asc';
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 				<?php $this->display_rows_or_placeholder(); ?>
1011 1011
 			</tbody>
1012 1012
 
1013
-			<?php if ( $this->has_min_items( 1 ) && ( ! isset( $args['display-bottom-headers'] ) || false !== $args['display-bottom-headers'] )) { ?>
1013
+			<?php if ( $this->has_min_items( 1 ) && ( ! isset( $args['display-bottom-headers'] ) || false !== $args['display-bottom-headers'] ) ) { ?>
1014 1014
 			<tfoot>
1015 1015
 				<tr>
1016 1016
 					<?php $this->print_column_headers( false ); ?>
Please login to merge, or discard this patch.
classes/controllers/FrmDashboardController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -321,13 +321,13 @@  discard block
 block discarded – undo
321 321
 		if ( $form_id ) {
322 322
 			self::get_columns_for_form( $form_id, $columns );
323 323
 		} else {
324
-			$columns[ $form_id . '_form_id' ] = esc_html__( 'Form', 'formidable' );
325
-			$columns[ $form_id . '_name' ]    = esc_html__( 'Name', 'formidable' );
326
-			$columns[ $form_id . '_user_id' ] = esc_html__( 'Author', 'formidable' );
324
+			$columns[$form_id . '_form_id'] = esc_html__( 'Form', 'formidable' );
325
+			$columns[$form_id . '_name']    = esc_html__( 'Name', 'formidable' );
326
+			$columns[$form_id . '_user_id'] = esc_html__( 'Author', 'formidable' );
327 327
 		}
328 328
 
329
-		$columns[ $form_id . '_created_at' ] = esc_html__( 'Created on', 'formidable' );
330
-		$columns[ $form_id . '_updated_at' ] = esc_html__( 'Updated on', 'formidable' );
329
+		$columns[$form_id . '_created_at'] = esc_html__( 'Created on', 'formidable' );
330
+		$columns[$form_id . '_updated_at'] = esc_html__( 'Updated on', 'formidable' );
331 331
 
332 332
 		return $columns;
333 333
 
@@ -339,8 +339,8 @@  discard block
 block discarded – undo
339 339
 	 * @return boolean
340 340
 	 */
341 341
 	public static function welcome_banner_has_closed() {
342
-		if ( isset( $_COOKIE[ self::$banner_closed_cookie_name ] ) ) {
343
-			list( $cookie_value, $expiration_time ) = explode( '|', sanitize_text_field( wp_unslash( $_COOKIE[ self::$banner_closed_cookie_name ] ) ) );
342
+		if ( isset( $_COOKIE[self::$banner_closed_cookie_name] ) ) {
343
+			list( $cookie_value, $expiration_time ) = explode( '|', sanitize_text_field( wp_unslash( $_COOKIE[self::$banner_closed_cookie_name] ) ) );
344 344
 			if ( 1 === (int) $cookie_value ) {
345 345
 				// Refresh welcome banner cookie if it will expire in less 45 days.
346 346
 				if ( (int) $expiration_time < time() + ( 45 * 24 * 60 * 60 ) ) {
Please login to merge, or discard this patch.
classes/views/dashboard/templates/counters.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,20 +15,26 @@
 block discarded – undo
15 15
 				<h4><?php echo esc_html( $counter['heading'] ); ?></h4>
16 16
 				<?php if ( isset( $counter['cta'] ) && isset( $counter['cta']['display'] ) && true === $counter['cta']['display'] ) : ?>
17 17
 					<a href="<?php echo esc_url( $counter['cta']['link'] ); ?>"><?php echo esc_attr( $counter['cta']['title'] ); ?></a>
18
-				<?php else : ?>
18
+				<?php else {
19
+	: ?>
19 20
 					<?php if ( 'currency' === $counter['type'] ) : ?>
20 21
 						<div class="frm-flex-box frm-gap-md">
21 22
 							<?php foreach ( $counter['items'] as $item ) : ?>
22 23
 								<b>
23
-									<?php echo esc_attr( $item['counter_label']['symbol_left'] ); ?>
24
+									<?php echo esc_attr( $item['counter_label']['symbol_left'] );
25
+}
26
+?>
24 27
 									<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $item['counter']; ?>"><?php echo (int) $item['counter']; ?></span>
25 28
 									<?php echo esc_attr( $item['counter_label']['symbol_right'] ); ?>
26 29
 								</b>
27 30
 							<?php endforeach; ?>
28 31
 						</div>
29
-					<?php else : ?>
32
+					<?php else {
33
+	: ?>
30 34
 						<b>
31
-							<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span>
35
+							<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] );
36
+}
37
+?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span>
32 38
 						</b>
33 39
 					<?php endif; ?>
34 40
 				<?php endif; ?>
Please login to merge, or discard this patch.