Passed
Push — master ( 235569...65c96d )
by Paul
03:43
created
plugin/Handlers/RegisterPostType.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,9 @@
 block discarded – undo
11 11
 	 */
12 12
 	public function handle( Command $command )
13 13
 	{
14
-		if( in_array( $command->postType, get_post_types( ['_builtin' => true] )))return;
14
+		if( in_array( $command->postType, get_post_types( ['_builtin' => true] ))) {
15
+			return;
16
+		}
15 17
 		register_post_type( $command->postType, $command->args );
16 18
 		glsr()->postTypeColumns = wp_parse_args( glsr()->postTypeColumns, [
17 19
 			$command->postType => $command->columns,
Please login to merge, or discard this patch.
plugin/Controllers/MainController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,9 @@
 block discarded – undo
19 19
 	 */
20 20
 	public function registerPostType()
21 21
 	{
22
-		if( !glsr()->hasPermission() )return;
22
+		if( !glsr()->hasPermission() ) {
23
+			return;
24
+		}
23 25
 		$command = new RegisterPostType([
24 26
 			'capabilities'=> ['create_posts' => 'create_'.Application::POST_TYPE],
25 27
 			'columns' => [
Please login to merge, or discard this patch.
plugin/Shortcodes/Shortcode.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,9 @@  discard block
 block discarded – undo
76 76
 		$args = shortcode_atts( $this->getDefaults(), wp_parse_args( $args ));
77 77
 		array_walk( $args, function( &$value, $key ) {
78 78
 			$methodName = glsr( Helper::class )->buildMethodName( $key, 'normalize' );
79
-			if( !method_exists( $this, $methodName ))return;
79
+			if( !method_exists( $this, $methodName )) {
80
+				return;
81
+			}
80 82
 			$value = $this->$methodName( $value );
81 83
 		});
82 84
 		return $this->sanitize( $args );
@@ -141,7 +143,9 @@  discard block
 block discarded – undo
141 143
 		$defaults = array_pad( $defaults, Rating::MAX_RATING, '' );
142 144
 		$labels = array_map( 'trim', explode( ',', $labels ));
143 145
 		foreach( $defaults as $i => $label ) {
144
-			if( empty( $labels[$i] ))continue;
146
+			if( empty( $labels[$i] )) {
147
+				continue;
148
+			}
145 149
 			$defaults[$i] = $labels[$i];
146 150
 		}
147 151
 		return array_combine( range( Rating::MAX_RATING, 1 ), $defaults );
Please login to merge, or discard this patch.
plugin/Commands/RegisterPostType.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,9 @@
 block discarded – undo
29 29
 	{
30 30
 		foreach( $args as $key => $value ) {
31 31
 			$property = glsr( Helper::class )->buildPropertyName( $key );
32
-			if( !property_exists( $this, $property ))continue;
32
+			if( !property_exists( $this, $property )) {
33
+				continue;
34
+			}
33 35
 			$this->$property = $value;
34 36
 			unset( $args[$key] );
35 37
 		}
Please login to merge, or discard this patch.
plugin/Modules/Notice.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,9 @@  discard block
 block discarded – undo
15 15
 	 */
16 16
 	public function add( $type, $message, array $args = [] )
17 17
 	{
18
-		if( empty( array_filter( [$message, $type] )))return;
18
+		if( empty( array_filter( [$message, $type] ))) {
19
+			return;
20
+		}
19 21
 		$args['message'] = $message;
20 22
 		$args['type'] = $type;
21 23
 		add_settings_error( Application::ID, '', json_encode( $this->normalize( $args )));
@@ -56,7 +58,9 @@  discard block
 block discarded – undo
56 58
 		$notices = array_map( 'unserialize',
57 59
 			array_unique( array_map( 'serialize', get_settings_errors( Application::ID )))
58 60
 		);
59
-		if( empty( $notices ))return;
61
+		if( empty( $notices )) {
62
+			return;
63
+		}
60 64
 		return array_reduce( $notices, function( $carry, $notice ) {
61 65
 			return $carry.$this->buildNotice( json_decode( $notice['message'], true ));
62 66
 		});
Please login to merge, or discard this patch.
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/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.