Test Failed
Push — master ( 3b4aec...d6370d )
by Paul
03:25
created
plugin/Modules/Akismet.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,9 @@  discard block
 block discarded – undo
30 30
 			// 'is_test' => 1,
31 31
 		];
32 32
 		foreach( $_SERVER as $key => $value ) {
33
-			if( is_array( $value ) || in_array( $key, ['HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW'] ))continue;
33
+			if( is_array( $value ) || in_array( $key, ['HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW'] )) {
34
+				continue;
35
+			}
34 36
 			$submission[$key] = $value;
35 37
 		}
36 38
 		return $this->check( apply_filters( 'site-reviews/akismet/submission', $submission, $review ));
@@ -56,12 +58,16 @@  discard block
 block discarded – undo
56 58
 	{
57 59
 		$query = [];
58 60
 		foreach( $data as $key => $value ) {
59
-			if( is_array( $value ) || is_object( $value ))continue;
61
+			if( is_array( $value ) || is_object( $value )) {
62
+				continue;
63
+			}
60 64
 			if( $value === false ) {
61 65
 				$value = '0';
62 66
 			}
63 67
 			$value = trim( $value );
64
-			if( !strlen( $value ))continue;
68
+			if( !strlen( $value )) {
69
+				continue;
70
+			}
65 71
 			$query[] = urlencode( $key ).'='.urlencode( $value );
66 72
 		}
67 73
 		return implode( '&', $query );
Please login to merge, or discard this patch.
plugin/Controllers/Controller.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,9 @@
 block discarded – undo
15 15
 	 */
16 16
 	public function download( $filename, $content )
17 17
 	{
18
-		if( !current_user_can( Application::CAPABILITY ))return;
18
+		if( !current_user_can( Application::CAPABILITY )) {
19
+			return;
20
+		}
19 21
 		nocache_headers();
20 22
 		header( 'Content-Type: text/plain' );
21 23
 		header( 'Content-Disposition: attachment; filename="'.$filename.'"' );
Please login to merge, or discard this patch.
plugin/Shortcodes/ButtonGenerator.php 1 patch
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,9 +57,13 @@  discard block
 block discarded – undo
57 57
 	protected function generateFields( array $fields )
58 58
 	{
59 59
 		$generatedFields = array_map( function( $field ) {
60
-			if( empty( $field ))return;
60
+			if( empty( $field )) {
61
+				return;
62
+			}
61 63
 			$field = $this->normalize( $field );
62
-			if( !method_exists( $this, $method = 'normalize'.ucfirst( $field['type'] )))return;
64
+			if( !method_exists( $this, $method = 'normalize'.ucfirst( $field['type'] ))) {
65
+				return;
66
+			}
63 67
 			return $this->$method( $field );
64 68
 		}, $fields );
65 69
 		return array_values( array_filter( $generatedFields ));
@@ -74,7 +78,9 @@  discard block
 block discarded – undo
74 78
 		if( !empty( $this->errors )) {
75 79
 			$errors = [];
76 80
 			foreach( $this->required as $name => $alert ) {
77
-				if( false !== array_search( $name, array_column( $fields, 'name' )))continue;
81
+				if( false !== array_search( $name, array_column( $fields, 'name' ))) {
82
+					continue;
83
+				}
78 84
 				$errors[] = $this->errors[$name];
79 85
 			}
80 86
 			$this->errors = $errors;
@@ -118,7 +124,9 @@  discard block
 block discarded – undo
118 124
 	 */
119 125
 	protected function normalizeContainer( array $field )
120 126
 	{
121
-		if( !array_key_exists( 'html', $field ) && !array_key_exists( 'items', $field ))return;
127
+		if( !array_key_exists( 'html', $field ) && !array_key_exists( 'items', $field )) {
128
+			return;
129
+		}
122 130
 		$field['items'] = $this->generateFields( $field['items'] );
123 131
 		return $field;
124 132
 	}
@@ -128,7 +136,9 @@  discard block
 block discarded – undo
128 136
 	 */
129 137
 	protected function normalizeField( array $field, array $defaults )
130 138
 	{
131
-		if( !$this->validate( $field ))return;
139
+		if( !$this->validate( $field )) {
140
+			return;
141
+		}
132 142
 		return array_filter( shortcode_atts( $defaults, $field ), function( $value ) {
133 143
 			return $value !== '';
134 144
 		});
@@ -149,7 +159,9 @@  discard block
 block discarded – undo
149 159
 			'type' => '',
150 160
 			'value' => '',
151 161
 		]);
152
-		if( !is_array( $listbox ))return;
162
+		if( !is_array( $listbox )) {
163
+			return;
164
+		}
153 165
 		if( !array_key_exists( '', $listbox['options'] )) {
154 166
 			$listbox['options'] = ['' => $listbox['placeholder']] + $listbox['options'];
155 167
 		}
Please login to merge, or discard this patch.
plugin/Modules/Date.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,9 @@
 block discarded – undo
30 30
 	{
31 31
 		$diff = time() - strtotime( $date );
32 32
 		foreach( static::$TIME_PERIODS as $i => $timePeriod ) {
33
-			if( $diff > $timePeriod[0] )continue;
33
+			if( $diff > $timePeriod[0] ) {
34
+				continue;
35
+			}
34 36
 			$unit = intval( floor( $diff / $timePeriod[1] ));
35 37
 			$relativeDates = [
36 38
 				_n( '%s second ago', '%s seconds ago', $unit, 'site-reviews' ),
Please login to merge, or discard this patch.
plugin/Modules/Session.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -161,7 +161,9 @@  discard block
 block discarded – undo
161 161
 		if( !empty( $sessions )) {
162 162
 			$now = time();
163 163
 			foreach( $sessions as $session ) {
164
-				if( $now <= $session->expiration )continue;
164
+				if( $now <= $session->expiration ) {
165
+					continue;
166
+				}
165 167
 				$expiredSessions[] = $session->name;
166 168
 				$expiredSessions[] = str_replace( '_expires_', '_', $session->name );
167 169
 			}
@@ -204,7 +206,9 @@  discard block
 block discarded – undo
204 206
 	 */
205 207
 	protected function setCookie()
206 208
 	{
207
-		if( headers_sent() )return;
209
+		if( headers_sent() ) {
210
+			return;
211
+		}
208 212
 		$cookie = $this->sessionId.'||'.$this->expiryTimestamp.'||'.$this->expiryTimestampReset;
209 213
 		$cookiePath = preg_replace( '|https?://[^/]+|i', '', trailingslashit( (string)get_option( 'home' )));
210 214
 		setcookie( static::SESSION_COOKIE, $cookie, $this->expiryTimestamp, $cookiePath );
Please login to merge, or discard this patch.
plugin/Filters.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@
 block discarded – undo
22 22
 	protected $public;
23 23
 	protected $translator;
24 24
 
25
-	public function __construct( Application $app ) {
25
+	public function __construct( Application $app )
26
+	{
26 27
 		$this->app = $app;
27 28
 		$this->admin = $app->make( AdminController::class );
28 29
 		$this->basename = plugin_basename( $app->file );
Please login to merge, or discard this patch.
plugin/Database/DefaultsManager.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,9 @@
 block discarded – undo
53 53
 	protected function normalize( array $settings )
54 54
 	{
55 55
 		array_walk( $settings, function( &$setting ) {
56
-			if( isset( $setting['default'] ))return;
56
+			if( isset( $setting['default'] )) {
57
+				return;
58
+			}
57 59
 			$setting['default'] = '';
58 60
 		});
59 61
 		return $settings;
Please login to merge, or discard this patch.
plugin/Database/OptionManager.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,9 @@  discard block
 block discarded – undo
42 42
 		$options = $this->all();
43 43
 		$pointer = &$options;
44 44
 		foreach( $keys as $key ) {
45
-			if( !isset( $pointer[$key] ) || !is_array( $pointer[$key] ))continue;
45
+			if( !isset( $pointer[$key] ) || !is_array( $pointer[$key] )) {
46
+				continue;
47
+			}
46 48
 			$pointer = &$pointer[$key];
47 49
 		}
48 50
 		unset( $pointer[$last] );
@@ -77,7 +79,9 @@  discard block
 block discarded – undo
77 79
 			glsr( DefaultsManager::class )->defaults()
78 80
 		);
79 81
 		array_walk( $options, function( &$value ) {
80
-			if( !is_string( $value ))return;
82
+			if( !is_string( $value )) {
83
+				return;
84
+			}
81 85
 			$value = wp_kses( $value, wp_kses_allowed_html( 'post' ));
82 86
 		});
83 87
 		return glsr( Helper::class )->convertDotNotationArray( $options );
Please login to merge, or discard this patch.
plugin/Modules/Html/Template.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,9 @@
 block discarded – undo
53 53
 		$arrayKeys = ['context', 'globals'];
54 54
 		$data = wp_parse_args( $data, array_fill_keys( $arrayKeys, [] ));
55 55
 		foreach( $arrayKeys as $key ) {
56
-			if( is_array( $data[$key] ))continue;
56
+			if( is_array( $data[$key] )) {
57
+				continue;
58
+			}
57 59
 			$data[$key] = [];
58 60
 		}
59 61
 		return $data;
Please login to merge, or discard this patch.