Passed
Push — master ( e0dbf5...75834f )
by Paul
04:31
created
helpers.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,7 +4,8 @@  discard block
 block discarded – undo
4 4
 /**
5 5
  * @return mixed
6 6
  */
7
-function glsr( $alias = null ) {
7
+function glsr( $alias = null )
8
+{
8 9
 	$app = \GeminiLabs\SiteReviews\Application::load();
9 10
 	return !empty( $alias )
10 11
 		? $app->make( $alias )
@@ -14,7 +15,8 @@  discard block
 block discarded – undo
14 15
 /**
15 16
  * @return \WP_Screen|object
16 17
  */
17
-function glsr_current_screen() {
18
+function glsr_current_screen()
19
+{
18 20
 	if( function_exists( 'get_current_screen' )) {
19 21
 		$screen = get_current_screen();
20 22
 	}
@@ -26,7 +28,8 @@  discard block
 block discarded – undo
26 28
 /**
27 29
  * @return \GeminiLabs\SiteReviews\Database
28 30
  */
29
-function glsr_db() {
31
+function glsr_db()
32
+{
30 33
 	return glsr( 'Database' );
31 34
 }
32 35
 
@@ -34,7 +37,8 @@  discard block
 block discarded – undo
34 37
  * @param mixed ...$vars
35 38
  * @return void
36 39
  */
37
-function glsr_debug( ...$vars ) {
40
+function glsr_debug( ...$vars )
41
+{
38 42
 	if( count( $vars ) == 1 ) {
39 43
 		$value = htmlspecialchars( print_r( $vars[0], true ), ENT_QUOTES, 'UTF-8' );
40 44
 		printf( '<div class="glsr-debug"><pre>%s</pre></div>', $value );
@@ -51,7 +55,8 @@  discard block
 block discarded – undo
51 55
 /**
52 56
  * @return \GeminiLabs\SiteReviews\Modules\Console
53 57
  */
54
-function glsr_log() {
58
+function glsr_log()
59
+{
55 60
 	$args = func_get_args();
56 61
 	$context = isset( $args[1] )
57 62
 		? $args[1]
@@ -67,14 +72,16 @@  discard block
 block discarded – undo
67 72
  * @param mixed $fallback
68 73
  * @return string|array
69 74
  */
70
-function glsr_get_option( $path = '', $fallback = '' ) {
75
+function glsr_get_option( $path = '', $fallback = '' )
76
+{
71 77
 	return glsr( 'Database\OptionManager' )->get( 'settings.'.$path, $fallback );
72 78
 }
73 79
 
74 80
 /**
75 81
  * @return array
76 82
  */
77
-function glsr_get_options() {
83
+function glsr_get_options()
84
+{
78 85
 	return glsr( 'Database\OptionManager' )->get( 'settings' );
79 86
 }
80 87
 
Please login to merge, or discard this patch.
plugin/Modules/Console.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -190,7 +190,9 @@
 block discarded – undo
190 190
 		if( $index === false
191 191
 			|| !isset( $caller[$index+2]['class'] )
192 192
 			|| !isset( $caller[$index+2]['function'] )
193
-		)return;
193
+		) {
194
+			return;
195
+		}
194 196
 		return sprintf( '[%s()->%s:%s] ',
195 197
 			$caller[$index+2]['class'],
196 198
 			$caller[$index+2]['function'],
Please login to merge, or discard this patch.
plugin/Database/QueryBuilder.php 1 patch
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,9 +16,13 @@  discard block
 block discarded – undo
16 16
 	{
17 17
 		$queries = [];
18 18
 		foreach( $keys as $key ) {
19
-			if( !array_key_exists( $key, $values ))continue;
19
+			if( !array_key_exists( $key, $values )) {
20
+				continue;
21
+			}
20 22
 			$methodName = glsr( Helper::class )->buildMethodName( $key, __FUNCTION__ );
21
-			if( !method_exists( $this, $methodName ))continue;
23
+			if( !method_exists( $this, $methodName )) {
24
+				continue;
25
+			}
22 26
 			$query = call_user_func( [$this, $methodName], $values[$key] );
23 27
 			if( is_array( $query )) {
24 28
 				$queries[] = $query;
@@ -92,7 +96,9 @@  discard block
 block discarded – undo
92 96
 	 */
93 97
 	protected function buildQueryAssignedTo( $value )
94 98
 	{
95
-		if( empty( $value ))return;
99
+		if( empty( $value )) {
100
+			return;
101
+		}
96 102
 		return [
97 103
 			'compare' => 'IN',
98 104
 			'key' => 'assigned_to',
@@ -106,7 +112,9 @@  discard block
 block discarded – undo
106 112
 	 */
107 113
 	protected function buildQueryCategory( $value )
108 114
 	{
109
-		if( empty( $value ))return;
115
+		if( empty( $value )) {
116
+			return;
117
+		}
110 118
 		return [
111 119
 			'field' => 'term_id',
112 120
 			'taxonomy' => Application::TAXONOMY,
@@ -120,7 +128,9 @@  discard block
 block discarded – undo
120 128
 	 */
121 129
 	protected function buildQueryRating( $value )
122 130
 	{
123
-		if( !is_numeric( $value ) || !in_array( intval( $value ), range( 1, 5 )))return;
131
+		if( !is_numeric( $value ) || !in_array( intval( $value ), range( 1, 5 ))) {
132
+			return;
133
+		}
124 134
 		return [
125 135
 			'compare' => '>=',
126 136
 			'key' => 'rating',
@@ -134,7 +144,9 @@  discard block
 block discarded – undo
134 144
 	 */
135 145
 	protected function buildQueryType( $value )
136 146
 	{
137
-		if( in_array( $value, ['','all'] ))return;
147
+		if( in_array( $value, ['','all'] )) {
148
+			return;
149
+		}
138 150
 		return [
139 151
 			'key' => 'review_type',
140 152
 			'value' => $value,
Please login to merge, or discard this patch.
plugin/Router.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@  discard block
 block discarded – undo
16 16
 	public function routeAdminPostRequest()
17 17
 	{
18 18
 		$request = $this->getRequest();
19
-		if( !$this->isValidPostRequest( $request ))return;
19
+		if( !$this->isValidPostRequest( $request )) {
20
+			return;
21
+		}
20 22
 		$this->checkAdminNonce( $request['action'] );
21 23
 		$this->routeRequest( 'admin', $request['action'], $request );
22 24
 	}
@@ -51,9 +53,13 @@  discard block
 block discarded – undo
51 53
 	 */
52 54
 	public function routePublicPostRequest()
53 55
 	{
54
-		if( is_admin() )return;
56
+		if( is_admin() ) {
57
+			return;
58
+		}
55 59
 		$request = $this->getRequest();
56
-		if( !$this->isValidPostRequest( $request ))return;
60
+		if( !$this->isValidPostRequest( $request )) {
61
+			return;
62
+		}
57 63
 		if( !wp_verify_nonce( $request['_wpnonce'], $request['action'] )) {
58 64
 			glsr_log()->error( 'Nonce check failed for public request' )->info( $request );
59 65
 			return;
@@ -67,7 +73,9 @@  discard block
 block discarded – undo
67 73
 	public function routeWebhookRequest()
68 74
 	{
69 75
 		$request = filter_input( INPUT_GET, Application::PREFIX.'hook' );
70
-		if( !$request )return;
76
+		if( !$request ) {
77
+			return;
78
+		}
71 79
 		// @todo manage webhook here
72 80
 	}
73 81
 
@@ -92,7 +100,9 @@  discard block
 block discarded – undo
92 100
 	{
93 101
 		foreach( ['request', Application::ID] as $key ) {
94 102
 			$request = glsr( Helper::class )->filterInputArray( $key );
95
-			if( !empty( $request ))break;
103
+			if( !empty( $request )) {
104
+				break;
105
+			}
96 106
 		}
97 107
 		return $this->normalizeRequest( $request );
98 108
 	}
Please login to merge, or discard this patch.
plugin/Modules/Schema/BaseType.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -212,7 +212,9 @@  discard block
 block discarded – undo
212 212
 		$newParents = $parents;
213 213
 		foreach( $parents as $parent ) {
214 214
 			$parentClass = glsr( Helper::class )->buildClassName( $parent, __NAMESPACE__ );
215
-			if( !class_exists( $parentClass ))continue;
215
+			if( !class_exists( $parentClass )) {
216
+				continue;
217
+			}
216 218
 			$newParents = array_merge( $newParents, $this->getParents( (new $parentClass)->parents ));
217 219
 		}
218 220
 		return array_values( array_unique( $newParents ));
@@ -226,7 +228,9 @@  discard block
 block discarded – undo
226 228
 		$parents = $this->getParents();
227 229
 		foreach( $parents as $parent ) {
228 230
 			$parentClass = glsr( Helper::class )->buildClassName( $parent, __NAMESPACE__ );
229
-			if( !class_exists( $parentClass ))continue;
231
+			if( !class_exists( $parentClass )) {
232
+				continue;
233
+			}
230 234
 			$this->allowed = array_values( array_unique( array_merge( (new $parentClass)->allowed, $this->allowed )));
231 235
 		}
232 236
 	}
Please login to merge, or discard this patch.