Passed
Push — master ( ecb0f6...008868 )
by Paul
04:35
created
views/pages/addons/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 				'title' => 'Tripadvisor Reviews',
14 14
 			],
15 15
 			'plugin' => 'site-reviews-tripadvisor/site-reviews-tripadvisor.php',
16
-		]);
16
+		] );
17 17
 		$template->render( 'partials/addons/addon', [
18 18
 			'context' => [
19 19
 				'description' => __( 'Sync your Yelp reviews and display them on your site.', 'site-reviews' ),
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 				'title' => 'Yelp Reviews',
23 23
 			],
24 24
 			'plugin' => 'site-reviews-yelp/site-reviews-yelp.php',
25
-		]);
25
+		] );
26 26
 	?>
27 27
 	</div>
28 28
 </div>
Please login to merge, or discard this patch.
activate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		$this->versions = wp_parse_args( $versions, array(
31 31
 			'php' => static::MIN_PHP_VERSION,
32 32
 			'wordpress' => static::MIN_WORDPRESS_VERSION,
33
-		));
33
+		) );
34 34
 	}
35 35
 
36 36
 	/**
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 		if( $this->isValid() ) {
42 42
 			return true;
43 43
 		}
44
-		add_action( 'activated_plugin', array( $this, 'deactivate' ));
45
-		add_action( 'admin_notices', array( $this, 'deactivate' ));
44
+		add_action( 'activated_plugin', array( $this, 'deactivate' ) );
45
+		add_action( 'admin_notices', array( $this, 'deactivate' ) );
46 46
 		return false;
47 47
 	}
48 48
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 			filter_input( INPUT_GET, 'plugin_status' ),
138 138
 			filter_input( INPUT_GET, 'paged' ),
139 139
 			filter_input( INPUT_GET, 's' )
140
-		)));
140
+		) ) );
141 141
 		exit;
142 142
 	}
143 143
 }
Please login to merge, or discard this patch.
site-reviews.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 defined( 'WPINC' ) || die;
20 20
 
21
-if( !class_exists( 'GL_Plugin_Check_v3' )) {
21
+if( !class_exists( 'GL_Plugin_Check_v3' ) ) {
22 22
 	require_once __DIR__.'/activate.php';
23 23
 }
24 24
 if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() )return;
@@ -27,6 +27,6 @@  discard block
 block discarded – undo
27 27
 
28 28
 $app = new GeminiLabs\SiteReviews\Application;
29 29
 $app->make( 'Provider' )->register( $app );
30
-register_activation_hook( __FILE__, array( $app, 'activate' ));
31
-register_deactivation_hook( __FILE__, array( $app, 'deactivate' ));
30
+register_activation_hook( __FILE__, array( $app, 'activate' ) );
31
+register_deactivation_hook( __FILE__, array( $app, 'deactivate' ) );
32 32
 $app->init();
Please login to merge, or discard this patch.
plugin/Modules/Schema/BaseType.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function __call( $method, array $arguments )
41 41
 	{
42
-		$value = isset( $arguments[0] )
42
+		$value = isset($arguments[0])
43 43
 			? $arguments[0]
44 44
 			: '';
45 45
 		return $this->setProperty( $method, $value );
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
 	 * @param mixed $default
97 97
 	 * @return mixed
98 98
 	 */
99
-	public function getProperty( $property, $default = null)
99
+	public function getProperty( $property, $default = null )
100 100
 	{
101
-		return isset( $this->properties[$property] )
101
+		return isset($this->properties[$property])
102 102
 			? $this->properties[$property]
103 103
 			: $default;
104 104
 	}
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 */
167 167
 	public function offsetUnset( $offset )
168 168
 	{
169
-		unset( $this->properties[$offset] );
169
+		unset($this->properties[$offset]);
170 170
 	}
171 171
 
172 172
 	/**
@@ -212,16 +212,16 @@  discard block
 block discarded – undo
212 212
 	 */
213 213
 	protected function getParents( $parents = null )
214 214
 	{
215
-		if( !isset( $parents )) {
215
+		if( !isset($parents) ) {
216 216
 			$parents = $this->parents;
217 217
 		}
218 218
 		$newParents = $parents;
219 219
 		foreach( $parents as $parent ) {
220 220
 			$parentClass = glsr( Helper::class )->buildClassName( $parent, __NAMESPACE__ );
221
-			if( !class_exists( $parentClass ))continue;
222
-			$newParents = array_merge( $newParents, $this->getParents( (new $parentClass)->parents ));
221
+			if( !class_exists( $parentClass ) )continue;
222
+			$newParents = array_merge( $newParents, $this->getParents( (new $parentClass)->parents ) );
223 223
 		}
224
-		return array_values( array_unique( $newParents ));
224
+		return array_values( array_unique( $newParents ) );
225 225
 	}
226 226
 
227 227
 	/**
@@ -232,8 +232,8 @@  discard block
 block discarded – undo
232 232
 		$parents = $this->getParents();
233 233
 		foreach( $parents as $parent ) {
234 234
 			$parentClass = glsr( Helper::class )->buildClassName( $parent, __NAMESPACE__ );
235
-			if( !class_exists( $parentClass ))continue;
236
-			$this->allowed = array_values( array_unique( array_merge( (new $parentClass)->allowed, $this->allowed )));
235
+			if( !class_exists( $parentClass ) )continue;
236
+			$this->allowed = array_values( array_unique( array_merge( (new $parentClass)->allowed, $this->allowed ) ) );
237 237
 		}
238 238
 	}
239 239
 
@@ -243,17 +243,17 @@  discard block
 block discarded – undo
243 243
 	 */
244 244
 	protected function serializeProperty( $property )
245 245
 	{
246
-		if( is_array( $property )) {
246
+		if( is_array( $property ) ) {
247 247
 			return array_map( [$this, 'serializeProperty'], $property );
248 248
 		}
249 249
 		if( $property instanceof Type ) {
250 250
 			$property = $property->toArray();
251
-			unset( $property['@context'] );
251
+			unset($property['@context']);
252 252
 		}
253 253
 		if( $property instanceof DateTimeInterface ) {
254 254
 			$property = $property->format( DateTime::ATOM );
255 255
 		}
256
-		if( is_object( $property )) {
256
+		if( is_object( $property ) ) {
257 257
 			throw new InvalidProperty();
258 258
 		}
259 259
 		return $property;
Please login to merge, or discard this patch.
plugin/Modules/System.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 			'setting' => 'Plugin Settings',
39 39
 			'reviews' => 'Review Counts',
40 40
 		];
41
-		$systemInfo = array_reduce( array_keys( $details ), function( $carry, $key ) use( $details ) {
41
+		$systemInfo = array_reduce( array_keys( $details ), function( $carry, $key ) use($details) {
42 42
 			$methodName = glsr( Helper::class )->buildMethodName( 'get-'.$key.'-details' );
43 43
 			if( method_exists( $this, $methodName ) && $systemDetails = $this->$methodName() ) {
44 44
 				return $carry.$this->implode( $details[$key], $systemDetails );
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 	{
56 56
 		$plugins = get_plugins();
57 57
 		$activePlugins = (array)get_option( 'active_plugins', [] );
58
-		$inactive = array_diff_key( $plugins, array_flip( $activePlugins ));
59
-		return $this->normalizePluginList( array_diff_key( $plugins, $inactive ));
58
+		$inactive = array_diff_key( $plugins, array_flip( $activePlugins ) );
59
+		return $this->normalizePluginList( array_diff_key( $plugins, $inactive ) );
60 60
 	}
61 61
 
62 62
 	/**
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	public function getInactivePluginDetails()
81 81
 	{
82 82
 		$activePlugins = (array)get_option( 'active_plugins', [] );
83
-		return $this->normalizePluginList( array_diff_key( get_plugins(), array_flip( $activePlugins )));
83
+		return $this->normalizePluginList( array_diff_key( get_plugins(), array_flip( $activePlugins ) ) );
84 84
 	}
85 85
 
86 86
 	/**
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 	{
91 91
 		$plugins = array_merge(
92 92
 			get_mu_plugins(),
93
-			get_plugins( '/../'.basename( WPMU_PLUGIN_DIR ))
93
+			get_plugins( '/../'.basename( WPMU_PLUGIN_DIR ) )
94 94
 		);
95
-		if( empty( $plugins ))return;
95
+		if( empty($plugins) )return;
96 96
 		return $this->normalizePluginList( $plugins );
97 97
 	}
98 98
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 */
102 102
 	public function getMultisitePluginDetails()
103 103
 	{
104
-		if( !is_multisite() || empty( get_site_option( 'active_sitewide_plugins', [] )))return;
104
+		if( !is_multisite() || empty(get_site_option( 'active_sitewide_plugins', [] )) )return;
105 105
 		return $this->normalizePluginList( wp_get_active_network_plugins() );
106 106
 	}
107 107
 
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 			'Max Input Vars' => ini_get( 'max_input_vars' ),
128 128
 			'Memory Limit' => ini_get( 'memory_limit' ),
129 129
 			'Post Max Size' => ini_get( 'post_max_size' ),
130
-			'Session Cookie Path' => esc_html( ini_get( 'session.cookie_path' )),
131
-			'Session Name' => esc_html( ini_get( 'session.name' )),
132
-			'Session Save Path' => esc_html( ini_get( 'session.save_path' )),
133
-			'Session Use Cookies' => var_export( wp_validate_boolean( ini_get( 'session.use_cookies' )), true ),
134
-			'Session Use Only Cookies' => var_export( wp_validate_boolean( ini_get( 'session.use_only_cookies' )), true ),
130
+			'Session Cookie Path' => esc_html( ini_get( 'session.cookie_path' ) ),
131
+			'Session Name' => esc_html( ini_get( 'session.name' ) ),
132
+			'Session Save Path' => esc_html( ini_get( 'session.save_path' ) ),
133
+			'Session Use Cookies' => var_export( wp_validate_boolean( ini_get( 'session.use_cookies' ) ), true ),
134
+			'Session Use Only Cookies' => var_export( wp_validate_boolean( ini_get( 'session.use_only_cookies' ) ), true ),
135 135
 			'Upload Max Filesize' => ini_get( 'upload_max_filesize' ),
136 136
 		];
137 137
 	}
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
 		ksort( $settings );
177 177
 		$details = [];
178 178
 		foreach( $settings as $key => $value ) {
179
-			if( $helper->startsWith( 'strings', $key ) && $helper->endsWith( 'id', $key ))continue;
180
-			$value = htmlspecialchars( trim( preg_replace('/\s\s+/', '\\n', $value )), ENT_QUOTES, 'UTF-8' );
179
+			if( $helper->startsWith( 'strings', $key ) && $helper->endsWith( 'id', $key ) )continue;
180
+			$value = htmlspecialchars( trim( preg_replace( '/\s\s+/', '\\n', $value ) ), ENT_QUOTES, 'UTF-8' );
181 181
 			$details[$key] = $value;
182 182
 		}
183 183
 		return $details;
@@ -249,10 +249,10 @@  discard block
 block discarded – undo
249 249
 			'WPE_APIKEY' => 'WP Engine',
250 250
 		];
251 251
 		foreach( $checks as $key => $value ) {
252
-			if( !$this->isWebhostCheckValid( $key ))continue;
252
+			if( !$this->isWebhostCheckValid( $key ) )continue;
253 253
 			return $value;
254 254
 		}
255
-		return implode( ',', array_filter( [DB_HOST, filter_input( INPUT_SERVER, 'SERVER_NAME' )] ));
255
+		return implode( ',', array_filter( [DB_HOST, filter_input( INPUT_SERVER, 'SERVER_NAME' )] ) );
256 256
 	}
257 257
 
258 258
 	/**
@@ -273,8 +273,8 @@  discard block
 block discarded – undo
273 273
 	{
274 274
 		$plugins = get_plugins();
275 275
 		$activePlugins = (array)get_option( 'active_plugins', [] );
276
-		$inactive = $this->normalizePluginList( array_diff_key( $plugins, array_flip( $activePlugins )));
277
-		$active = $this->normalizePluginList( array_diff_key( $plugins, $inactive ));
276
+		$inactive = $this->normalizePluginList( array_diff_key( $plugins, array_flip( $activePlugins ) ) );
277
+		$active = $this->normalizePluginList( array_diff_key( $plugins, $inactive ) );
278 278
 		return $active + $inactive;
279 279
 	}
280 280
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	protected function implode( $title, array $details )
286 286
 	{
287 287
 		$strings = ['['.$title.']'];
288
-		$padding = max( array_map( 'strlen', array_keys( $details )) );
288
+		$padding = max( array_map( 'strlen', array_keys( $details ) ) );
289 289
 		$padding = max( [$padding, static::PAD] );
290 290
 		foreach( $details as $key => $value ) {
291 291
 			$strings[] = is_string( $key )
@@ -328,9 +328,9 @@  discard block
 block discarded – undo
328 328
 		$keys = [
329 329
 			'licenses.', 'submissions.recaptcha.key', 'submissions.recaptcha.secret',
330 330
 		];
331
-		array_walk( $settings, function( &$value, $setting ) use( $keys ) {
331
+		array_walk( $settings, function( &$value, $setting ) use($keys) {
332 332
 			foreach( $keys as $key ) {
333
-				if( !glsr( Helper::class )->startsWith( $key, $setting ) || empty( $value ))continue;
333
+				if( !glsr( Helper::class )->startsWith( $key, $setting ) || empty($value) )continue;
334 334
 				$value = str_repeat( '•', 13 );
335 335
 				return;
336 336
 			}
Please login to merge, or discard this patch.
plugin/Controllers/ListTableController.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function approve()
23 23
 	{
24
-		check_admin_referer( 'approve-review_'.( $postId = $this->getPostId() ));
25
-		wp_update_post([
24
+		check_admin_referer( 'approve-review_'.($postId = $this->getPostId()) );
25
+		wp_update_post( [
26 26
 			'ID' => $postId,
27 27
 			'post_status' => 'publish',
28
-		]);
28
+		] );
29 29
 		wp_safe_redirect( wp_get_referer() );
30 30
 		exit;
31 31
 	}
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 	{
55 55
 		$postTypeColumns = glsr()->postTypeColumns[Application::POST_TYPE];
56 56
 		foreach( $postTypeColumns as $key => &$value ) {
57
-			if( !array_key_exists( $key, $columns ) || !empty( $value ))continue;
57
+			if( !array_key_exists( $key, $columns ) || !empty($value) )continue;
58 58
 			$value = $columns[$key];
59 59
 		}
60
-		if( count( glsr( Database::class )->getReviewsMeta( 'review_type' )) < 2 ) {
61
-			unset( $postTypeColumns['review_type'] );
60
+		if( count( glsr( Database::class )->getReviewsMeta( 'review_type' ) ) < 2 ) {
61
+			unset($postTypeColumns['review_type']);
62 62
 		}
63 63
 		return array_filter( $postTypeColumns, 'strlen' );
64 64
 	}
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function filterPostStates( array $postStates, WP_Post $post ) {
96 96
 		if( $post->post_type == Application::POST_TYPE
97
-			&& array_key_exists( 'pending', $postStates )) {
97
+			&& array_key_exists( 'pending', $postStates ) ) {
98 98
 			$postStates['pending'] = __( 'Unapproved', 'site-reviews' );
99 99
 		}
100 100
 		return $postStates;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		if( $post->post_type != Application::POST_TYPE || $post->post_status == 'trash' ) {
110 110
 			return $actions;
111 111
 		}
112
-		unset( $actions['inline hide-if-no-js'] ); //Remove Quick-edit
112
+		unset($actions['inline hide-if-no-js']); //Remove Quick-edit
113 113
 		$rowActions = [
114 114
 			'approve' => esc_attr__( 'Approve', 'site-reviews' ),
115 115
 			'unapprove' => esc_attr__( 'Unapprove', 'site-reviews' ),
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 					admin_url( 'post.php?post='.$post->ID.'&action='.$key ),
124 124
 					$key.'-review_'.$post->ID
125 125
 				),
126
-			]);
126
+			] );
127 127
 		}
128 128
 		return $newActions + $actions;
129 129
 	}
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
 	public function filterSortableColumns( array $columns )
136 136
 	{
137 137
 		$postTypeColumns = glsr()->postTypeColumns[Application::POST_TYPE];
138
-		unset( $postTypeColumns['cb'] );
138
+		unset($postTypeColumns['cb']);
139 139
 		foreach( $postTypeColumns as $key => $value ) {
140
-			if( glsr( Helper::class )->startsWith( 'taxonomy', $key ))continue;
140
+			if( glsr( Helper::class )->startsWith( 'taxonomy', $key ) )continue;
141 141
 			$columns[$key] = $key;
142 142
 		}
143 143
 		return $columns;
@@ -155,18 +155,18 @@  discard block
 block discarded – undo
155 155
 	 */
156 156
 	public function filterStatusText( $translation, $single, $plural, $number, $domain )
157 157
 	{
158
-		if( $this->canModifyTranslation( $domain )) {
158
+		if( $this->canModifyTranslation( $domain ) ) {
159 159
 			$strings = [
160 160
 				'Published' => __( 'Approved', 'site-reviews' ),
161 161
 				'Pending' => __( 'Unapproved', 'site-reviews' ),
162 162
 			];
163 163
 			foreach( $strings as $search => $replace ) {
164 164
 				if( strpos( $single, $search ) === false )continue;
165
-				$translation = $this->getTranslation([
165
+				$translation = $this->getTranslation( [
166 166
 					'number' => $number,
167 167
 					'plural' => str_replace( $search, $replace, $plural ),
168 168
 					'single' => str_replace( $search, $replace, $single ),
169
-				]);
169
+				] );
170 170
 			}
171 171
 		}
172 172
 		return $translation;
@@ -213,9 +213,9 @@  discard block
 block discarded – undo
213 213
 	 */
214 214
 	public function saveBulkEditFields( $postId )
215 215
 	{
216
-		if( !current_user_can( 'edit_posts' ))return;
216
+		if( !current_user_can( 'edit_posts' ) )return;
217 217
 		$assignedTo = filter_input( INPUT_GET, 'assigned_to' );
218
-		if( $assignedTo && get_post( $assignedTo )) {
218
+		if( $assignedTo && get_post( $assignedTo ) ) {
219 219
 			update_post_meta( $postId, 'assigned_to', $assignedTo );
220 220
 		}
221 221
 	}
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
 	 */
227 227
 	public function setQueryForColumn( WP_Query $query )
228 228
 	{
229
-		if( !$this->hasPermission( $query ))return;
229
+		if( !$this->hasPermission( $query ) )return;
230 230
 		$this->setMetaQuery( $query, [
231 231
 			'rating', 'review_type',
232
-		]);
232
+		] );
233 233
 		$this->setOrderby( $query );
234 234
 	}
235 235
 
@@ -239,11 +239,11 @@  discard block
 block discarded – undo
239 239
 	 */
240 240
 	public function unapprove()
241 241
 	{
242
-		check_admin_referer( 'unapprove-review_'.( $postId = $this->getPostId() ));
243
-		wp_update_post([
242
+		check_admin_referer( 'unapprove-review_'.($postId = $this->getPostId()) );
243
+		wp_update_post( [
244 244
 			'ID' => $postId,
245 245
 			'post_status' => 'pending',
246
-		]);
246
+		] );
247 247
 		wp_safe_redirect( wp_get_referer() );
248 248
 		exit;
249 249
 	}
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 			'single' => '',
274 274
 			'text' => '',
275 275
 		];
276
-		$args = (object) wp_parse_args( $args, $defaults );
276
+		$args = (object)wp_parse_args( $args, $defaults );
277 277
 		$translations = get_translations_for_domain( Application::ID );
278 278
 		return $args->text
279 279
 			? $translations->translate( $args->text )
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 	protected function setMetaQuery( WP_Query $query, array $metaKeys )
299 299
 	{
300 300
 		foreach( $metaKeys as $key ) {
301
-			if( !( $value = filter_input( INPUT_GET, $key )))continue;
301
+			if( !($value = filter_input( INPUT_GET, $key )) )continue;
302 302
 			$metaQuery = (array)$query->get( 'meta_query' );
303 303
 			$metaQuery[] = [
304 304
 				'key' => $key,
@@ -315,8 +315,8 @@  discard block
 block discarded – undo
315 315
 	{
316 316
 		$orderby = $query->get( 'orderby' );
317 317
 		$columns = glsr()->postTypeColumns[Application::POST_TYPE];
318
-		unset( $columns['cb'], $columns['title'], $columns['date'] );
319
-		if( in_array( $orderby, array_keys( $columns ))) {
318
+		unset($columns['cb'], $columns['title'], $columns['date']);
319
+		if( in_array( $orderby, array_keys( $columns ) ) ) {
320 320
 			$query->set( 'meta_key', $orderby );
321 321
 			$query->set( 'orderby', 'meta_value' );
322 322
 		}
Please login to merge, or discard this patch.
plugin/Database.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	public function getAssignedToPost( $postId, $assignedTo = '' )
22 22
 	{
23
-		if( empty( $assignedTo )) {
23
+		if( empty($assignedTo) ) {
24 24
 			$assignedTo = get_post_meta( $postId, 'assigned_to', true );
25 25
 		}
26
-		if( empty( $assignedTo ))return;
26
+		if( empty($assignedTo) )return;
27 27
 		$assignedPost = get_post( $assignedTo );
28 28
 		if( $assignedPost instanceof WP_Post && $assignedPost->ID != $postId ) {
29 29
 			return $assignedPost;
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		if( !$metaValue ) {
45 45
 			return $counts;
46 46
 		}
47
-		return isset( $counts[$metaValue] )
47
+		return isset($counts[$metaValue])
48 48
 			? $counts[$metaValue]
49 49
 			: 0;
50 50
 	}
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	public function getReviewsMeta( $key, $status = 'publish' )
67 67
 	{
68
-		if( $status == 'all' || empty( $status )) {
68
+		if( $status == 'all' || empty($status) ) {
69 69
 			$status = get_post_stati( ['exclude_from_search' => false] );
70 70
 		}
71 71
 		return glsr( SqlQueries::class )->getReviewsMeta( $key, $status );
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
 			'fields' => 'id=>name',
81 81
 			'hide_empty' => false,
82 82
 			'taxonomy' => Application::TAXONOMY,
83
-		]);
84
-		unset( $args['count'] ); // we don't want a term count
83
+		] );
84
+		unset($args['count']); // we don't want a term count
85 85
 		$terms = get_terms( $args );
86
-		if( is_wp_error( $terms )) {
86
+		if( is_wp_error( $terms ) ) {
87 87
 			glsr_log()->error( $terms->get_error_message() );
88 88
 			return [];
89 89
 		}
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 			'post_status' => 'publish',
101 101
 			'post_type' => 'any',
102 102
 		];
103
-		if( is_numeric( $searchTerm )) {
103
+		if( is_numeric( $searchTerm ) ) {
104 104
 			$args['post__in'] = [$searchTerm];
105 105
 		}
106 106
 		else {
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
 			ob_start();
120 120
 			glsr()->render( 'partials/editor/search-result', [
121 121
 				'ID' => get_the_ID(),
122
-				'permalink' => esc_url( (string) get_permalink() ),
122
+				'permalink' => esc_url( (string)get_permalink() ),
123 123
 				'title' => esc_attr( get_the_title() ),
124
-			]);
124
+			] );
125 125
 			$results .= ob_get_clean();
126 126
 		}
127 127
 		wp_reset_postdata();
Please login to merge, or discard this patch.
plugin/Filters.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -38,28 +38,28 @@
 block discarded – undo
38 38
 	 */
39 39
 	public function run()
40 40
 	{
41
-		add_filter( 'mce_external_plugins',                                    [$this->admin, 'filterTinymcePlugins'], 15 );
42
-		add_filter( 'plugin_action_links_'.$this->basename,                    [$this->admin, 'filterActionLinks'] );
43
-		add_filter( 'dashboard_glance_items',                                  [$this->admin, 'filterDashboardGlanceItems'] );
44
-		add_filter( 'wp_editor_settings',                                      [$this->editor, 'filterEditorSettings'] );
45
-		add_filter( 'the_editor',                                              [$this->editor, 'filterEditorTextarea'] );
46
-		add_filter( 'gettext',                                                 [$this->editor, 'filterPostStatusLabels'], 10, 3 );
47
-		add_filter( 'gettext_with_context',                                    [$this->editor, 'filterPostStatusLabelsWithContext'], 10, 4 );
48
-		add_filter( 'post_updated_messages',                                   [$this->editor, 'filterUpdateMessages'] );
49
-		add_filter( 'bulk_post_updated_messages',                              [$this->listtable, 'filterBulkUpdateMessages'], 10, 2 );
50
-		add_filter( 'manage_'.Application::POST_TYPE.'_posts_columns',         [$this->listtable, 'filterColumnsForPostType'] );
51
-		add_filter( 'post_date_column_status',                                 [$this->listtable, 'filterDateColumnStatus'], 10, 2 );
52
-		add_filter( 'default_hidden_columns',                                  [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2 );
53
-		add_filter( 'display_post_states',                                     [$this->listtable, 'filterPostStates'], 10, 2 );
54
-		add_filter( 'post_row_actions',                                        [$this->listtable, 'filterRowActions'], 10, 2 );
41
+		add_filter( 'mce_external_plugins', [$this->admin, 'filterTinymcePlugins'], 15 );
42
+		add_filter( 'plugin_action_links_'.$this->basename, [$this->admin, 'filterActionLinks'] );
43
+		add_filter( 'dashboard_glance_items', [$this->admin, 'filterDashboardGlanceItems'] );
44
+		add_filter( 'wp_editor_settings', [$this->editor, 'filterEditorSettings'] );
45
+		add_filter( 'the_editor', [$this->editor, 'filterEditorTextarea'] );
46
+		add_filter( 'gettext', [$this->editor, 'filterPostStatusLabels'], 10, 3 );
47
+		add_filter( 'gettext_with_context', [$this->editor, 'filterPostStatusLabelsWithContext'], 10, 4 );
48
+		add_filter( 'post_updated_messages', [$this->editor, 'filterUpdateMessages'] );
49
+		add_filter( 'bulk_post_updated_messages', [$this->listtable, 'filterBulkUpdateMessages'], 10, 2 );
50
+		add_filter( 'manage_'.Application::POST_TYPE.'_posts_columns', [$this->listtable, 'filterColumnsForPostType'] );
51
+		add_filter( 'post_date_column_status', [$this->listtable, 'filterDateColumnStatus'], 10, 2 );
52
+		add_filter( 'default_hidden_columns', [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2 );
53
+		add_filter( 'display_post_states', [$this->listtable, 'filterPostStates'], 10, 2 );
54
+		add_filter( 'post_row_actions', [$this->listtable, 'filterRowActions'], 10, 2 );
55 55
 		add_filter( 'manage_edit-'.Application::POST_TYPE.'_sortable_columns', [$this->listtable, 'filterSortableColumns'] );
56
-		add_filter( 'ngettext',                                                [$this->listtable, 'filterStatusText'], 10, 5 );
57
-		add_filter( 'script_loader_tag',                                       [$this->public, 'filterEnqueuedScripts'], 10, 2 );
58
-		add_filter( 'query_vars',                                              [$this->public, 'filterQueryVars'] );
59
-		add_filter( 'site-reviews/render/view',                                [$this->public, 'filterRenderView'] );
60
-		add_filter( 'gettext',                                                 [$this->translator, 'filterGettext'], 10, 3 );
61
-		add_filter( 'gettext_with_context',                                    [$this->translator, 'filterGettextWithContext'], 10, 4 );
62
-		add_filter( 'ngettext',                                                [$this->translator, 'filterNgettext'], 10, 5 );
63
-		add_filter( 'ngettext_with_context',                                   [$this->translator, 'filterNgettextWithContext'], 10, 6 );
56
+		add_filter( 'ngettext', [$this->listtable, 'filterStatusText'], 10, 5 );
57
+		add_filter( 'script_loader_tag', [$this->public, 'filterEnqueuedScripts'], 10, 2 );
58
+		add_filter( 'query_vars', [$this->public, 'filterQueryVars'] );
59
+		add_filter( 'site-reviews/render/view', [$this->public, 'filterRenderView'] );
60
+		add_filter( 'gettext', [$this->translator, 'filterGettext'], 10, 3 );
61
+		add_filter( 'gettext_with_context', [$this->translator, 'filterGettextWithContext'], 10, 4 );
62
+		add_filter( 'ngettext', [$this->translator, 'filterNgettext'], 10, 5 );
63
+		add_filter( 'ngettext_with_context', [$this->translator, 'filterNgettextWithContext'], 10, 6 );
64 64
 	}
65 65
 }
Please login to merge, or discard this patch.
plugin/Modules/Html/Field.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 			'is_valid' => true,
28 28
 			'is_widget' => false,
29 29
 			'path' => '',
30
-		]);
30
+		] );
31 31
 		$this->normalize();
32 32
 	}
33 33
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	{
47 47
 		if( !$this->field['is_valid'] )return;
48 48
 		if( $this->field['is_raw'] ) {
49
-			return glsr( Builder::class )->{$this->field['type']}( $this->field );
49
+			return glsr( Builder::class )->{$this->field['type']}($this->field);
50 50
 		}
51 51
 		if( !$this->field['is_setting'] ) {
52 52
 			return $this->buildField();
@@ -75,15 +75,15 @@  discard block
 block discarded – undo
75 75
 				'class' => $this->getFieldClass(),
76 76
 				'errors' => $this->getFieldErrors(),
77 77
 				'field' => glsr( Builder::class )->raw( $this->field ),
78
-				'label' => glsr( Builder::class )->label([
78
+				'label' => glsr( Builder::class )->label( [
79 79
 					'class' => 'glsr-'.$this->field['type'].'-label',
80 80
 					'for' => $this->field['id'],
81 81
 					'is_public' => $this->field['is_public'],
82 82
 					'text' => $this->field['label'].'<span></span>',
83 83
 					'type' => $this->field['type'],
84
-				]),
84
+				] ),
85 85
 			],
86
-		]);
86
+		] );
87 87
 		return apply_filters( 'site-reviews/rendered/field', $field, $this->field['type'], $this->field );
88 88
 	}
89 89
 
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
 		return glsr( Template::class )->build( 'partials/form/table-row', [
96 96
 			'context' => [
97 97
 				'class' => $this->getFieldClass(),
98
-				'field' => glsr( Builder::class )->{$this->field['type']}( $this->field ),
98
+				'field' => glsr( Builder::class )->{$this->field['type']}($this->field),
99 99
 				'label' => glsr( Builder::class )->label( $this->field['legend'], ['for' => $this->field['id']] ),
100 100
 			],
101
-		]);
101
+		] );
102 102
 	}
103 103
 
104 104
 	/**
@@ -107,16 +107,16 @@  discard block
 block discarded – undo
107 107
 	protected function buildSettingMultiField()
108 108
 	{
109 109
 		$dependsOn = $this->getFieldDependsOn();
110
-		unset( $this->field['data-depends'] );
110
+		unset($this->field['data-depends']);
111 111
 		return glsr( Template::class )->build( 'partials/form/table-row-multiple', [
112 112
 			'context' => [
113 113
 				'class' => $this->getFieldClass(),
114 114
 				'depends_on' => $dependsOn,
115
-				'field' => glsr( Builder::class )->{$this->field['type']}( $this->field ),
115
+				'field' => glsr( Builder::class )->{$this->field['type']}($this->field),
116 116
 				'label' => glsr( Builder::class )->label( $this->field['legend'], ['for' => $this->field['id']] ),
117 117
 				'legend' => $this->field['legend'],
118 118
 			],
119
-		]);
119
+		] );
120 120
 	}
121 121
 
122 122
 	/**
@@ -125,13 +125,13 @@  discard block
 block discarded – undo
125 125
 	protected function getFieldClass()
126 126
 	{
127 127
 		$classes = [];
128
-		if( !empty( $this->field['errors'] )) {
128
+		if( !empty($this->field['errors']) ) {
129 129
 			$classes[] = 'glsr-has-error';
130 130
 		}
131 131
 		if( $this->field['is_hidden'] ) {
132 132
 			$classes[] = 'hidden';
133 133
 		}
134
-		if( !empty( $this->field['required'] )) {
134
+		if( !empty($this->field['required']) ) {
135 135
 			$classes[] = 'glsr-required';
136 136
 		}
137 137
 		return implode( ' ', $classes );
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 */
143 143
 	protected function getFieldDependsOn()
144 144
 	{
145
-		return !empty( $this->field['data-depends'] )
145
+		return !empty($this->field['data-depends'])
146 146
 			? $this->field['data-depends']
147 147
 			: '';
148 148
 	}
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	protected function getFieldErrors()
154 154
 	{
155
-		if( empty( $this->field['errors'] ) || !is_array( $this->field['errors'] ))return;
155
+		if( empty($this->field['errors']) || !is_array( $this->field['errors'] ) )return;
156 156
 		$errors = array_reduce( $this->field['errors'], function( $carry, $error ) {
157 157
 			return $carry.glsr( Builder::class )->span( $error, ['class' => 'glsr-field-error'] );
158 158
 		});
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			'context' => [
161 161
 				'errors' => $errors,
162 162
 			],
163
-		]);
163
+		] );
164 164
 	}
165 165
 
166 166
 	/**
@@ -183,13 +183,13 @@  discard block
 block discarded – undo
183 183
 			'name', 'type',
184 184
 		];
185 185
 		foreach( $requiredValues as $value ) {
186
-			if( isset( $this->field[$value] ))continue;
186
+			if( isset($this->field[$value]) )continue;
187 187
 			$missingValues[] = $value;
188 188
 			$this->field['is_valid'] = false;
189 189
 		}
190
-		if( !empty( $missingValues )) {
190
+		if( !empty($missingValues) ) {
191 191
 			glsr_log()
192
-				->warning( 'Field is missing: '.implode( ', ', $missingValues ))
192
+				->warning( 'Field is missing: '.implode( ', ', $missingValues ) )
193 193
 				->info( $this->field );
194 194
 		}
195 195
 		return $this->field['is_valid'];
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 		if( !$this->isFieldValid() )return;
204 204
 		$this->field['path'] = $this->field['name'];
205 205
 		$className = glsr( Helper::class )->buildClassName( $this->field['type'], __NAMESPACE__.'\Fields' );
206
-		if( class_exists( $className )) {
206
+		if( class_exists( $className ) ) {
207 207
 			$this->field = array_merge(
208 208
 				wp_parse_args( $this->field, $className::defaults() ),
209 209
 				$className::required()
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	 */
219 219
 	protected function normalizeFieldId()
220 220
 	{
221
-		if( isset( $this->field['id'] ) || $this->field['is_raw'] )return;
221
+		if( isset($this->field['id']) || $this->field['is_raw'] )return;
222 222
 		$this->field['id'] = glsr( Helper::class )->convertPathToId(
223 223
 			$this->field['path'],
224 224
 			$this->getFieldPrefix()
Please login to merge, or discard this patch.