Completed
Push — develop ( b6d173...c20624 )
by
unknown
18:28
created
future/lib/class-gamajo-template-loader.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 		public function set_template_data( $data, $var_name = 'data' ) {
132 132
 			global $wp_query;
133 133
 
134
-			$wp_query->query_vars[ $var_name ] = (object) $data;
134
+			$wp_query->query_vars[ $var_name ] = (object)$data;
135 135
 
136 136
 			// Add $var_name to custom variable store if not default value.
137 137
 			if ( 'data' !== $var_name ) {
138
-				$this->template_data_var_names[] = $var_name;
138
+				$this->template_data_var_names[ ] = $var_name;
139 139
 			}
140 140
 
141 141
 			return $this;
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 		protected function get_template_file_names( $slug, $name ) {
179 179
 			$templates = array();
180 180
 			if ( isset( $name ) ) {
181
-				$templates[] = $slug . '-' . $name . '.php';
181
+				$templates[ ] = $slug . '-' . $name . '.php';
182 182
 			}
183
-			$templates[] = $slug . '.php';
183
+			$templates[ ] = $slug . '.php';
184 184
 
185 185
 			/**
186 186
 			 * Allow template choices to be filtered.
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 				$located = false;
227 227
 
228 228
 				// Remove empty entries.
229
-				$template_names = array_filter( (array) $template_names );
229
+				$template_names = array_filter( (array)$template_names );
230 230
 				$template_paths = $this->get_template_paths();
231 231
 
232 232
 				// Try to find a template file.
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 				}
247 247
 
248 248
 				// The templates weren't found; don't look this up again.
249
-				if( ! $located ) {
249
+				if ( ! $located ) {
250 250
 					$template_path_cache[ $this->filter_prefix ][ $cache_key ] = false;
251 251
 				}
252 252
 			}
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 
286 286
 			// Only add this conditionally, so non-child themes don't redundantly check active theme twice.
287 287
 			if ( get_stylesheet_directory() !== get_template_directory() ) {
288
-				$file_paths[1] = trailingslashit( get_stylesheet_directory() ) . $theme_directory;
288
+				$file_paths[ 1 ] = trailingslashit( get_stylesheet_directory() ) . $theme_directory;
289 289
 			}
290 290
 
291 291
 			/**
Please login to merge, or discard this patch.
trustedlogin/trustedlogin/client/src/SecurityChecks.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -83,11 +83,11 @@  discard block
 block discarded – undo
83 83
 
84 84
 		$user_identifier = $passed_user_identifier;
85 85
 
86
-		if ( $this->in_lockdown() ){
86
+		if ( $this->in_lockdown() ) {
87 87
 
88 88
 			$this->logging->log( 'Site is in lockdown mode, aborting login.', __METHOD__, 'error' );
89 89
 
90
-			return new WP_Error( 'in_lockdown', __( 'TrustedLogin temporarily disabled.' , 'gravityview') );
90
+			return new WP_Error( 'in_lockdown', __( 'TrustedLogin temporarily disabled.', 'gravityview' ) );
91 91
 		}
92 92
 
93 93
 		// When passed in the endpoint URL, the unique ID will be the raw value, not the hash.
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 		$approved = $this->check_approved_identifier( $secret_id );
112 112
 
113 113
 		// Don't lock-down the site, since there could have been errors related to remote validation
114
-		if ( is_wp_error( $approved ) ){
114
+		if ( is_wp_error( $approved ) ) {
115 115
 
116 116
 			$this->logging->log(
117 117
 				sprintf(
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 				'notice'
153 153
 			);
154 154
 
155
-			return new WP_Error( 'brute_force_detected', 'Login aborted due to potential brute force detection.');
155
+			return new WP_Error( 'brute_force_detected', 'Login aborted due to potential brute force detection.' );
156 156
 		}
157 157
 
158 158
 		return true;
@@ -165,12 +165,12 @@  discard block
 block discarded – undo
165 165
 	 */
166 166
 	private function maybe_add_used_accesskey( $user_identifier = '' ) {
167 167
 
168
-		$used_accesskeys = (array) get_site_transient( $this->used_accesskey_transient );
168
+		$used_accesskeys = (array)get_site_transient( $this->used_accesskey_transient );
169 169
 
170 170
 		// This is a new access key
171 171
 		if ( ! in_array( $user_identifier, $used_accesskeys, true ) ) {
172 172
 
173
-			$used_accesskeys[] = $user_identifier;
173
+			$used_accesskeys[ ] = $user_identifier;
174 174
 
175 175
 			$transient_set = set_site_transient( $this->used_accesskey_transient, $used_accesskeys, self::ACCESSKEY_LIMIT_EXPIRY );
176 176
 
@@ -190,19 +190,19 @@  discard block
 block discarded – undo
190 190
 	 */
191 191
 	private function get_ip() {
192 192
 
193
-		if ( ! isset( $_SERVER['REMOTE_ADDR'] ) ) {
193
+		if ( ! isset( $_SERVER[ 'REMOTE_ADDR' ] ) ) {
194 194
 			return null;
195 195
 		}
196 196
 
197
-		$ip = wp_unslash( $_SERVER['REMOTE_ADDR'] );
197
+		$ip = wp_unslash( $_SERVER[ 'REMOTE_ADDR' ] );
198 198
 
199 199
 		$ip = trim( $ip );
200 200
 
201
-		if ( ! defined('TL_DOING_TESTS') ) {
201
+		if ( ! defined( 'TL_DOING_TESTS' ) ) {
202 202
 			$ip = filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE );
203 203
 		}
204 204
 
205
-		return (string) $ip;
205
+		return (string)$ip;
206 206
 	}
207 207
 
208 208
 	/**
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 		 */
227 227
 		$body = array(
228 228
 			'timestamp'  => time(),
229
-			'user_agent' => isset( $_SERVER['HTTP_USER_AGENT'] ) ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 255 ) : '',
229
+			'user_agent' => isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) ? substr( $_SERVER[ 'HTTP_USER_AGENT' ], 0, 255 ) : '',
230 230
 			'user_ip'    => $this->get_ip(),
231 231
 			'site_url'   => get_site_url(),
232 232
 		);
@@ -265,13 +265,13 @@  discard block
 block discarded – undo
265 265
 		 */
266 266
 		$body = array(
267 267
 			'timestamp'  => time(),
268
-			'user_agent' => isset( $_SERVER['HTTP_USER_AGENT'] ) ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 255 ) : '',
268
+			'user_agent' => isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) ? substr( $_SERVER[ 'HTTP_USER_AGENT' ], 0, 255 ) : '',
269 269
 			'user_ip'	 => $this->get_ip(),
270 270
 			'site_url'	 => get_site_url(),
271 271
 		);
272 272
 
273 273
 		$remote = new Remote( $this->config, $this->logging );
274
-		$api_response = $remote->send( self::BRUTE_FORCE_ENDPOINT , $body, 'POST' );
274
+		$api_response = $remote->send( self::BRUTE_FORCE_ENDPOINT, $body, 'POST' );
275 275
 
276 276
 		if ( is_wp_error( $api_response ) ) {
277 277
 			return $api_response;
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 
303 303
 		$notified = $this->report_lockdown();
304 304
 
305
-		if ( is_wp_error( $notified ) ){
305
+		if ( is_wp_error( $notified ) ) {
306 306
 			$this->logging->log( sprintf( 'Could not notify TrustedLogin (%s)', $notified->get_error_message() ), __METHOD__, 'error' );
307 307
 		}
308 308
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 	 *
356 356
 	 * @return int|false Int: in lockdown. The value returned is the timestamp when lockdown ends. False: not in lockdown, or overridden by a constant.
357 357
 	 */
358
-	public function in_lockdown(){
358
+	public function in_lockdown() {
359 359
 
360 360
 		if ( $this->in_local_development() ) {
361 361
 			return false;
Please login to merge, or discard this patch.
includes/class-admin.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@  discard block
 block discarded – undo
4 4
 
5 5
 	function __construct() {
6 6
 
7
-		if( ! is_admin() ) { return; }
7
+		if ( ! is_admin() ) { return; }
8 8
 
9 9
 		// If Gravity Forms isn't active or compatibile, stop loading
10
-		if( false === gravityview()->plugin->is_compatible() ) {
10
+		if ( false === gravityview()->plugin->is_compatible() ) {
11 11
 			return;
12 12
 		}
13 13
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
49 49
 		add_filter( 'bulk_post_updated_messages', array( $this, 'post_updated_messages' ) );
50 50
 
51
-		add_filter( 'plugin_action_links_'. plugin_basename( GRAVITYVIEW_FILE ) , array( $this, 'plugin_action_links' ) );
51
+		add_filter( 'plugin_action_links_' . plugin_basename( GRAVITYVIEW_FILE ), array( $this, 'plugin_action_links' ) );
52 52
 
53 53
 		add_action( 'plugins_loaded', array( $this, 'backend_actions' ), 100 );
54 54
 
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public static function no_views_text() {
66 66
 
67
-		if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) {
67
+		if ( isset( $_REQUEST[ 'post_status' ] ) && 'trash' === $_REQUEST[ 'post_status' ] ) {
68 68
 			return esc_html__( 'No Views found in Trash', 'gravityview' );
69
-		} elseif( ! empty( $_GET['s'] ) ) {
69
+		} elseif ( ! empty( $_GET[ 's' ] ) ) {
70 70
 			return esc_html__( 'No Views found.', 'gravityview' );
71 71
 		}
72 72
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 			$error .= ' ' . esc_html__( 'or select another form.', 'gravityview' );
111 111
 		}
112 112
 
113
-		if( $error ) {
113
+		if ( $error ) {
114 114
 			?>
115 115
 			<div class="wp-dialog notice-warning inline error wp-clearfix">
116 116
 				<?php echo gravityview_get_floaty(); ?>
@@ -130,24 +130,24 @@  discard block
 block discarded – undo
130 130
 	public function backend_actions() {
131 131
 
132 132
 		/** @define "GRAVITYVIEW_DIR" "../" */
133
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.field.type.php' );
134
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.render.settings.php' );
135
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-item.php' );
136
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-field.php' );
137
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-widget.php' );
138
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-views.php' );
139
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-welcome.php' );
140
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-installer.php' );
141
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-add-shortcode.php' );
142
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-approve-entries.php' );
143
-		include_once( GRAVITYVIEW_DIR .'includes/class-gravityview-bulk-actions.php' );
133
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.field.type.php' );
134
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.render.settings.php' );
135
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-item.php' );
136
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-field.php' );
137
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-widget.php' );
138
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-views.php' );
139
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-welcome.php' );
140
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-installer.php' );
141
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-add-shortcode.php' );
142
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-approve-entries.php' );
143
+		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-bulk-actions.php' );
144 144
 
145 145
 		/**
146 146
 		 * @action `gravityview_include_backend_actions` Triggered after all GravityView admin files are loaded
147 147
 		 *
148 148
 		 * Nice place to insert extensions' backend stuff
149 149
 		 */
150
-		do_action('gravityview_include_backend_actions');
150
+		do_action( 'gravityview_include_backend_actions' );
151 151
 	}
152 152
 
153 153
 	/**
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
 
163 163
 		$actions = array();
164 164
 
165
-		if( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
166
-			$actions[] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
165
+		if ( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
166
+			$actions[ ] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
167 167
 		}
168 168
 
169
-		if( GVCommon::has_cap( 'gravityview_support_port' ) ) {
170
-			$actions[] = '<a href="https://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
169
+		if ( GVCommon::has_cap( 'gravityview_support_port' ) ) {
170
+			$actions[ ] = '<a href="https://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
171 171
 		}
172 172
 
173 173
 		return array_merge( $actions, $links );
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 		// By default, there will only be one item being modified.
196 196
 		// When in the `bulk_post_updated_messages` filter, there will be passed a number
197 197
 		// of modified items that will override this array.
198
-		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1 , 'locked' => 1 , 'deleted' => 1 , 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
198
+		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1, 'locked' => 1, 'deleted' => 1, 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
199 199
 
200 200
 		// If we're starting fresh, a new form was created.
201 201
 		// We should let the user know this is the case.
@@ -203,60 +203,60 @@  discard block
 block discarded – undo
203 203
 
204 204
 		$new_form_text = '';
205 205
 
206
-		if( !empty( $start_fresh ) ) {
206
+		if ( ! empty( $start_fresh ) ) {
207 207
 
208 208
 			// Get the form that was created
209 209
 			$connected_form = gravityview_get_form_id( $post_id );
210 210
 
211
-			if( !empty( $connected_form ) ) {
211
+			if ( ! empty( $connected_form ) ) {
212 212
 				$form = gravityview_get_form( $connected_form );
213
-				$form_name = esc_attr( $form['title'] );
213
+				$form_name = esc_attr( $form[ 'title' ] );
214 214
 				$image = self::get_floaty();
215
-				$new_form_text .= '<h3>'.$image.sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ).'</h3>';
216
-				$new_form_text .=  sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s
215
+				$new_form_text .= '<h3>' . $image . sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ) . '</h3>';
216
+				$new_form_text .= sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s
217 217
 
218 218
 					You can %sedit the form%s in Gravity Forms and the updated fields will be available here. Don&rsquo;t forget to %scustomize the form settings%s.
219
-					', 'gravityview' ), '<strong>', '</strong>', '<a href="'.site_url( '?gf_page=preview&amp;id='.$connected_form ).'">', '</a>', '<code>[gravityform id="'.$connected_form.'" name="'.$form_name.'"]</code>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&amp;id='.$connected_form ).'">', '</a>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id='.$connected_form ).'">', '</a>');
219
+					', 'gravityview' ), '<strong>', '</strong>', '<a href="' . site_url( '?gf_page=preview&amp;id=' . $connected_form ) . '">', '</a>', '<code>[gravityform id="' . $connected_form . '" name="' . $form_name . '"]</code>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&amp;id=' . $connected_form ) . '">', '</a>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id=' . $connected_form ) . '">', '</a>' );
220 220
 				$new_form_text = wpautop( $new_form_text );
221 221
 
222 222
 				delete_post_meta( $post_id, '_gravityview_start_fresh' );
223 223
 			}
224 224
 		}
225 225
 
226
-		$messages['gravityview'] = array(
226
+		$messages[ 'gravityview' ] = array(
227 227
 			0  => '', // Unused. Messages start at index 1.
228 228
 			/* translators: %s and %s are HTML tags linking to the View on the website */
229
-			1  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
229
+			1  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
230 230
 			/* translators: %s and %s are HTML tags linking to the View on the website */
231
-			2  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
231
+			2  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
232 232
 			3  => __( 'View deleted.', 'gravityview' ),
233 233
 			/* translators: %s and %s are HTML tags linking to the View on the website */
234
-			4  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
234
+			4  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
235 235
 			/* translators: %s: date and time of the revision */
236
-			5  => isset( $_GET['revision'] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
236
+			5  => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int)$_GET[ 'revision' ], false ) ) : false,
237 237
 			/* translators: %s and %s are HTML tags linking to the View on the website */
238
-			6  => sprintf(__( 'View published. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
238
+			6  => sprintf( __( 'View published. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
239 239
 			/* translators: %s and %s are HTML tags linking to the View on the website */
240
-			7  => sprintf(__( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
240
+			7  => sprintf( __( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
241 241
 			8  => __( 'View submitted.', 'gravityview' ),
242 242
 			9  => sprintf(
243 243
 		        /* translators: Date and time the View is scheduled to be published */
244 244
 				__( 'View scheduled for: %1$s.', 'gravityview' ),
245 245
 				// translators: Publish box date format, see http://php.net/date
246
-				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL )  ) )
246
+				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL ) ) )
247 247
 			) . $new_form_text,
248 248
 			/* translators: %s and %s are HTML tags linking to the View on the website */
249
-			10  => sprintf(__( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
249
+			10  => sprintf( __( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
250 250
 
251 251
 			/**
252 252
 			 * These apply to `bulk_post_updated_messages`
253 253
 			 * @file wp-admin/edit.php
254 254
 			 */
255
-			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts['updated'], 'gravityview' ),
256
-			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts['locked'], 'gravityview' ),
257
-			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts['deleted'], 'gravityview' ),
258
-			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts['trashed'], 'gravityview' ),
259
-			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts['untrashed'], 'gravityview' ),
255
+			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts[ 'updated' ], 'gravityview' ),
256
+			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts[ 'locked' ], 'gravityview' ),
257
+			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts[ 'deleted' ], 'gravityview' ),
258
+			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts[ 'trashed' ], 'gravityview' ),
259
+			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts[ 'untrashed' ], 'gravityview' ),
260 260
 		);
261 261
 
262 262
 		return $messages;
Please login to merge, or discard this patch.
includes/class-admin-approve-entries.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'tooltips' ) );
50 50
 
51 51
 		// adding styles and scripts
52
-		add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles') );
52
+		add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles' ) );
53 53
 		// bypass Gravity Forms no-conflict mode
54 54
 		add_filter( 'gform_noconflict_scripts', array( $this, 'register_gform_noconflict_script' ) );
55 55
 		add_filter( 'gform_noconflict_styles', array( $this, 'register_gform_noconflict_style' ) );
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		 * @param bool $show_filter_links True: show the "approved"/"disapproved" filter links. False: hide them.
79 79
 		 * @param array $form GF Form object of current form
80 80
 		 */
81
-		if( false === apply_filters( 'gravityview/approve_entries/show_filter_links_entry_list', true, $form ) ) {
81
+		if ( false === apply_filters( 'gravityview/approve_entries/show_filter_links_entry_list', true, $form ) ) {
82 82
 			return $filter_links;
83 83
 		}
84 84
 
@@ -106,27 +106,27 @@  discard block
 block discarded – undo
106 106
 		$approved_count = $disapproved_count = $unapproved_count = 0;
107 107
 
108 108
 		// Only count if necessary
109
-		if( $include_counts ) {
110
-			$approved_count = count( gravityview_get_entry_ids( $form['id'], array( 'status' => 'active', 'field_filters' => $field_filters_approved ) ) );
111
-			$disapproved_count = count( gravityview_get_entry_ids( $form['id'], array( 'status' => 'active', 'field_filters' => $field_filters_disapproved ) ) );
112
-			$unapproved_count = count( gravityview_get_entry_ids( $form['id'], array( 'status' => 'active', 'field_filters' => $field_filters_unapproved ) ) );
109
+		if ( $include_counts ) {
110
+			$approved_count = count( gravityview_get_entry_ids( $form[ 'id' ], array( 'status' => 'active', 'field_filters' => $field_filters_approved ) ) );
111
+			$disapproved_count = count( gravityview_get_entry_ids( $form[ 'id' ], array( 'status' => 'active', 'field_filters' => $field_filters_disapproved ) ) );
112
+			$unapproved_count = count( gravityview_get_entry_ids( $form[ 'id' ], array( 'status' => 'active', 'field_filters' => $field_filters_unapproved ) ) );
113 113
 		}
114 114
 
115
-		$filter_links[] = array(
115
+		$filter_links[ ] = array(
116 116
 			'id'            => 'gv_approved',
117 117
 			'field_filters' => $field_filters_approved,
118 118
 			'count'         => $approved_count,
119 119
 			'label'         => GravityView_Entry_Approval_Status::get_label( GravityView_Entry_Approval_Status::APPROVED ),
120 120
 		);
121 121
 
122
-		$filter_links[] = array(
122
+		$filter_links[ ] = array(
123 123
 			'id'            => 'gv_disapproved',
124 124
 			'field_filters' => $field_filters_disapproved,
125 125
 			'count'         => $disapproved_count,
126 126
 			'label'         => GravityView_Entry_Approval_Status::get_label( GravityView_Entry_Approval_Status::DISAPPROVED ),
127 127
 		);
128 128
 
129
-		$filter_links[] = array(
129
+		$filter_links[ ] = array(
130 130
 			'id'            => 'gv_unapproved',
131 131
 			'field_filters' => $field_filters_unapproved,
132 132
 			'count'         => $unapproved_count,
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
 	 */
146 146
 	function tooltips( $tooltips ) {
147 147
 
148
-		$tooltips['form_gravityview_fields'] = array(
149
-			'title' => __('GravityView Fields', 'gravityview'),
150
-			'value' => __( 'Allow administrators to approve or reject entries and users to opt-in or opt-out of their entries being displayed.', 'gravityview'),
148
+		$tooltips[ 'form_gravityview_fields' ] = array(
149
+			'title' => __( 'GravityView Fields', 'gravityview' ),
150
+			'value' => __( 'Allow administrators to approve or reject entries and users to opt-in or opt-out of their entries being displayed.', 'gravityview' ),
151 151
 		);
152 152
 
153 153
 		return $tooltips;
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
      *
261 261
 	 * @return boolean True: It worked; False: it failed
262 262
 	 */
263
-	public static function update_approved( $entry_id = 0, $approved = 0, $form_id = 0, $approvedcolumn = 0) {
263
+	public static function update_approved( $entry_id = 0, $approved = 0, $form_id = 0, $approvedcolumn = 0 ) {
264 264
 		return GravityView_Entry_Approval::update_approved( $entry_id, $approved, $form_id, $approvedcolumn );
265 265
 	}
266 266
 
@@ -290,20 +290,20 @@  discard block
 block discarded – undo
290 290
 	 *
291 291
 	 * @return void
292 292
 	 */
293
-	static public function add_entry_approved_hidden_input(  $form_id, $field_id, $value, $entry, $query_string ) {
293
+	static public function add_entry_approved_hidden_input( $form_id, $field_id, $value, $entry, $query_string ) {
294 294
 
295
-		if( ! GVCommon::has_cap( 'gravityview_moderate_entries', $entry['id'] ) ) {
295
+		if ( ! GVCommon::has_cap( 'gravityview_moderate_entries', $entry[ 'id' ] ) ) {
296 296
 			return;
297 297
 		}
298 298
 
299
-		if( empty( $entry['id'] ) ) {
299
+		if ( empty( $entry[ 'id' ] ) ) {
300 300
 			return;
301 301
 		}
302 302
 
303 303
 		$status_value = GravityView_Entry_Approval::get_entry_status( $entry, 'value' );
304 304
 
305
-		if( $status_value ) {
306
-			echo '<input type="hidden" class="entry_approval" id="entry_approved_'. $entry['id'] .'" value="' . esc_attr( $status_value ) . '" />';
305
+		if ( $status_value ) {
306
+			echo '<input type="hidden" class="entry_approval" id="entry_approved_' . $entry[ 'id' ] . '" value="' . esc_attr( $status_value ) . '" />';
307 307
 		}
308 308
 	}
309 309
 
@@ -316,10 +316,10 @@  discard block
 block discarded – undo
316 316
 	 */
317 317
 	private function get_form_id() {
318 318
 
319
-		$form_id = GFForms::get('id');
319
+		$form_id = GFForms::get( 'id' );
320 320
 
321 321
 		// If there are no forms identified, use the first form. That's how GF does it.
322
-		if( empty( $form_id ) && class_exists('RGFormsModel') ) {
322
+		if ( empty( $form_id ) && class_exists( 'RGFormsModel' ) ) {
323 323
 			$form_id = $this->get_first_form_id();
324 324
 		}
325 325
 
@@ -339,14 +339,14 @@  discard block
 block discarded – undo
339 339
 
340 340
 		$forms = RGFormsModel::get_forms( null, 'title' );
341 341
 
342
-		if( ! isset( $forms[0] ) ) {
342
+		if ( ! isset( $forms[ 0 ] ) ) {
343 343
 			gravityview()->log->error( 'No forms were found' );
344 344
 			return 0;
345 345
 		}
346 346
 
347
-		$first_form = $forms[0];
347
+		$first_form = $forms[ 0 ];
348 348
 
349
-		$form_id = is_object( $forms[0] ) ? $first_form->id : $first_form['id'];
349
+		$form_id = is_object( $forms[ 0 ] ) ? $first_form->id : $first_form[ 'id' ];
350 350
 
351 351
 		return intval( $form_id );
352 352
 	}
@@ -354,37 +354,37 @@  discard block
 block discarded – undo
354 354
 
355 355
 	function add_scripts_and_styles( $hook ) {
356 356
 
357
-		if( ! class_exists( 'GFForms' ) ) {
357
+		if ( ! class_exists( 'GFForms' ) ) {
358 358
 			gravityview()->log->error( 'GFForms does not exist.' );
359 359
 			return;
360 360
 		}
361 361
 
362 362
 		// enqueue styles & scripts gf_entries
363 363
 		// But only if we're on the main Entries page, not on reports pages
364
-		if( GFForms::get_page() !== 'entry_list' ) {
364
+		if ( GFForms::get_page() !== 'entry_list' ) {
365 365
 			return;
366 366
 		}
367 367
 
368 368
 		$form_id = $this->get_form_id();
369 369
 
370 370
 		// Things are broken; no forms were found
371
-		if( empty( $form_id ) ) {
371
+		if ( empty( $form_id ) ) {
372 372
 			return;
373 373
 		}
374 374
 
375
-		wp_enqueue_style( 'gravityview_entries_list', plugins_url('assets/css/admin-entries-list.css', GRAVITYVIEW_FILE), array(), GravityView_Plugin::version );
375
+		wp_enqueue_style( 'gravityview_entries_list', plugins_url( 'assets/css/admin-entries-list.css', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version );
376 376
 
377
-		$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
377
+		$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
378 378
 
379
-		wp_enqueue_script( 'gravityview_gf_entries_scripts', plugins_url('assets/js/admin-entries-list'.$script_debug.'.js', GRAVITYVIEW_FILE), array( 'jquery' ), GravityView_Plugin::version );
379
+		wp_enqueue_script( 'gravityview_gf_entries_scripts', plugins_url( 'assets/js/admin-entries-list' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version );
380 380
 
381 381
 		wp_enqueue_script( 'gravityview_entries_list-popper', plugins_url( 'assets/lib/tippy/popper.min.js', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version );
382 382
 		wp_enqueue_script( 'gravityview_entries_list-tippy', plugins_url( 'assets/lib/tippy/tippy.min.js', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version );
383 383
 		wp_enqueue_style( 'gravityview_entries_list-tippy', plugins_url( 'assets/lib/tippy/tippy.css', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version );
384 384
 
385 385
 		wp_localize_script( 'gravityview_gf_entries_scripts', 'gvGlobals', array(
386
-			'nonce' => wp_create_nonce( 'gravityview_entry_approval'),
387
-			'admin_nonce' => wp_create_nonce( 'gravityview_admin_entry_approval'),
386
+			'nonce' => wp_create_nonce( 'gravityview_entry_approval' ),
387
+			'admin_nonce' => wp_create_nonce( 'gravityview_admin_entry_approval' ),
388 388
 			'form_id' => $form_id,
389 389
 			'show_column' => (int)$this->show_approve_entry_column( $form_id ),
390 390
 			'add_bulk_action' => (int)GVCommon::has_cap( 'gravityview_moderate_entries' ),
@@ -393,10 +393,10 @@  discard block
 block discarded – undo
393 393
 			'status_unapproved' => GravityView_Entry_Approval_Status::UNAPPROVED,
394 394
 			'bulk_actions' => GravityView_Bulk_Actions::get_bulk_actions( $form_id ),
395 395
 			'bulk_message' => $this->bulk_update_message,
396
-			'unapprove_title' => GravityView_Entry_Approval_Status::get_title_attr('unapproved'),
397
-            'approve_title' => GravityView_Entry_Approval_Status::get_title_attr('disapproved'),
398
-			'disapprove_title' => GravityView_Entry_Approval_Status::get_title_attr('approved'),
399
-			'column_title' => __( 'Show entry in directory view?', 'gravityview'),
396
+			'unapprove_title' => GravityView_Entry_Approval_Status::get_title_attr( 'unapproved' ),
397
+            'approve_title' => GravityView_Entry_Approval_Status::get_title_attr( 'disapproved' ),
398
+			'disapprove_title' => GravityView_Entry_Approval_Status::get_title_attr( 'approved' ),
399
+			'column_title' => __( 'Show entry in directory view?', 'gravityview' ),
400 400
 			'column_link' => esc_url( $this->get_sort_link() ),
401 401
             'status_popover_template' => GravityView_Entry_Approval::get_popover_template(),
402 402
 			'status_popover_placement' => GravityView_Entry_Approval::get_popover_placement(),
@@ -444,13 +444,13 @@  discard block
 block discarded – undo
444 444
 		 * @since 1.7.2
445 445
 		 * @param boolean $hide_if_no_connections
446 446
 		 */
447
-		$hide_if_no_connections = apply_filters('gravityview/approve_entries/hide-if-no-connections', false );
447
+		$hide_if_no_connections = apply_filters( 'gravityview/approve_entries/hide-if-no-connections', false );
448 448
 
449
-		if( $hide_if_no_connections ) {
449
+		if ( $hide_if_no_connections ) {
450 450
 
451 451
 			$connected_views = gravityview_get_connected_views( $form_id );
452 452
 
453
-			if( empty( $connected_views ) ) {
453
+			if ( empty( $connected_views ) ) {
454 454
 				$show_approve_column = false;
455 455
 			}
456 456
 		}
@@ -460,21 +460,21 @@  discard block
 block discarded – undo
460 460
 		 * @param boolean $show_approve_column Whether the column will be shown
461 461
 		 * @param int $form_id The ID of the Gravity Forms form for which entries are being shown
462 462
 		 */
463
-		$show_approve_column = apply_filters('gravityview/approve_entries/show-column', $show_approve_column, $form_id );
463
+		$show_approve_column = apply_filters( 'gravityview/approve_entries/show-column', $show_approve_column, $form_id );
464 464
 
465 465
 		return $show_approve_column;
466 466
 	}
467 467
 
468 468
 	function register_gform_noconflict_script( $scripts ) {
469
-		$scripts[] = 'gravityview_gf_entries_scripts';
470
-		$scripts[] = 'gravityview_entries_list-popper';
471
-		$scripts[] = 'gravityview_entries_list-tippy';
469
+		$scripts[ ] = 'gravityview_gf_entries_scripts';
470
+		$scripts[ ] = 'gravityview_entries_list-popper';
471
+		$scripts[ ] = 'gravityview_entries_list-tippy';
472 472
 		return $scripts;
473 473
 	}
474 474
 
475 475
 	function register_gform_noconflict_style( $styles ) {
476
-		$styles[] = 'gravityview_entries_list';
477
-		$styles[] = 'gravityview_entries_list-tippy';
476
+		$styles[ ] = 'gravityview_entries_list';
477
+		$styles[ ] = 'gravityview_entries_list-tippy';
478 478
 		return $styles;
479 479
 	}
480 480
 
Please login to merge, or discard this patch.
lightbox/fancybox/class-gravityview-lightbox-provider-fancybox.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -108,17 +108,17 @@  discard block
 block discarded – undo
108 108
 	 */
109 109
 	public function allowed_atts( $atts = array() ) {
110 110
 
111
-		$atts['data-fancybox']         = null;
112
-		$atts['data-fancybox-trigger'] = null;
113
-		$atts['data-fancybox-index']   = null;
114
-		$atts['data-src']              = null;
115
-		$atts['data-type']             = null;
116
-		$atts['data-width']            = null;
117
-		$atts['data-height']           = null;
118
-		$atts['data-srcset']           = null;
119
-		$atts['data-caption']          = null;
120
-		$atts['data-options']          = null;
121
-		$atts['data-filter']           = null;
111
+		$atts[ 'data-fancybox' ]         = null;
112
+		$atts[ 'data-fancybox-trigger' ] = null;
113
+		$atts[ 'data-fancybox-index' ]   = null;
114
+		$atts[ 'data-src' ]              = null;
115
+		$atts[ 'data-type' ]             = null;
116
+		$atts[ 'data-width' ]            = null;
117
+		$atts[ 'data-height' ]           = null;
118
+		$atts[ 'data-srcset' ]           = null;
119
+		$atts[ 'data-caption' ]          = null;
120
+		$atts[ 'data-options' ]          = null;
121
+		$atts[ 'data-filter' ]           = null;
122 122
 
123 123
 		return $atts;
124 124
 	}
@@ -133,23 +133,23 @@  discard block
 block discarded – undo
133 133
 		}
134 134
 
135 135
 		// Prevent empty content from getting added to the lightbox gallery
136
-		if ( is_array( $additional_details ) && empty( $additional_details['file_path'] ) ) {
136
+		if ( is_array( $additional_details ) && empty( $additional_details[ 'file_path' ] ) ) {
137 137
 			return $link_atts;
138 138
 		}
139 139
 
140 140
 		// Prevent empty content from getting added to the lightbox gallery
141
-		if ( is_array( $additional_details ) && ! empty( $additional_details['disable_lightbox'] ) ) {
141
+		if ( is_array( $additional_details ) && ! empty( $additional_details[ 'disable_lightbox' ] ) ) {
142 142
 			return $link_atts;
143 143
 		}
144 144
 
145
-		$link_atts['class'] = \GV\Utils::get( $link_atts, 'class' ) . ' gravityview-fancybox';
145
+		$link_atts[ 'class' ] = \GV\Utils::get( $link_atts, 'class' ) . ' gravityview-fancybox';
146 146
 
147
-		$link_atts['class'] = gravityview_sanitize_html_class( $link_atts['class'] );
147
+		$link_atts[ 'class' ] = gravityview_sanitize_html_class( $link_atts[ 'class' ] );
148 148
 
149 149
 		if ( $context && ! empty( $context->field->field ) ) {
150 150
 			if ( $context->field->field->multipleFiles ) {
151 151
 				$entry = $context->entry->as_entry();
152
-				$link_atts['data-fancybox'] = 'gallery-' . sprintf( "%s-%s-%s", $entry['form_id'], $context->field->ID, $context->entry->get_slug() );
152
+				$link_atts[ 'data-fancybox' ] = 'gallery-' . sprintf( "%s-%s-%s", $entry[ 'form_id' ], $context->field->ID, $context->entry->get_slug() );
153 153
 			}
154 154
 		}
155 155
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 		 * @see https://fancyapps.com/docs/ui/fancybox#media-types
161 161
 		 */
162 162
 		if ( false !== strpos( $file_path, 'gv-iframe' ) ) {
163
-			$link_atts['data-type'] = 'pdf';
163
+			$link_atts[ 'data-type' ] = 'pdf';
164 164
 		}
165 165
 
166 166
 		return $link_atts;
Please login to merge, or discard this patch.
includes/extensions/edit-entry/partials/form-buttons.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -44,35 +44,35 @@  discard block
 block discarded – undo
44 44
 
45 45
 	if ( $object->show_previous_button ) {
46 46
 		$previous_tabindex = GFCommon::get_tabindex();
47
-		$previous_label = GFCommon::replace_variables( $labels['previous'], $object->form, $object->entry );
47
+		$previous_label = GFCommon::replace_variables( $labels[ 'previous' ], $object->form, $object->entry );
48 48
 		?>
49
-		<input id="gform_previous_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-previous" type="submit" <?php echo $previous_tabindex; ?> value="<?php echo esc_attr( $previous_label ); ?>" name="save" />
49
+		<input id="gform_previous_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-previous" type="submit" <?php echo $previous_tabindex; ?> value="<?php echo esc_attr( $previous_label ); ?>" name="save" />
50 50
 		<?php
51 51
 	}
52 52
 
53 53
 	if ( $object->show_next_button ) {
54
-		$next_tabindex    = GFCommon::get_tabindex();
55
-		$next_label = GFCommon::replace_variables( $labels['next'], $object->form, $object->entry );
54
+		$next_tabindex = GFCommon::get_tabindex();
55
+		$next_label = GFCommon::replace_variables( $labels[ 'next' ], $object->form, $object->entry );
56 56
 		?>
57
-		<input id="gform_next_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-next" type="submit" <?php echo $next_tabindex; ?> value="<?php echo esc_attr( $next_label ); ?>" name="save" />
57
+		<input id="gform_next_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-next" type="submit" <?php echo $next_tabindex; ?> value="<?php echo esc_attr( $next_label ); ?>" name="save" />
58 58
 		<?php
59 59
 	}
60 60
 
61 61
 	if ( $object->show_update_button ) {
62
-		$update_tabindex  = GFCommon::get_tabindex();
63
-		$update_label = GFCommon::replace_variables( $labels['submit'], $object->form, $object->entry );
62
+		$update_tabindex = GFCommon::get_tabindex();
63
+		$update_label = GFCommon::replace_variables( $labels[ 'submit' ], $object->form, $object->entry );
64 64
 		?>
65
-		<input id="gform_submit_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" <?php echo $update_tabindex; ?> value="<?php echo esc_attr( $update_label ); ?>" name="save" />
65
+		<input id="gform_submit_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" <?php echo $update_tabindex; ?> value="<?php echo esc_attr( $update_label ); ?>" name="save" />
66 66
 		<?php
67 67
 	}
68 68
 
69
-	$cancel_tabindex   = GFCommon::get_tabindex();
70
-	$cancel_label = GFCommon::replace_variables( $labels['cancel'], $object->form, $object->entry );
69
+	$cancel_tabindex = GFCommon::get_tabindex();
70
+	$cancel_label = GFCommon::replace_variables( $labels[ 'cancel' ], $object->form, $object->entry );
71 71
 
72 72
 	// If the entry has been edited, history.back() will keep pointing to the Edit Entry screen. Go back before editing, please!
73 73
 	// On first visit, will be history.go(-1) because (0 + 1 * -1).
74 74
 	// After updating twice, history.go(-3) because (2 + 1 * -1)
75
-	$update_count = (int) \GV\Utils::_POST( 'update_count', 0 );
75
+	$update_count = (int)\GV\Utils::_POST( 'update_count', 0 );
76 76
 
77 77
 	/**
78 78
 	 * @filter `gravityview/edit_entry/cancel_onclick` Modify the `onclick` attribute for the back link. To remove `onclick` altogether, return an empty string.
@@ -106,5 +106,5 @@  discard block
 block discarded – undo
106 106
 	?>
107 107
 	<input type='hidden' name='update_count' value='<?php echo $update_count + 1; ?>'/>
108 108
 	<input type="hidden" name="action" value="update" />
109
-	<input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry['id'] ); ?>" />
109
+	<input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry[ 'id' ] ); ?>" />
110 110
 </div>
Please login to merge, or discard this patch.
includes/class-frontend-views.php 1 patch
Spacing   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
 	private function __construct() {}
86 86
 
87 87
 	private function initialize() {
88
-		add_action( 'wp', array( $this, 'parse_content'), 11 );
88
+		add_action( 'wp', array( $this, 'parse_content' ), 11 );
89 89
 		add_filter( 'render_block', array( $this, 'detect_views_in_block_content' ) );
90 90
 		add_filter( 'parse_query', array( $this, 'parse_query_fix_frontpage' ), 10 );
91
-		add_action( 'template_redirect', array( $this, 'set_entry_data'), 1 );
91
+		add_action( 'template_redirect', array( $this, 'set_entry_data' ), 1 );
92 92
 
93 93
 		// Enqueue scripts and styles after GravityView_Template::register_styles()
94 94
 		add_action( 'wp_enqueue_scripts', array( $this, 'add_scripts_and_styles' ), 20 );
@@ -235,18 +235,18 @@  discard block
 block discarded – undo
235 235
 
236 236
 		if ( ! empty( $view_id ) ) {
237 237
 
238
-			$this->context_view_id = (int) $view_id;
238
+			$this->context_view_id = (int)$view_id;
239 239
 
240
-		} elseif ( isset( $_GET['gvid'] ) && $multiple_views ) {
240
+		} elseif ( isset( $_GET[ 'gvid' ] ) && $multiple_views ) {
241 241
 			/**
242 242
 			 * used on a has_multiple_views context
243 243
 			 * @see GravityView_API::entry_link
244 244
 			 */
245
-			$this->context_view_id = (int) $_GET['gvid'];
245
+			$this->context_view_id = (int)$_GET[ 'gvid' ];
246 246
 
247 247
 		} elseif ( ! $multiple_views ) {
248 248
 			$array_keys = array_keys( $this->getGvOutputData()->get_views() );
249
-			$this->context_view_id = (int) array_pop( $array_keys );
249
+			$this->context_view_id = (int)array_pop( $array_keys );
250 250
 			unset( $array_keys );
251 251
 		}
252 252
 
@@ -279,25 +279,25 @@  discard block
 block discarded – undo
279 279
 		global $wp_rewrite;
280 280
 
281 281
 		$is_front_page = ( $query->is_home || $query->is_page );
282
-		$show_on_front = ( 'page' === get_option('show_on_front') );
283
-		$front_page_id = get_option('page_on_front');
282
+		$show_on_front = ( 'page' === get_option( 'show_on_front' ) );
283
+		$front_page_id = get_option( 'page_on_front' );
284 284
 
285
-		if (  $is_front_page && $show_on_front && $front_page_id ) {
285
+		if ( $is_front_page && $show_on_front && $front_page_id ) {
286 286
 
287 287
 			// Force to be an array, potentially a query string ( entry=16 )
288 288
 			$_query = wp_parse_args( $query->query );
289 289
 
290 290
 			// pagename can be set and empty depending on matched rewrite rules. Ignore an empty pagename.
291
-			if ( isset( $_query['pagename'] ) && '' === $_query['pagename'] ) {
292
-				unset( $_query['pagename'] );
291
+			if ( isset( $_query[ 'pagename' ] ) && '' === $_query[ 'pagename' ] ) {
292
+				unset( $_query[ 'pagename' ] );
293 293
 			}
294 294
 
295 295
 			// this is where will break from core wordpress
296 296
 			/** @internal Don't use this filter; it will be unnecessary soon - it's just a patch for specific use case */
297 297
 			$ignore = apply_filters( 'gravityview/internal/ignored_endpoints', array( 'preview', 'page', 'paged', 'cpage' ), $query );
298 298
 			$endpoints = \GV\Utils::get( $wp_rewrite, 'endpoints' );
299
-			foreach ( (array) $endpoints as $endpoint ) {
300
-				$ignore[] = $endpoint[1];
299
+			foreach ( (array)$endpoints as $endpoint ) {
300
+				$ignore[ ] = $endpoint[ 1 ];
301 301
 			}
302 302
 			unset( $endpoints );
303 303
 
@@ -307,21 +307,21 @@  discard block
 block discarded – undo
307 307
 			// - The query includes keys that are associated with registered endpoints. `entry`, for example.
308 308
 			if ( empty( $_query ) || ! array_diff( array_keys( $_query ), $ignore ) ) {
309 309
 
310
-				$qv =& $query->query_vars;
310
+				$qv = & $query->query_vars;
311 311
 
312 312
 				// Prevent redirect when on the single entry endpoint
313
-				if( self::is_single_entry() ) {
313
+				if ( self::is_single_entry() ) {
314 314
 					add_filter( 'redirect_canonical', '__return_false' );
315 315
 				}
316 316
 
317 317
 				$query->is_page = true;
318 318
 				$query->is_home = false;
319
-				$qv['page_id']  = $front_page_id;
319
+				$qv[ 'page_id' ]  = $front_page_id;
320 320
 
321 321
 				// Correct <!--nextpage--> for page_on_front
322
-				if ( ! empty( $qv['paged'] ) ) {
323
-					$qv['page'] = $qv['paged'];
324
-					unset( $qv['paged'] );
322
+				if ( ! empty( $qv[ 'paged' ] ) ) {
323
+					$qv[ 'page' ] = $qv[ 'paged' ];
324
+					unset( $qv[ 'paged' ] );
325 325
 				}
326 326
 			}
327 327
 
@@ -383,11 +383,11 @@  discard block
 block discarded – undo
383 383
 			$blocks = parse_blocks( $post_content );
384 384
 
385 385
 			foreach ( $blocks as $block ) {
386
-				if ( empty( $block['attrs']['ref'] ) ) {
386
+				if ( empty( $block[ 'attrs' ][ 'ref' ] ) ) {
387 387
 					continue;
388 388
 				}
389 389
 
390
-				$block_post = get_post( $block['attrs']['ref'] );
390
+				$block_post = get_post( $block[ 'attrs' ][ 'ref' ] );
391 391
 
392 392
 				if ( $block_post ) {
393 393
 					$post_content .= $block_post->post_content;
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 
441 441
 		$search_method = GravityView_Widget_Search::getInstance()->get_search_method();
442 442
 
443
-		if( 'post' === $search_method ) {
443
+		if ( 'post' === $search_method ) {
444 444
 			$get = $_POST;
445 445
 		} else {
446 446
 			$get = $_GET;
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 		$gventry = gravityview()->request->is_entry();
493 493
 
494 494
 		// If this is the directory view, return.
495
-		if( ! $gventry ) {
495
+		if ( ! $gventry ) {
496 496
 			return $passed_title;
497 497
 		}
498 498
 
@@ -510,19 +510,19 @@  discard block
 block discarded – undo
510 510
 		}
511 511
 
512 512
 		// WooCommerce doesn't $post_id
513
-		if ( empty( $passed_post_id ) )  {
513
+		if ( empty( $passed_post_id ) ) {
514 514
 			return $passed_title;
515 515
 		}
516 516
 
517 517
 		// Don't modify the title for anything other than the current view/post.
518 518
 		// This is true for embedded shortcodes and Views.
519
-		if ( is_object( $post ) && (int) $post->ID !== (int) $passed_post_id ) {
519
+		if ( is_object( $post ) && (int)$post->ID !== (int)$passed_post_id ) {
520 520
 			return $passed_title;
521 521
 		}
522 522
 
523 523
 		$view = gravityview()->request->is_view();
524 524
 
525
-		if( $view ) {
525
+		if ( $view ) {
526 526
 			return $this->_get_single_entry_title( $view, $entry, $passed_title );
527 527
 		}
528 528
 
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 		$view_collection = \GV\View_Collection::from_post( $post );
546 546
 
547 547
 		// We have multiple Views, but no gvid...this isn't valid security
548
-		if( 1 < $view_collection->count() ) {
548
+		if ( 1 < $view_collection->count() ) {
549 549
 			return $passed_title;
550 550
 		}
551 551
 
@@ -579,18 +579,18 @@  discard block
 block discarded – undo
579 579
 		 */
580 580
 		$check_entry_display = apply_filters( 'gravityview/single/title/check_entry_display', true, $entry, $view );
581 581
 
582
-		if( $check_entry_display ) {
582
+		if ( $check_entry_display ) {
583 583
 
584 584
 			$check_display = GVCommon::check_entry_display( $entry, $view );
585 585
 
586
-			if( is_wp_error( $check_display ) ) {
586
+			if ( is_wp_error( $check_display ) ) {
587 587
 				return $passed_title;
588 588
 			}
589 589
 		}
590 590
 
591 591
 		$title = $view->settings->get( 'single_title', $passed_title );
592 592
 
593
-		$form = GVCommon::get_form( $entry['form_id'] );
593
+		$form = GVCommon::get_form( $entry[ 'form_id' ] );
594 594
 
595 595
 		// We are allowing HTML in the fields, so no escaping the output
596 596
 		$title = GravityView_API::replace_variables( $title, $form, $entry );
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 
662 662
 		$context = GravityView_View::getInstance()->getContext();
663 663
 
664
-		switch( $context ) {
664
+		switch ( $context ) {
665 665
 			case 'directory':
666 666
 				$tab = __( 'Multiple Entries', 'gravityview' );
667 667
 				break;
@@ -675,12 +675,12 @@  discard block
 block discarded – undo
675 675
 		}
676 676
 
677 677
 
678
-		$title = sprintf( esc_html_x('The %s layout has not been configured.', 'Displayed when a View is not configured. %s is replaced by the tab label', 'gravityview' ), $tab );
678
+		$title = sprintf( esc_html_x( 'The %s layout has not been configured.', 'Displayed when a View is not configured. %s is replaced by the tab label', 'gravityview' ), $tab );
679 679
 		$edit_link = admin_url( sprintf( 'post.php?post=%d&action=edit#%s-view', $view_id, $context ) );
680
-		$action_text = sprintf( esc_html__('Add fields to %s', 'gravityview' ), $tab );
680
+		$action_text = sprintf( esc_html__( 'Add fields to %s', 'gravityview' ), $tab );
681 681
 		$message = esc_html__( 'You can only see this message because you are able to edit this View.', 'gravityview' );
682 682
 
683
-		$image =  sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', $tab, esc_url(plugins_url( sprintf( 'assets/images/tab-%s.png', $context ), GRAVITYVIEW_FILE ) ) );
683
+		$image = sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', $tab, esc_url( plugins_url( sprintf( 'assets/images/tab-%s.png', $context ), GRAVITYVIEW_FILE ) ) );
684 684
 		$output = sprintf( '<h3>%s <strong><a href="%s">%s</a></strong></h3><p>%s</p>', $title, esc_url( $edit_link ), $action_text, $message );
685 685
 
686 686
 		echo GVCommon::generate_notice( $output . $image, 'gv-error error', 'edit_gravityview', $view_id );
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
 		$direct_access = apply_filters( 'gravityview_direct_access', true, $view->ID );
728 728
 		$embed_only = $view->settings->get( 'embed_only' );
729 729
 
730
-		if( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) {
730
+		if ( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) {
731 731
 			return __( 'You are not allowed to view this content.', 'gravityview' );
732 732
 		}
733 733
 
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 				$datetime_format = 'Y-m-d H:i:s';
775 775
 				$search_is_outside_view_bounds = false;
776 776
 
777
-				if( ! empty( $search_criteria[ $key ] ) ) {
777
+				if ( ! empty( $search_criteria[ $key ] ) ) {
778 778
 
779 779
 					$search_date = strtotime( $search_criteria[ $key ], GFCommon::get_local_timestamp() );
780 780
 
@@ -802,14 +802,14 @@  discard block
 block discarded – undo
802 802
 				if ( empty( $search_criteria[ $key ] ) || $search_is_outside_view_bounds ) {
803 803
 
804 804
 					// Then we override the search and re-set the start date
805
-					$return_search_criteria[ $key ] = date_i18n( $datetime_format , $date, true );
805
+					$return_search_criteria[ $key ] = date_i18n( $datetime_format, $date, true );
806 806
 				}
807 807
 			}
808 808
 		}
809 809
 
810
-		if( isset( $return_search_criteria['start_date'] ) && isset( $return_search_criteria['end_date'] ) ) {
810
+		if ( isset( $return_search_criteria[ 'start_date' ] ) && isset( $return_search_criteria[ 'end_date' ] ) ) {
811 811
 			// The start date is AFTER the end date. This will result in no results, but let's not force the issue.
812
-			if ( strtotime( $return_search_criteria['start_date'] ) > strtotime( $return_search_criteria['end_date'] ) ) {
812
+			if ( strtotime( $return_search_criteria[ 'start_date' ] ) > strtotime( $return_search_criteria[ 'end_date' ] ) ) {
813 813
 				gravityview()->log->error( 'Invalid search: the start date is after the end date.', array( 'data' => $return_search_criteria ) );
814 814
 			}
815 815
 		}
@@ -828,19 +828,19 @@  discard block
 block discarded – undo
828 828
 	public static function process_search_only_approved( $args, $search_criteria ) {
829 829
 
830 830
 		/** @since 1.19 */
831
-		if( ! empty( $args['admin_show_all_statuses'] ) && GVCommon::has_cap('gravityview_moderate_entries') ) {
831
+		if ( ! empty( $args[ 'admin_show_all_statuses' ] ) && GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
832 832
 			gravityview()->log->debug( 'User can moderate entries; showing all approval statuses' );
833 833
 			return $search_criteria;
834 834
 		}
835 835
 
836
-		if ( ! empty( $args['show_only_approved'] ) ) {
836
+		if ( ! empty( $args[ 'show_only_approved' ] ) ) {
837 837
 
838
-			$search_criteria['field_filters'][] = array(
838
+			$search_criteria[ 'field_filters' ][ ] = array(
839 839
 				'key' => GravityView_Entry_Approval::meta_key,
840 840
 				'value' => GravityView_Entry_Approval_Status::APPROVED
841 841
 			);
842 842
 
843
-			$search_criteria['field_filters']['mode'] = 'all'; // force all the criterias to be met
843
+			$search_criteria[ 'field_filters' ][ 'mode' ] = 'all'; // force all the criterias to be met
844 844
 
845 845
 			gravityview()->log->debug( '[process_search_only_approved] Search Criteria if show only approved: ', array( 'data' => $search_criteria ) );
846 846
 		}
@@ -867,18 +867,18 @@  discard block
 block discarded – undo
867 867
 	 */
868 868
 	public static function is_entry_approved( $entry, $args = array() ) {
869 869
 
870
-		if ( empty( $entry['id'] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args['show_only_approved'] ) ) {
870
+		if ( empty( $entry[ 'id' ] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args[ 'show_only_approved' ] ) ) {
871 871
 			// is implicitly approved if entry is null or View settings doesn't require to check for approval
872 872
 			return true;
873 873
 		}
874 874
 
875 875
 		/** @since 1.19 */
876
-		if( ! empty( $args['admin_show_all_statuses'] ) && GVCommon::has_cap('gravityview_moderate_entries') ) {
876
+		if ( ! empty( $args[ 'admin_show_all_statuses' ] ) && GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
877 877
 			gravityview()->log->debug( 'User can moderate entries, so entry is approved for viewing' );
878 878
 			return true;
879 879
 		}
880 880
 
881
-		$is_approved = gform_get_meta( $entry['id'], GravityView_Entry_Approval::meta_key );
881
+		$is_approved = gform_get_meta( $entry[ 'id' ], GravityView_Entry_Approval::meta_key );
882 882
 
883 883
 		return GravityView_Entry_Approval_Status::is_approved( $is_approved );
884 884
 	}
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 		 * Compatibility with filters hooking in `gravityview_search_criteria` instead of `gravityview_fe_search_criteria`.
903 903
 		 */
904 904
 		$criteria = apply_filters( 'gravityview_search_criteria', array(), array( $form_id ), \GV\Utils::get( $args, 'id' ) );
905
-		$search_criteria = isset( $criteria['search_criteria'] ) ? $criteria['search_criteria'] : array( 'field_filters' => array() );
905
+		$search_criteria = isset( $criteria[ 'search_criteria' ] ) ? $criteria[ 'search_criteria' ] : array( 'field_filters' => array() );
906 906
 
907 907
 		/**
908 908
 		 * @filter `gravityview_fe_search_criteria` Modify the search criteria
@@ -922,29 +922,29 @@  discard block
 block discarded – undo
922 922
 		gravityview()->log->debug( '[get_search_criteria] Search Criteria after hook gravityview_fe_search_criteria: ', array( 'data' =>$search_criteria ) );
923 923
 
924 924
 		// implicity search
925
-		if ( ! empty( $args['search_value'] ) ) {
925
+		if ( ! empty( $args[ 'search_value' ] ) ) {
926 926
 
927 927
 			// Search operator options. Options: `is` or `contains`
928
-			$operator = ! empty( $args['search_operator'] ) && in_array( $args['search_operator'], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args['search_operator'] : 'contains';
928
+			$operator = ! empty( $args[ 'search_operator' ] ) && in_array( $args[ 'search_operator' ], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args[ 'search_operator' ] : 'contains';
929 929
 
930
-			$search_criteria['field_filters'][] = array(
930
+			$search_criteria[ 'field_filters' ][ ] = array(
931 931
 				'key' => \GV\Utils::_GET( 'search_field', \GV\Utils::get( $args, 'search_field' ) ), // The field ID to search
932
-				'value' => _wp_specialchars( $args['search_value'] ), // The value to search. Encode ampersands but not quotes.
932
+				'value' => _wp_specialchars( $args[ 'search_value' ] ), // The value to search. Encode ampersands but not quotes.
933 933
 				'operator' => $operator,
934 934
 			);
935 935
 
936 936
 			// Lock search mode to "all" with implicit presearch filter.
937
-			$search_criteria['field_filters']['mode'] = 'all';
937
+			$search_criteria[ 'field_filters' ][ 'mode' ] = 'all';
938 938
 		}
939 939
 
940
-		if( $search_criteria !== $original_search_criteria ) {
940
+		if ( $search_criteria !== $original_search_criteria ) {
941 941
 			gravityview()->log->debug( '[get_search_criteria] Search Criteria after implicity search: ', array( 'data' => $search_criteria ) );
942 942
 		}
943 943
 
944 944
 		// Handle setting date range
945 945
 		$search_criteria = self::process_search_dates( $args, $search_criteria );
946 946
 
947
-		if( $search_criteria !== $original_search_criteria ) {
947
+		if ( $search_criteria !== $original_search_criteria ) {
948 948
 			gravityview()->log->debug( '[get_search_criteria] Search Criteria after date params: ', array( 'data' => $search_criteria ) );
949 949
 		}
950 950
 
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
 		 * @filter `gravityview_status` Modify entry status requirements to be included in search results.
956 956
 		 * @param string $status Default: `active`. Accepts all Gravity Forms entry statuses, including `spam` and `trash`
957 957
 		 */
958
-		$search_criteria['status'] = apply_filters( 'gravityview_status', 'active', $args );
958
+		$search_criteria[ 'status' ] = apply_filters( 'gravityview_status', 'active', $args );
959 959
 
960 960
 		return $search_criteria;
961 961
 	}
@@ -1067,7 +1067,7 @@  discard block
 block discarded – undo
1067 1067
 			'search_criteria' => $search_criteria,
1068 1068
 			'sorting' => self::updateViewSorting( $args, $form_id ),
1069 1069
 			'paging' => $paging,
1070
-			'cache' => isset( $args['cache'] ) ? $args['cache'] : true,
1070
+			'cache' => isset( $args[ 'cache' ] ) ? $args[ 'cache' ] : true,
1071 1071
 		);
1072 1072
 
1073 1073
 		/**
@@ -1092,7 +1092,7 @@  discard block
 block discarded – undo
1092 1092
 		 * @param array $parameters Array with `search_criteria`, `sorting` and `paging` keys.
1093 1093
 		 * @param array $args View configuration args.
1094 1094
 		 */
1095
-		$parameters = apply_filters( 'gravityview_get_entries_'.\GV\Utils::get( $args, 'id' ), $parameters, $args, $form_id );
1095
+		$parameters = apply_filters( 'gravityview_get_entries_' . \GV\Utils::get( $args, 'id' ), $parameters, $args, $form_id );
1096 1096
 
1097 1097
 		gravityview()->log->debug( '$parameters passed to gravityview_get_entries(): ', array( 'data' => $parameters ) );
1098 1098
 
@@ -1117,17 +1117,17 @@  discard block
 block discarded – undo
1117 1117
 		$default_page_size = apply_filters( 'gravityview_default_page_size', 25 );
1118 1118
 
1119 1119
 		// Paging & offset
1120
-		$page_size = ! empty( $args['page_size'] ) ? intval( $args['page_size'] ) : $default_page_size;
1120
+		$page_size = ! empty( $args[ 'page_size' ] ) ? intval( $args[ 'page_size' ] ) : $default_page_size;
1121 1121
 
1122 1122
 		if ( -1 === $page_size ) {
1123 1123
 			$page_size = PHP_INT_MAX;
1124 1124
 		}
1125 1125
 
1126
-		$curr_page = empty( $_GET['pagenum'] ) ? 1 : intval( $_GET['pagenum'] );
1126
+		$curr_page = empty( $_GET[ 'pagenum' ] ) ? 1 : intval( $_GET[ 'pagenum' ] );
1127 1127
 		$offset = ( $curr_page - 1 ) * $page_size;
1128 1128
 
1129
-		if ( ! empty( $args['offset'] ) ) {
1130
-			$offset += intval( $args['offset'] );
1129
+		if ( ! empty( $args[ 'offset' ] ) ) {
1130
+			$offset += intval( $args[ 'offset' ] );
1131 1131
 		}
1132 1132
 
1133 1133
 		$paging = array(
@@ -1152,11 +1152,11 @@  discard block
 block discarded – undo
1152 1152
 	public static function updateViewSorting( $args, $form_id ) {
1153 1153
 		$sorting = array();
1154 1154
 
1155
-		$has_values = isset( $_GET['sort'] );
1155
+		$has_values = isset( $_GET[ 'sort' ] );
1156 1156
 
1157
-		if ( $has_values && is_array( $_GET['sort'] ) ) {
1158
-			$sorts = array_keys( $_GET['sort'] );
1159
-			$dirs  = array_values( $_GET['sort'] );
1157
+		if ( $has_values && is_array( $_GET[ 'sort' ] ) ) {
1158
+			$sorts = array_keys( $_GET[ 'sort' ] );
1159
+			$dirs  = array_values( $_GET[ 'sort' ] );
1160 1160
 
1161 1161
 			if ( $has_values = array_filter( $dirs ) ) {
1162 1162
 				$sort_field_id = end( $sorts );
@@ -1165,11 +1165,11 @@  discard block
 block discarded – undo
1165 1165
 		}
1166 1166
 
1167 1167
 		if ( ! isset( $sort_field_id ) ) {
1168
-			$sort_field_id = isset( $_GET['sort'] ) ? $_GET['sort'] : \GV\Utils::get( $args, 'sort_field' );
1168
+			$sort_field_id = isset( $_GET[ 'sort' ] ) ? $_GET[ 'sort' ] : \GV\Utils::get( $args, 'sort_field' );
1169 1169
 		}
1170 1170
 
1171 1171
 		if ( ! isset( $sort_direction ) ) {
1172
-			$sort_direction = isset( $_GET['dir'] ) ? $_GET['dir'] : \GV\Utils::get( $args, 'sort_direction' );
1172
+			$sort_direction = isset( $_GET[ 'dir' ] ) ? $_GET[ 'dir' ] : \GV\Utils::get( $args, 'sort_direction' );
1173 1173
 		}
1174 1174
 
1175 1175
 		if ( is_array( $sort_field_id ) ) {
@@ -1201,10 +1201,10 @@  discard block
 block discarded – undo
1201 1201
 				$form = GFAPI::get_form( $form_id );
1202 1202
 
1203 1203
 				// Get the first GF_Field field ID, set as the key for entry randomization
1204
-				if ( ! empty( $form['fields'] ) ) {
1204
+				if ( ! empty( $form[ 'fields' ] ) ) {
1205 1205
 
1206 1206
 					/** @var GF_Field $field */
1207
-					foreach ( $form['fields'] as $field ) {
1207
+					foreach ( $form[ 'fields' ] as $field ) {
1208 1208
 						if ( ! is_a( $field, 'GF_Field' ) ) {
1209 1209
 							continue;
1210 1210
 						}
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
 		if ( is_array( $sort_field_id ) ) {
1250 1250
 			$modified_ids = array();
1251 1251
 			foreach ( $sort_field_id as $_sort_field_id ) {
1252
-				$modified_ids []= self::_override_sorting_id_by_field_type( $_sort_field_id, $form_id );
1252
+				$modified_ids [ ] = self::_override_sorting_id_by_field_type( $_sort_field_id, $form_id );
1253 1253
 			}
1254 1254
 			return $modified_ids;
1255 1255
 		}
@@ -1258,11 +1258,11 @@  discard block
 block discarded – undo
1258 1258
 
1259 1259
 		$sort_field = GFFormsModel::get_field( $form, $sort_field_id );
1260 1260
 
1261
-		if( ! $sort_field ) {
1261
+		if ( ! $sort_field ) {
1262 1262
 			return $sort_field_id;
1263 1263
 		}
1264 1264
 
1265
-		switch ( $sort_field['type'] ) {
1265
+		switch ( $sort_field[ 'type' ] ) {
1266 1266
 
1267 1267
 			case 'address':
1268 1268
 				// Sorting by full address
@@ -1279,7 +1279,7 @@  discard block
 block discarded – undo
1279 1279
 					 */
1280 1280
 					$address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id );
1281 1281
 
1282
-					switch( strtolower( $address_part ) ){
1282
+					switch ( strtolower( $address_part ) ) {
1283 1283
 						case 'street':
1284 1284
 							$sort_field_id .= '.1';
1285 1285
 							break;
@@ -1352,7 +1352,7 @@  discard block
 block discarded – undo
1352 1352
 		if ( ! class_exists( '\GV\Entry' ) ) {
1353 1353
 
1354 1354
 			// Not using gravityview()->log->error(), since that may not exist yet either!
1355
-			do_action( 'gravityview_log_error', '\GV\Entry not defined yet. Backtrace: ' . wp_debug_backtrace_summary()  );
1355
+			do_action( 'gravityview_log_error', '\GV\Entry not defined yet. Backtrace: ' . wp_debug_backtrace_summary() );
1356 1356
 
1357 1357
 			return null;
1358 1358
 		}
@@ -1369,7 +1369,7 @@  discard block
 block discarded – undo
1369 1369
 		 */
1370 1370
 		$single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry );
1371 1371
 
1372
-		if ( empty( $single_entry ) ){
1372
+		if ( empty( $single_entry ) ) {
1373 1373
 			return false;
1374 1374
 		} else {
1375 1375
 			return $single_entry;
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
 			$views = $this->getGvOutputData()->get_views();
1391 1391
 
1392 1392
 			foreach ( $views as $view_id => $data ) {
1393
-				$view = \GV\View::by_id( $data['id'] );
1393
+				$view = \GV\View::by_id( $data[ 'id' ] );
1394 1394
 				$view_id = $view->ID;
1395 1395
 				$template_id = gravityview_get_template_id( $view->ID );
1396 1396
 				$data = $view->as_data();
@@ -1399,7 +1399,7 @@  discard block
 block discarded – undo
1399 1399
 				 * Don't enqueue the scripts or styles if it's not going to be displayed.
1400 1400
 				 * @since 1.15
1401 1401
 				 */
1402
-				if( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
1402
+				if ( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
1403 1403
 					continue;
1404 1404
 				}
1405 1405
 
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
 					 * @param \GV\View The View.
1429 1429
 					 */
1430 1430
 					$js_dependency = apply_filters( 'gravityview_lightbox_script', $js_dependency, $view );
1431
-					$js_dependencies[] = $js_dependency;
1431
+					$js_dependencies[ ] = $js_dependency;
1432 1432
 
1433 1433
 					/**
1434 1434
 					 * @filter `gravity_view_lightbox_style` Modify the lightbox CSS slug. Default: `thickbox`
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
 					 * @param \GV\View The View.
1445 1445
 					 */
1446 1446
 					$css_dependency = apply_filters( 'gravityview_lightbox_style', $css_dependency, $view );
1447
-					$css_dependencies[] = $css_dependency;
1447
+					$css_dependencies[ ] = $css_dependency;
1448 1448
 				}
1449 1449
 
1450 1450
 				/**
@@ -1452,19 +1452,19 @@  discard block
 block discarded – undo
1452 1452
 				 * @see https://github.com/katzwebservices/GravityView/issues/536
1453 1453
 				 * @since 1.15
1454 1454
 				 */
1455
-				if( gravityview_view_has_single_checkbox_or_radio( $data['form'], $data['fields'] ) ) {
1456
-					$css_dependencies[] = 'dashicons';
1455
+				if ( gravityview_view_has_single_checkbox_or_radio( $data[ 'form' ], $data[ 'fields' ] ) ) {
1456
+					$css_dependencies[ ] = 'dashicons';
1457 1457
 				}
1458 1458
 
1459 1459
 				wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version, true );
1460 1460
 
1461 1461
 				$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
1462 1462
 
1463
-				wp_register_script( 'gravityview-fe-view', plugins_url( 'assets/js/fe-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), apply_filters( 'gravityview_js_dependencies', $js_dependencies ) , GravityView_Plugin::version, true );
1463
+				wp_register_script( 'gravityview-fe-view', plugins_url( 'assets/js/fe-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), apply_filters( 'gravityview_js_dependencies', $js_dependencies ), GravityView_Plugin::version, true );
1464 1464
 
1465 1465
 				wp_enqueue_script( 'gravityview-fe-view' );
1466 1466
 
1467
-				if ( ! empty( $data['atts']['sort_columns'] ) ) {
1467
+				if ( ! empty( $data[ 'atts' ][ 'sort_columns' ] ) ) {
1468 1468
 					wp_enqueue_style( 'gravityview_font', plugins_url( 'assets/css/font.css', GRAVITYVIEW_FILE ), $css_dependencies, GravityView_Plugin::version, 'all' );
1469 1469
 				}
1470 1470
 
@@ -1527,7 +1527,7 @@  discard block
 block discarded – undo
1527 1527
 	public static function add_style( $template_id ) {
1528 1528
 
1529 1529
 		if ( ! empty( $template_id ) && wp_style_is( 'gravityview_style_' . $template_id, 'registered' ) ) {
1530
-			gravityview()->log->debug(  'Adding extra template style for {template_id}', array( 'template_id' => $template_id ) );
1530
+			gravityview()->log->debug( 'Adding extra template style for {template_id}', array( 'template_id' => $template_id ) );
1531 1531
 			wp_enqueue_style( 'gravityview_style_' . $template_id );
1532 1532
 		} elseif ( empty( $template_id ) ) {
1533 1533
 			gravityview()->log->error( 'Cannot add template style; template_id is empty' );
@@ -1558,11 +1558,11 @@  discard block
 block discarded – undo
1558 1558
 		 * Not a table-based template; don't add sort icons
1559 1559
 		 * @since 1.12
1560 1560
 		 */
1561
-		if( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) {
1561
+		if ( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) {
1562 1562
 			return $label;
1563 1563
 		}
1564 1564
 
1565
-		if ( ! $this->is_field_sortable( $field['id'], $form ) ) {
1565
+		if ( ! $this->is_field_sortable( $field[ 'id' ], $form ) ) {
1566 1566
 			return $label;
1567 1567
 		}
1568 1568
 
@@ -1570,29 +1570,29 @@  discard block
 block discarded – undo
1570 1570
 
1571 1571
 		$class = 'gv-sort';
1572 1572
 
1573
-		$sort_field_id = self::_override_sorting_id_by_field_type( $field['id'], $form['id'] );
1573
+		$sort_field_id = self::_override_sorting_id_by_field_type( $field[ 'id' ], $form[ 'id' ] );
1574 1574
 
1575 1575
 		$sort_args = array(
1576
-			'sort' => $field['id'],
1576
+			'sort' => $field[ 'id' ],
1577 1577
 			'dir' => 'asc',
1578 1578
 		);
1579 1579
 
1580
-		if ( ! empty( $sorting['key'] ) && (string) $sort_field_id === (string) $sorting['key'] ) {
1580
+		if ( ! empty( $sorting[ 'key' ] ) && (string)$sort_field_id === (string)$sorting[ 'key' ] ) {
1581 1581
 			//toggle sorting direction.
1582
-			if ( 'asc' === $sorting['direction'] ) {
1583
-				$sort_args['dir'] = 'desc';
1582
+			if ( 'asc' === $sorting[ 'direction' ] ) {
1583
+				$sort_args[ 'dir' ] = 'desc';
1584 1584
 				$class .= ' gv-icon-sort-desc';
1585 1585
 			} else {
1586
-				$sort_args['dir'] = 'asc';
1586
+				$sort_args[ 'dir' ] = 'asc';
1587 1587
 				$class .= ' gv-icon-sort-asc';
1588 1588
 			}
1589 1589
 		} else {
1590 1590
 			$class .= ' gv-icon-caret-up-down';
1591 1591
 		}
1592 1592
 
1593
-		$url = add_query_arg( $sort_args, remove_query_arg( array('pagenum') ) );
1593
+		$url = add_query_arg( $sort_args, remove_query_arg( array( 'pagenum' ) ) );
1594 1594
 
1595
-		return '<a href="'. esc_url_raw( $url ) .'" class="'. $class .'" ></a>&nbsp;'. $label;
1595
+		return '<a href="' . esc_url_raw( $url ) . '" class="' . $class . '" ></a>&nbsp;' . $label;
1596 1596
 
1597 1597
 	}
1598 1598
 
@@ -1610,7 +1610,7 @@  discard block
 block discarded – undo
1610 1610
 
1611 1611
 		$field_type = $field_id;
1612 1612
 
1613
-		if( is_numeric( $field_id ) ) {
1613
+		if ( is_numeric( $field_id ) ) {
1614 1614
 			$field = GFFormsModel::get_field( $form, $field_id );
1615 1615
 			$field_type = $field ? $field->type : $field_id;
1616 1616
 		}
@@ -1633,7 +1633,7 @@  discard block
 block discarded – undo
1633 1633
 			return false;
1634 1634
 		}
1635 1635
 
1636
-		return apply_filters( "gravityview/sortable/formfield_{$form['id']}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) );
1636
+		return apply_filters( "gravityview/sortable/formfield_{$form[ 'id' ]}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) );
1637 1637
 
1638 1638
 	}
1639 1639
 
Please login to merge, or discard this patch.
trustedlogin/trustedlogin/client/src/Cron.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 namespace GravityView\TrustedLogin;
10 10
 
11 11
 // Exit if accessed directly
12
-if ( ! defined('ABSPATH') ) {
12
+if ( ! defined( 'ABSPATH' ) ) {
13 13
 	exit;
14 14
 }
15 15
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 		$unschedule_expiration = wp_clear_scheduled_hook( $this->hook_name, array( $site_identifier_hash ) );
92 92
 
93
-		if ( false === $unschedule_expiration ){
93
+		if ( false === $unschedule_expiration ) {
94 94
 			$this->logging->log( sprintf( 'Could not unschedule event for %s', $this->hook_name ), __METHOD__, 'error' );
95 95
 			return false;
96 96
 		}
Please login to merge, or discard this patch.
vendor/composer/ClassLoader.php 1 patch
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     /**
104 104
      * @param ?string $vendorDir
105 105
      */
106
-    public function __construct($vendorDir = null)
106
+    public function __construct( $vendorDir = null )
107 107
     {
108 108
         $this->vendorDir = $vendorDir;
109 109
     }
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function getPrefixes()
115 115
     {
116
-        if (!empty($this->prefixesPsr0)) {
117
-            return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
116
+        if ( ! empty( $this->prefixesPsr0 ) ) {
117
+            return call_user_func_array( 'array_merge', array_values( $this->prefixesPsr0 ) );
118 118
         }
119 119
 
120 120
         return array();
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
      *
163 163
      * @return void
164 164
      */
165
-    public function addClassMap(array $classMap)
165
+    public function addClassMap( array $classMap )
166 166
     {
167
-        if ($this->classMap) {
168
-            $this->classMap = array_merge($this->classMap, $classMap);
167
+        if ( $this->classMap ) {
168
+            $this->classMap = array_merge( $this->classMap, $classMap );
169 169
         } else {
170 170
             $this->classMap = $classMap;
171 171
         }
@@ -181,39 +181,39 @@  discard block
 block discarded – undo
181 181
      *
182 182
      * @return void
183 183
      */
184
-    public function add($prefix, $paths, $prepend = false)
184
+    public function add( $prefix, $paths, $prepend = false )
185 185
     {
186
-        if (!$prefix) {
187
-            if ($prepend) {
186
+        if ( ! $prefix ) {
187
+            if ( $prepend ) {
188 188
                 $this->fallbackDirsPsr0 = array_merge(
189
-                    (array) $paths,
189
+                    (array)$paths,
190 190
                     $this->fallbackDirsPsr0
191 191
                 );
192 192
             } else {
193 193
                 $this->fallbackDirsPsr0 = array_merge(
194 194
                     $this->fallbackDirsPsr0,
195
-                    (array) $paths
195
+                    (array)$paths
196 196
                 );
197 197
             }
198 198
 
199 199
             return;
200 200
         }
201 201
 
202
-        $first = $prefix[0];
203
-        if (!isset($this->prefixesPsr0[$first][$prefix])) {
204
-            $this->prefixesPsr0[$first][$prefix] = (array) $paths;
202
+        $first = $prefix[ 0 ];
203
+        if ( ! isset( $this->prefixesPsr0[ $first ][ $prefix ] ) ) {
204
+            $this->prefixesPsr0[ $first ][ $prefix ] = (array)$paths;
205 205
 
206 206
             return;
207 207
         }
208
-        if ($prepend) {
209
-            $this->prefixesPsr0[$first][$prefix] = array_merge(
210
-                (array) $paths,
211
-                $this->prefixesPsr0[$first][$prefix]
208
+        if ( $prepend ) {
209
+            $this->prefixesPsr0[ $first ][ $prefix ] = array_merge(
210
+                (array)$paths,
211
+                $this->prefixesPsr0[ $first ][ $prefix ]
212 212
             );
213 213
         } else {
214
-            $this->prefixesPsr0[$first][$prefix] = array_merge(
215
-                $this->prefixesPsr0[$first][$prefix],
216
-                (array) $paths
214
+            $this->prefixesPsr0[ $first ][ $prefix ] = array_merge(
215
+                $this->prefixesPsr0[ $first ][ $prefix ],
216
+                (array)$paths
217 217
             );
218 218
         }
219 219
     }
@@ -230,40 +230,40 @@  discard block
 block discarded – undo
230 230
      *
231 231
      * @return void
232 232
      */
233
-    public function addPsr4($prefix, $paths, $prepend = false)
233
+    public function addPsr4( $prefix, $paths, $prepend = false )
234 234
     {
235
-        if (!$prefix) {
235
+        if ( ! $prefix ) {
236 236
             // Register directories for the root namespace.
237
-            if ($prepend) {
237
+            if ( $prepend ) {
238 238
                 $this->fallbackDirsPsr4 = array_merge(
239
-                    (array) $paths,
239
+                    (array)$paths,
240 240
                     $this->fallbackDirsPsr4
241 241
                 );
242 242
             } else {
243 243
                 $this->fallbackDirsPsr4 = array_merge(
244 244
                     $this->fallbackDirsPsr4,
245
-                    (array) $paths
245
+                    (array)$paths
246 246
                 );
247 247
             }
248
-        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
248
+        } elseif ( ! isset( $this->prefixDirsPsr4[ $prefix ] ) ) {
249 249
             // Register directories for a new namespace.
250
-            $length = strlen($prefix);
251
-            if ('\\' !== $prefix[$length - 1]) {
252
-                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
250
+            $length = strlen( $prefix );
251
+            if ( '\\' !== $prefix[ $length - 1 ] ) {
252
+                throw new \InvalidArgumentException( "A non-empty PSR-4 prefix must end with a namespace separator." );
253 253
             }
254
-            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
255
-            $this->prefixDirsPsr4[$prefix] = (array) $paths;
256
-        } elseif ($prepend) {
254
+            $this->prefixLengthsPsr4[ $prefix[ 0 ] ][ $prefix ] = $length;
255
+            $this->prefixDirsPsr4[ $prefix ] = (array)$paths;
256
+        } elseif ( $prepend ) {
257 257
             // Prepend directories for an already registered namespace.
258
-            $this->prefixDirsPsr4[$prefix] = array_merge(
259
-                (array) $paths,
260
-                $this->prefixDirsPsr4[$prefix]
258
+            $this->prefixDirsPsr4[ $prefix ] = array_merge(
259
+                (array)$paths,
260
+                $this->prefixDirsPsr4[ $prefix ]
261 261
             );
262 262
         } else {
263 263
             // Append directories for an already registered namespace.
264
-            $this->prefixDirsPsr4[$prefix] = array_merge(
265
-                $this->prefixDirsPsr4[$prefix],
266
-                (array) $paths
264
+            $this->prefixDirsPsr4[ $prefix ] = array_merge(
265
+                $this->prefixDirsPsr4[ $prefix ],
266
+                (array)$paths
267 267
             );
268 268
         }
269 269
     }
@@ -277,12 +277,12 @@  discard block
 block discarded – undo
277 277
      *
278 278
      * @return void
279 279
      */
280
-    public function set($prefix, $paths)
280
+    public function set( $prefix, $paths )
281 281
     {
282
-        if (!$prefix) {
283
-            $this->fallbackDirsPsr0 = (array) $paths;
282
+        if ( ! $prefix ) {
283
+            $this->fallbackDirsPsr0 = (array)$paths;
284 284
         } else {
285
-            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
285
+            $this->prefixesPsr0[ $prefix[ 0 ] ][ $prefix ] = (array)$paths;
286 286
         }
287 287
     }
288 288
 
@@ -297,17 +297,17 @@  discard block
 block discarded – undo
297 297
      *
298 298
      * @return void
299 299
      */
300
-    public function setPsr4($prefix, $paths)
300
+    public function setPsr4( $prefix, $paths )
301 301
     {
302
-        if (!$prefix) {
303
-            $this->fallbackDirsPsr4 = (array) $paths;
302
+        if ( ! $prefix ) {
303
+            $this->fallbackDirsPsr4 = (array)$paths;
304 304
         } else {
305
-            $length = strlen($prefix);
306
-            if ('\\' !== $prefix[$length - 1]) {
307
-                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
305
+            $length = strlen( $prefix );
306
+            if ( '\\' !== $prefix[ $length - 1 ] ) {
307
+                throw new \InvalidArgumentException( "A non-empty PSR-4 prefix must end with a namespace separator." );
308 308
             }
309
-            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
310
-            $this->prefixDirsPsr4[$prefix] = (array) $paths;
309
+            $this->prefixLengthsPsr4[ $prefix[ 0 ] ][ $prefix ] = $length;
310
+            $this->prefixDirsPsr4[ $prefix ] = (array)$paths;
311 311
         }
312 312
     }
313 313
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
      *
319 319
      * @return void
320 320
      */
321
-    public function setUseIncludePath($useIncludePath)
321
+    public function setUseIncludePath( $useIncludePath )
322 322
     {
323 323
         $this->useIncludePath = $useIncludePath;
324 324
     }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
      *
343 343
      * @return void
344 344
      */
345
-    public function setClassMapAuthoritative($classMapAuthoritative)
345
+    public function setClassMapAuthoritative( $classMapAuthoritative )
346 346
     {
347 347
         $this->classMapAuthoritative = $classMapAuthoritative;
348 348
     }
@@ -364,9 +364,9 @@  discard block
 block discarded – undo
364 364
      *
365 365
      * @return void
366 366
      */
367
-    public function setApcuPrefix($apcuPrefix)
367
+    public function setApcuPrefix( $apcuPrefix )
368 368
     {
369
-        $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
369
+        $this->apcuPrefix = function_exists( 'apcu_fetch' ) && filter_var( ini_get( 'apc.enabled' ), FILTER_VALIDATE_BOOLEAN ) ? $apcuPrefix : null;
370 370
     }
371 371
 
372 372
     /**
@@ -386,19 +386,19 @@  discard block
 block discarded – undo
386 386
      *
387 387
      * @return void
388 388
      */
389
-    public function register($prepend = false)
389
+    public function register( $prepend = false )
390 390
     {
391
-        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
391
+        spl_autoload_register( array( $this, 'loadClass' ), true, $prepend );
392 392
 
393
-        if (null === $this->vendorDir) {
393
+        if ( null === $this->vendorDir ) {
394 394
             return;
395 395
         }
396 396
 
397
-        if ($prepend) {
398
-            self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
397
+        if ( $prepend ) {
398
+            self::$registeredLoaders = array( $this->vendorDir => $this ) + self::$registeredLoaders;
399 399
         } else {
400
-            unset(self::$registeredLoaders[$this->vendorDir]);
401
-            self::$registeredLoaders[$this->vendorDir] = $this;
400
+            unset( self::$registeredLoaders[ $this->vendorDir ] );
401
+            self::$registeredLoaders[ $this->vendorDir ] = $this;
402 402
         }
403 403
     }
404 404
 
@@ -409,10 +409,10 @@  discard block
 block discarded – undo
409 409
      */
410 410
     public function unregister()
411 411
     {
412
-        spl_autoload_unregister(array($this, 'loadClass'));
412
+        spl_autoload_unregister( array( $this, 'loadClass' ) );
413 413
 
414
-        if (null !== $this->vendorDir) {
415
-            unset(self::$registeredLoaders[$this->vendorDir]);
414
+        if ( null !== $this->vendorDir ) {
415
+            unset( self::$registeredLoaders[ $this->vendorDir ] );
416 416
         }
417 417
     }
418 418
 
@@ -422,10 +422,10 @@  discard block
 block discarded – undo
422 422
      * @param  string    $class The name of the class
423 423
      * @return true|null True if loaded, null otherwise
424 424
      */
425
-    public function loadClass($class)
425
+    public function loadClass( $class )
426 426
     {
427
-        if ($file = $this->findFile($class)) {
428
-            includeFile($file);
427
+        if ( $file = $this->findFile( $class ) ) {
428
+            includeFile( $file );
429 429
 
430 430
             return true;
431 431
         }
@@ -440,36 +440,36 @@  discard block
 block discarded – undo
440 440
      *
441 441
      * @return string|false The path if found, false otherwise
442 442
      */
443
-    public function findFile($class)
443
+    public function findFile( $class )
444 444
     {
445 445
         // class map lookup
446
-        if (isset($this->classMap[$class])) {
447
-            return $this->classMap[$class];
446
+        if ( isset( $this->classMap[ $class ] ) ) {
447
+            return $this->classMap[ $class ];
448 448
         }
449
-        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
449
+        if ( $this->classMapAuthoritative || isset( $this->missingClasses[ $class ] ) ) {
450 450
             return false;
451 451
         }
452
-        if (null !== $this->apcuPrefix) {
453
-            $file = apcu_fetch($this->apcuPrefix.$class, $hit);
454
-            if ($hit) {
452
+        if ( null !== $this->apcuPrefix ) {
453
+            $file = apcu_fetch( $this->apcuPrefix . $class, $hit );
454
+            if ( $hit ) {
455 455
                 return $file;
456 456
             }
457 457
         }
458 458
 
459
-        $file = $this->findFileWithExtension($class, '.php');
459
+        $file = $this->findFileWithExtension( $class, '.php' );
460 460
 
461 461
         // Search for Hack files if we are running on HHVM
462
-        if (false === $file && defined('HHVM_VERSION')) {
463
-            $file = $this->findFileWithExtension($class, '.hh');
462
+        if ( false === $file && defined( 'HHVM_VERSION' ) ) {
463
+            $file = $this->findFileWithExtension( $class, '.hh' );
464 464
         }
465 465
 
466
-        if (null !== $this->apcuPrefix) {
467
-            apcu_add($this->apcuPrefix.$class, $file);
466
+        if ( null !== $this->apcuPrefix ) {
467
+            apcu_add( $this->apcuPrefix . $class, $file );
468 468
         }
469 469
 
470
-        if (false === $file) {
470
+        if ( false === $file ) {
471 471
             // Remember that this class does not exist.
472
-            $this->missingClasses[$class] = true;
472
+            $this->missingClasses[ $class ] = true;
473 473
         }
474 474
 
475 475
         return $file;
@@ -490,21 +490,21 @@  discard block
 block discarded – undo
490 490
      * @param  string       $ext
491 491
      * @return string|false
492 492
      */
493
-    private function findFileWithExtension($class, $ext)
493
+    private function findFileWithExtension( $class, $ext )
494 494
     {
495 495
         // PSR-4 lookup
496
-        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
496
+        $logicalPathPsr4 = strtr( $class, '\\', DIRECTORY_SEPARATOR ) . $ext;
497 497
 
498
-        $first = $class[0];
499
-        if (isset($this->prefixLengthsPsr4[$first])) {
498
+        $first = $class[ 0 ];
499
+        if ( isset( $this->prefixLengthsPsr4[ $first ] ) ) {
500 500
             $subPath = $class;
501
-            while (false !== $lastPos = strrpos($subPath, '\\')) {
502
-                $subPath = substr($subPath, 0, $lastPos);
501
+            while ( false !== $lastPos = strrpos( $subPath, '\\' ) ) {
502
+                $subPath = substr( $subPath, 0, $lastPos );
503 503
                 $search = $subPath . '\\';
504
-                if (isset($this->prefixDirsPsr4[$search])) {
505
-                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
506
-                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
507
-                        if (file_exists($file = $dir . $pathEnd)) {
504
+                if ( isset( $this->prefixDirsPsr4[ $search ] ) ) {
505
+                    $pathEnd = DIRECTORY_SEPARATOR . substr( $logicalPathPsr4, $lastPos + 1 );
506
+                    foreach ( $this->prefixDirsPsr4[ $search ] as $dir ) {
507
+                        if ( file_exists( $file = $dir . $pathEnd ) ) {
508 508
                             return $file;
509 509
                         }
510 510
                     }
@@ -513,27 +513,27 @@  discard block
 block discarded – undo
513 513
         }
514 514
 
515 515
         // PSR-4 fallback dirs
516
-        foreach ($this->fallbackDirsPsr4 as $dir) {
517
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
516
+        foreach ( $this->fallbackDirsPsr4 as $dir ) {
517
+            if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4 ) ) {
518 518
                 return $file;
519 519
             }
520 520
         }
521 521
 
522 522
         // PSR-0 lookup
523
-        if (false !== $pos = strrpos($class, '\\')) {
523
+        if ( false !== $pos = strrpos( $class, '\\' ) ) {
524 524
             // namespaced class name
525
-            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
526
-                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
525
+            $logicalPathPsr0 = substr( $logicalPathPsr4, 0, $pos + 1 )
526
+                . strtr( substr( $logicalPathPsr4, $pos + 1 ), '_', DIRECTORY_SEPARATOR );
527 527
         } else {
528 528
             // PEAR-like class name
529
-            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
529
+            $logicalPathPsr0 = strtr( $class, '_', DIRECTORY_SEPARATOR ) . $ext;
530 530
         }
531 531
 
532
-        if (isset($this->prefixesPsr0[$first])) {
533
-            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
534
-                if (0 === strpos($class, $prefix)) {
535
-                    foreach ($dirs as $dir) {
536
-                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
532
+        if ( isset( $this->prefixesPsr0[ $first ] ) ) {
533
+            foreach ( $this->prefixesPsr0[ $first ] as $prefix => $dirs ) {
534
+                if ( 0 === strpos( $class, $prefix ) ) {
535
+                    foreach ( $dirs as $dir ) {
536
+                        if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0 ) ) {
537 537
                             return $file;
538 538
                         }
539 539
                     }
@@ -542,14 +542,14 @@  discard block
 block discarded – undo
542 542
         }
543 543
 
544 544
         // PSR-0 fallback dirs
545
-        foreach ($this->fallbackDirsPsr0 as $dir) {
546
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
545
+        foreach ( $this->fallbackDirsPsr0 as $dir ) {
546
+            if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0 ) ) {
547 547
                 return $file;
548 548
             }
549 549
         }
550 550
 
551 551
         // PSR-0 include paths.
552
-        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
552
+        if ( $this->useIncludePath && $file = stream_resolve_include_path( $logicalPathPsr0 ) ) {
553 553
             return $file;
554 554
         }
555 555
 
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
  * @return void
567 567
  * @private
568 568
  */
569
-function includeFile($file)
569
+function includeFile( $file )
570 570
 {
571 571
     include $file;
572 572
 }
Please login to merge, or discard this patch.