Completed
Push — develop ( 1abb91...5dbe94 )
by Zack
06:22
created
includes/class-cache.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 		/**
82 82
 		 * @see RGFormsModel::update_lead_property() Trigger when any entry property changes
83 83
 		 */
84
-		foreach( $this->lead_db_columns as $column ) {
84
+		foreach ( $this->lead_db_columns as $column ) {
85 85
 			add_action( 'gform_update_' . $column, array( $this, 'entry_status_changed' ), 10, 3 );
86 86
 		}
87 87
 
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 			return;
115 115
 		}
116 116
 
117
-		do_action( 'gravityview_log_debug', __METHOD__ . ' adding form ' . $entry['form_id'] . ' to blacklist because entry #' . $lead_id . ' was deleted', array( 'value' => $property_value, 'previous' => $previous_value ) );
117
+		do_action( 'gravityview_log_debug', __METHOD__ . ' adding form ' . $entry[ 'form_id' ] . ' to blacklist because entry #' . $lead_id . ' was deleted', array( 'value' => $property_value, 'previous' => $previous_value ) );
118 118
 
119
-		$this->blacklist_add( $entry['form_id'] );
119
+		$this->blacklist_add( $entry[ 'form_id' ] );
120 120
 	}
121 121
 
122 122
 	/**
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	public function entry_updated( $form, $lead_id ) {
131 131
 
132
-		do_action( 'gravityview_log_debug', 'GravityView_Cache[entry_updated] adding form ' . $form['id'] . ' to blacklist because entry #' . $lead_id . ' was updated' );
132
+		do_action( 'gravityview_log_debug', 'GravityView_Cache[entry_updated] adding form ' . $form[ 'id' ] . ' to blacklist because entry #' . $lead_id . ' was updated' );
133 133
 
134
-		$this->blacklist_add( $form['id'] );
134
+		$this->blacklist_add( $form[ 'id' ] );
135 135
 	}
136 136
 
137 137
 	/**
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
 	 */
147 147
 	public function entry_created( $entry, $form ) {
148 148
 
149
-		do_action( 'gravityview_log_debug', 'GravityView_Cache[entry_created] adding form ' . $form['id'] . ' to blacklist because entry #' . $entry['id'] . ' was created' );
149
+		do_action( 'gravityview_log_debug', 'GravityView_Cache[entry_created] adding form ' . $form[ 'id' ] . ' to blacklist because entry #' . $entry[ 'id' ] . ' was created' );
150 150
 
151
-		$this->blacklist_add( $form['id'] );
151
+		$this->blacklist_add( $form[ 'id' ] );
152 152
 	}
153 153
 
154 154
 	/**
@@ -164,9 +164,9 @@  discard block
 block discarded – undo
164 164
 			return;
165 165
 		}
166 166
 
167
-		do_action( 'gravityview_log_debug', 'GravityView_Cache[entry_added] adding form ' . $form['id'] . ' to blacklist because entry #' . $entry['id'] . ' was added' );
167
+		do_action( 'gravityview_log_debug', 'GravityView_Cache[entry_added] adding form ' . $form[ 'id' ] . ' to blacklist because entry #' . $entry[ 'id' ] . ' was added' );
168 168
 
169
-		$this->blacklist_add( $form['id'] );
169
+		$this->blacklist_add( $form[ 'id' ] );
170 170
 	}
171 171
 
172 172
 	/**
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		// Normally just one form, but supports multiple forms
186 186
 		//
187 187
 		// Array of IDs 12, 5, 14 would result in `f-12f-5f-14`
188
-		$forms = 'f:' . implode( '&f:', (array) $form_ids );
188
+		$forms = 'f:' . implode( '&f:', (array)$form_ids );
189 189
 
190 190
 		// Prefix for transient keys
191 191
 		// Now the prefix would be: `gv-cache-f-12f-5f-14`
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 		) );
243 243
 
244 244
 		// Add the passed form IDs
245
-		$blacklist = array_merge( (array) $blacklist, $form_ids );
245
+		$blacklist = array_merge( (array)$blacklist, $form_ids );
246 246
 
247 247
 		// Don't duplicate
248 248
 		$blacklist = array_unique( $blacklist );
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 
263 263
 		$blacklist = get_option( self::BLACKLIST_OPTION_NAME, array() );
264 264
 
265
-		$updated_list = array_diff( $blacklist, (array) $form_ids );
265
+		$updated_list = array_diff( $blacklist, (array)$form_ids );
266 266
 
267 267
 		do_action( 'gravityview_log_debug', 'GravityView_Cache[blacklist_remove] Removing form IDs from cache blacklist', array(
268 268
 			'$form_ids'     => $form_ids,
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 			return false;
296 296
 		}
297 297
 
298
-		foreach ( (array) $form_ids as $form_id ) {
298
+		foreach ( (array)$form_ids as $form_id ) {
299 299
 
300 300
 			if ( in_array( $form_id, $blacklist ) ) {
301 301
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 			 * @filter `gravityview_cache_time_{$filter_name}` Modify the cache time for a type of cache
368 368
 			 * @param int $time_in_seconds Default: `DAY_IN_SECONDS`
369 369
 			 */
370
-			$cache_time = (int) apply_filters( 'gravityview_cache_time_' . $filter_name, DAY_IN_SECONDS );
370
+			$cache_time = (int)apply_filters( 'gravityview_cache_time_' . $filter_name, DAY_IN_SECONDS );
371 371
 
372 372
 			do_action( 'gravityview_log_debug', 'GravityView_Cache[set] Setting cache with transient key ' . $this->key . ' for ' . $cache_time . ' seconds' );
373 373
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 			return;
404 404
 		}
405 405
 
406
-		foreach ( (array) $form_ids as $form_id ) {
406
+		foreach ( (array)$form_ids as $form_id ) {
407 407
 
408 408
 			$key = $this->get_cache_key_prefix( $form_id );
409 409
 
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 
518 518
 		if ( GVCommon::has_cap( 'edit_gravityviews' ) ) {
519 519
 
520
-			if ( isset( $_GET['cache'] ) || isset( $_GET['nocache'] ) ) {
520
+			if ( isset( $_GET[ 'cache' ] ) || isset( $_GET[ 'nocache' ] ) ) {
521 521
 
522 522
 				do_action( 'gravityview_log_debug', 'GravityView_Cache[use_cache] Not using cache: ?cache or ?nocache is in the URL' );
523 523
 
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 		 */
547 547
 		$use_cache = apply_filters( 'gravityview_use_cache', $use_cache, $this );
548 548
 
549
-		return (boolean) $use_cache;
549
+		return (boolean)$use_cache;
550 550
 	}
551 551
 
552 552
 }
Please login to merge, or discard this patch.