Passed
Branch master (51607c)
by Paul
05:13
created
helpers.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2
-defined( 'WPINC' ) || die;
2
+defined('WPINC') || die;
3 3
 
4 4
 /**
5 5
  * @return mixed
6 6
  */
7
-function glsr( $alias = null ) {
7
+function glsr($alias = null) {
8 8
 	$app = \GeminiLabs\SiteReviews\Application::load();
9
-	return empty( $alias )
9
+	return empty($alias)
10 10
 		? $app
11
-		: $app->make( $alias );
11
+		: $app->make($alias);
12 12
 }
13 13
 
14 14
 /**
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
  * @return \WP_Screen|object
17 17
  */
18 18
 function glsr_current_screen() {
19
-	if( function_exists( 'get_current_screen' )) {
19
+	if (function_exists('get_current_screen')) {
20 20
 		$screen = get_current_screen();
21 21
 	}
22
-	return empty( $screen )
23
-		? (object)array_fill_keys( ['base', 'id', 'post_type'], null )
22
+	return empty($screen)
23
+		? (object)array_fill_keys(['base', 'id', 'post_type'], null)
24 24
 		: $screen;
25 25
 }
26 26
 
@@ -28,22 +28,22 @@  discard block
 block discarded – undo
28 28
  * @return \GeminiLabs\SiteReviews\Database
29 29
  */
30 30
 function glsr_db() {
31
-	return glsr( 'Database' );
31
+	return glsr('Database');
32 32
 }
33 33
 
34 34
 /**
35 35
  * @param mixed ...$vars
36 36
  * @return void
37 37
  */
38
-function glsr_debug( ...$vars ) {
39
-	if( count( $vars ) == 1 ) {
40
-		$value = htmlspecialchars( print_r( $vars[0], true ), ENT_QUOTES, 'UTF-8' );
41
-		printf( '<div class="glsr-debug"><pre>%s</pre></div>', $value );
38
+function glsr_debug(...$vars) {
39
+	if (count($vars) == 1) {
40
+		$value = htmlspecialchars(print_r($vars[0], true), ENT_QUOTES, 'UTF-8');
41
+		printf('<div class="glsr-debug"><pre>%s</pre></div>', $value);
42 42
 	}
43 43
 	else {
44 44
 		echo '<div class="glsr-debug-group">';
45
-		foreach( $vars as $var ) {
46
-			glsr_debug( $var );
45
+		foreach ($vars as $var) {
46
+			glsr_debug($var);
47 47
 		}
48 48
 		echo '</div>';
49 49
 	}
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
  */
55 55
 function glsr_log() {
56 56
 	$args = func_get_args();
57
-	$context = isset( $args[1] )
57
+	$context = isset($args[1])
58 58
 		? $args[1]
59 59
 		: [];
60
-	$logger = glsr( 'Modules\Logger' );
61
-	return empty( $args )
60
+	$logger = glsr('Modules\Logger');
61
+	return empty($args)
62 62
 		? $logger
63
-		: $logger->log( 'debug', $args[0], $context );
63
+		: $logger->log('debug', $args[0], $context);
64 64
 }
65 65
 
66 66
 /**
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
  * @return void
69 69
  * @callback register_taxonomy() "meta_box_cb"
70 70
  */
71
-function glsr_categories_meta_box( $post, $box ) {
72
-	glsr( 'Controllers\EditorController' )->renderTaxonomyMetabox( $post, $box );
71
+function glsr_categories_meta_box($post, $box) {
72
+	glsr('Controllers\EditorController')->renderTaxonomyMetabox($post, $box);
73 73
 }
74 74
 
75 75
 
Please login to merge, or discard this patch.