Completed
Push — develop ( 61b96c...a55ed0 )
by Zack
16:44 queued 13:30
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:12-f:5-f: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:12-f:5-f: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 );
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 
266 266
 		$blacklist = get_option( self::BLACKLIST_OPTION_NAME, array() );
267 267
 
268
-		$updated_list = array_diff( $blacklist, (array) $form_ids );
268
+		$updated_list = array_diff( $blacklist, (array)$form_ids );
269 269
 
270 270
 		do_action( 'gravityview_log_debug', 'GravityView_Cache[blacklist_remove] Removing form IDs from cache blacklist', array(
271 271
 			'$form_ids'     => $form_ids,
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 			return false;
299 299
 		}
300 300
 
301
-		foreach ( (array) $form_ids as $form_id ) {
301
+		foreach ( (array)$form_ids as $form_id ) {
302 302
 
303 303
 			if ( in_array( $form_id, $blacklist ) ) {
304 304
 
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 			 * @filter `gravityview_cache_time_{$filter_name}` Modify the cache time for a type of cache
371 371
 			 * @param int $time_in_seconds Default: `DAY_IN_SECONDS`
372 372
 			 */
373
-			$cache_time = (int) apply_filters( 'gravityview_cache_time_' . $filter_name, DAY_IN_SECONDS );
373
+			$cache_time = (int)apply_filters( 'gravityview_cache_time_' . $filter_name, DAY_IN_SECONDS );
374 374
 
375 375
 			do_action( 'gravityview_log_debug', 'GravityView_Cache[set] Setting cache with transient key ' . $this->key . ' for ' . $cache_time . ' seconds' );
376 376
 
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 			return;
407 407
 		}
408 408
 
409
-		foreach ( (array) $form_ids as $form_id ) {
409
+		foreach ( (array)$form_ids as $form_id ) {
410 410
 
411 411
 			$key = '_transient_gv-cache-';
412 412
 
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 
526 526
 		if ( GVCommon::has_cap( 'edit_gravityviews' ) ) {
527 527
 
528
-			if ( isset( $_GET['cache'] ) || isset( $_GET['nocache'] ) ) {
528
+			if ( isset( $_GET[ 'cache' ] ) || isset( $_GET[ 'nocache' ] ) ) {
529 529
 
530 530
 				do_action( 'gravityview_log_debug', 'GravityView_Cache[use_cache] Not using cache: ?cache or ?nocache is in the URL' );
531 531
 
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 		 */
553 553
 		$use_cache = apply_filters( 'gravityview_use_cache', $use_cache, $this );
554 554
 
555
-		return (boolean) $use_cache;
555
+		return (boolean)$use_cache;
556 556
 	}
557 557
 
558 558
 }
Please login to merge, or discard this patch.
includes/class-gravityview-entry-list.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		$this->link_format = $link_format;
84 84
 		$this->after_link = $after_link;
85 85
 		$this->context = $context;
86
-		$this->empty_message = function_exists( 'gv_no_results' ) ? gv_no_results() : __('No entries match your request.', 'gravityview');
86
+		$this->empty_message = function_exists( 'gv_no_results' ) ? gv_no_results() : __( 'No entries match your request.', 'gravityview' );
87 87
 	}
88 88
 
89 89
 	/**
@@ -169,25 +169,25 @@  discard block
 block discarded – undo
169 169
 	public function get_output() {
170 170
 
171 171
 		// No Entries
172
-		if( empty( $this->entries ) ) {
173
-			return '<div class="gv-no-results">'.$this->empty_message.'</div>';
172
+		if ( empty( $this->entries ) ) {
173
+			return '<div class="gv-no-results">' . $this->empty_message . '</div>';
174 174
 		}
175 175
 
176 176
 		$output = '';
177 177
 		$current_entry = GravityView_View::getInstance()->getCurrentEntry();
178 178
 
179
-		$output .= '<'. $this->wrapper_tag .'>';
179
+		$output .= '<' . $this->wrapper_tag . '>';
180 180
 
181
-		foreach( $this->entries as $entry ) {
181
+		foreach ( $this->entries as $entry ) {
182 182
 
183
-			if( $this->skip_entry( $entry, $current_entry ) ) {
183
+			if ( $this->skip_entry( $entry, $current_entry ) ) {
184 184
 				continue;
185 185
 			}
186 186
 
187 187
 			$output .= $this->get_item_output( $entry );
188 188
 		}
189 189
 
190
-		$output .= '</'. $this->wrapper_tag .'>';
190
+		$output .= '</' . $this->wrapper_tag . '>';
191 191
 
192 192
 		/**
193 193
 		 * @filter `gravityview/widget/recent-entries/output` Modify the HTML of the Recent Entries widget output
@@ -210,15 +210,15 @@  discard block
 block discarded – undo
210 210
 	private function skip_entry( $entry, $current_entry ) {
211 211
 
212 212
 		// If skip entry is off, or there's no current entry, return false
213
-		if( empty( $this->skip_current_entry ) || empty( $current_entry ) ) {
213
+		if ( empty( $this->skip_current_entry ) || empty( $current_entry ) ) {
214 214
 			return false;
215 215
 		}
216 216
 
217 217
 		// If in Single or Edit mode, $current_entry will be an array.
218
-		$current_entry_id = is_array( $current_entry ) ? $current_entry['id'] : $current_entry;
218
+		$current_entry_id = is_array( $current_entry ) ? $current_entry[ 'id' ] : $current_entry;
219 219
 
220 220
 		// If the entry ID matches the current entry, yes: skip
221
-		if( $entry['id'] === $current_entry_id ) {
221
+		if ( $entry[ 'id' ] === $current_entry_id ) {
222 222
 			return true;
223 223
 		}
224 224
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 
246 246
 		$item_output = gravityview_get_link( $link, $this->link_format );
247 247
 
248
-		if( !empty( $this->after_link ) ) {
248
+		if ( ! empty( $this->after_link ) ) {
249 249
 
250 250
 			/**
251 251
 			 * @filter `gravityview/entry-list/after-link` Modify the content displayed after the entry link in an entry list
@@ -254,14 +254,14 @@  discard block
 block discarded – undo
254 254
 			 * @param array $entry Gravity Forms entry array
255 255
 			 * @param GravityView_Entry_List $this The current class instance
256 256
 			 */
257
-			$after_link = apply_filters( 'gravityview/entry-list/after-link', '<div>'.$this->after_link.'</div>', $entry, $this );
257
+			$after_link = apply_filters( 'gravityview/entry-list/after-link', '<div>' . $this->after_link . '</div>', $entry, $this );
258 258
 
259 259
 			$item_output .= $after_link;
260 260
 		}
261 261
 
262 262
 		$item_output = GravityView_API::replace_variables( $item_output, $this->form, $entry );
263 263
 
264
-		$item_output = '<'. $this->item_tag .'>'. $item_output .'</'. $this->item_tag .'>';
264
+		$item_output = '<' . $this->item_tag . '>' . $item_output . '</' . $this->item_tag . '>';
265 265
 
266 266
 		/**
267 267
 		 * @filter `gravityview/entry-list/item` Modify each item's output in an entry list
Please login to merge, or discard this patch.
includes/class-gravityview-uninstall.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
 		$tables = array();
43 43
 
44 44
 		if ( method_exists( 'GFFormsModel', 'get_entry_meta_table_name' ) ) {
45
-			$tables []= GFFormsModel::get_entry_meta_table_name();
45
+			$tables [ ] = GFFormsModel::get_entry_meta_table_name();
46 46
 		} else if ( method_exists( 'GFFormsModel', 'get_lead_meta_table_name' ) ) {
47
-			$tables []= GFFormsModel::get_lead_meta_table_name();
47
+			$tables [ ] = GFFormsModel::get_lead_meta_table_name();
48 48
 		} else {
49
-			$tables []= $wpdb->prefix . 'rg_lead_meta';
50
-			$tables []= $wpdb->prefix . 'gf_entry_meta';
49
+			$tables [ ] = $wpdb->prefix . 'rg_lead_meta';
50
+			$tables [ ] = $wpdb->prefix . 'gf_entry_meta';
51 51
 		}
52 52
 
53 53
 		$suppress = $wpdb->suppress_errors();
@@ -74,16 +74,16 @@  discard block
 block discarded – undo
74 74
 		$tables = array();
75 75
 
76 76
 		if ( method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) {
77
-			$tables []= GFFormsModel::get_entry_notes_table_name();
77
+			$tables [ ] = GFFormsModel::get_entry_notes_table_name();
78 78
 		} else if ( method_exists( 'GFFormsModel', 'get_lead_notes_table_name' ) ) {
79
-			$tables []= GFFormsModel::get_lead_notes_table_name();
79
+			$tables [ ] = GFFormsModel::get_lead_notes_table_name();
80 80
 		} else {
81
-			$tables []= $wpdb->prefix . 'rg_lead_notes';
82
-			$tables []= $wpdb->prefix . 'gf_entry_notes';
81
+			$tables [ ] = $wpdb->prefix . 'rg_lead_notes';
82
+			$tables [ ] = $wpdb->prefix . 'gf_entry_notes';
83 83
 		}
84 84
 
85
-		$disapproved = __('Disapproved the Entry for GravityView', 'gravityview');
86
-		$approved = __('Approved the Entry for GravityView', 'gravityview');
85
+		$disapproved = __( 'Disapproved the Entry for GravityView', 'gravityview' );
86
+		$approved = __( 'Approved the Entry for GravityView', 'gravityview' );
87 87
 
88 88
 		$suppress = $wpdb->suppress_errors();
89 89
 		foreach ( $tables as $notes_table ) {
Please login to merge, or discard this patch.
plugin-and-theme-hooks/class-gravityview-plugin-hooks-elegant-themes.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
 		}
80 80
 
81 81
 		$sidebars_widgets = wp_get_sidebars_widgets();
82
-		if ( empty( $sidebars_widgets[ $matches[1] ] ) ) {
82
+		if ( empty( $sidebars_widgets[ $matches[ 1 ] ] ) ) {
83 83
 			return $shortcodes;
84 84
 		}
85 85
 
86
-		foreach ( $sidebars_widgets[ $matches[1] ] as $widgets ) {
86
+		foreach ( $sidebars_widgets[ $matches[ 1 ] ] as $widgets ) {
87 87
 			if (
88 88
 				/**
89 89
 				 * Blacklisted widgets.
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 				strpos( $widgets, 'gv_recent_entries' ) === 0
93 93
 			) {
94 94
 
95
-					$shortcodes []= 'et_pb_sidebar';
95
+					$shortcodes [ ] = 'et_pb_sidebar';
96 96
 					break;
97 97
 			}
98 98
 		}
Please login to merge, or discard this patch.