Passed
Push — master ( e29497...7ab2d6 )
by Paul
04:36
created
uninstall.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,9 @@
 block discarded – undo
3 3
 defined( 'WP_UNINSTALL_PLUGIN' ) || die;
4 4
 
5 5
 require_once __DIR__.'/site-reviews.php';
6
-if( !(new GL_Plugin_Check_v3( __FILE__ ))->isValid() )return;
6
+if( !(new GL_Plugin_Check_v3( __FILE__ ))->isValid() ) {
7
+	return;
8
+}
7 9
 
8 10
 delete_option( GeminiLabs\SiteReviews\Database\OptionManager::databaseKey() );
9 11
 delete_option( 'widget_'.glsr()->id.'_site-reviews' );
Please login to merge, or discard this patch.
site-reviews.php 2 patches
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.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@
 block discarded – undo
21 21
 if( !class_exists( 'GL_Plugin_Check_v3' )) {
22 22
 	require_once __DIR__.'/activate.php';
23 23
 }
24
-if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() )return;
24
+if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() ) {
25
+	return;
26
+}
25 27
 require_once __DIR__.'/autoload.php';
26 28
 require_once __DIR__.'/compatibility.php';
27 29
 require_once __DIR__.'/helpers.php';
Please login to merge, or discard this patch.
plugin/Modules/Html/Partials/FormResults.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 		$this->errors = $args['errors'];
22 22
 		return glsr( Builder::class )->div( wpautop( $args['message'] ), [
23 23
 			'class' => $this->getClass(),
24
-		]);
24
+		] );
25 25
 	}
26 26
 
27 27
 	/**
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	protected function getClass()
31 31
 	{
32
-		$errorClass = !empty( $this->errors )
32
+		$errorClass = !empty($this->errors)
33 33
 			? 'glsr-has-errors'
34 34
 			: '';
35 35
 		return trim( 'glsr-form-messages '.$errorClass );
Please login to merge, or discard this patch.
plugin/Modules/Html/Fields/Languages.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 	 */
33 33
 	protected static function options()
34 34
 	{
35
-		require_once( ABSPATH.'wp-admin/includes/translation-install.php' );
35
+		require_once(ABSPATH.'wp-admin/includes/translation-install.php');
36 36
 		$locales = wp_get_available_translations();
37 37
 		array_walk( $locales, function( &$value ) {
38 38
 			$value = $value['native_name'];
Please login to merge, or discard this patch.
plugin/Router.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  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 ) )return;
20 20
 		check_admin_referer( $request['action'] );
21 21
 		$this->routeRequest( 'admin', $request['action'], $request );
22 22
 	}
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 	{
41 41
 		if( is_admin() )return;
42 42
 		$request = $this->getRequest();
43
-		if( !$this->isValidPostRequest( $request ))return;
44
-		if( !$this->isValidPublicNonce( $request ))return;
43
+		if( !$this->isValidPostRequest( $request ) )return;
44
+		if( !$this->isValidPublicNonce( $request ) )return;
45 45
 		$this->routeRequest( 'public', $request['action'], $request );
46 46
 	}
47 47
 
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
 	protected function checkAjaxNonce( array $request )
52 52
 	{
53 53
 		if( !is_user_logged_in() )return;
54
-		if( !isset( $request['nonce'] )) {
54
+		if( !isset($request['nonce']) ) {
55 55
 			$this->sendAjaxError( 'The request is missing a nonce', $request );
56 56
 		}
57
-		if( !wp_verify_nonce( $request['nonce'], $request['action'] )) {
57
+		if( !wp_verify_nonce( $request['nonce'], $request['action'] ) ) {
58 58
 			$this->sendAjaxError( 'The request failed the nonce check', $request, 403 );
59 59
 		}
60 60
 	}
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	protected function checkAjaxRequest( array $request )
66 66
 	{
67
-		if( !isset( $request['action'] )) {
67
+		if( !isset($request['action']) ) {
68 68
 			$this->sendAjaxError( 'The request must include an action', $request );
69 69
 		}
70
-		if( empty( $request['ajax_request'] )) {
70
+		if( empty($request['ajax_request']) ) {
71 71
 			$this->sendAjaxError( 'The request is invalid', $request );
72 72
 		}
73 73
 	}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 */
91 91
 	protected function isValidPostRequest( array $request = [] )
92 92
 	{
93
-		return !empty( $request['action'] ) && empty( $request['ajax_request'] );
93
+		return !empty($request['action']) && empty($request['ajax_request']);
94 94
 	}
95 95
 
96 96
 	/**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	protected function isValidPublicNonce( array $request )
100 100
 	{
101
-		if( is_user_logged_in() && !wp_verify_nonce( $request['nonce'], $request['action'] )) {
101
+		if( is_user_logged_in() && !wp_verify_nonce( $request['nonce'], $request['action'] ) ) {
102 102
 			glsr_log()->error( 'Nonce check failed for public request' )->info( $request );
103 103
 			return false;
104 104
 		}
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 	protected function routeRequest( $type, $action, array $request = [] )
128 128
 	{
129 129
 		$actionHook = 'site-reviews/route/'.$type.'/request';
130
-		$controller = glsr( glsr( Helper::class )->buildClassName( $type.'-controller', 'Controllers' ));
130
+		$controller = glsr( glsr( Helper::class )->buildClassName( $type.'-controller', 'Controllers' ) );
131 131
 		$method = glsr( Helper::class )->buildMethodName( $action, 'router' );
132 132
 		$request = apply_filters( 'site-reviews/route/request', $request, $action, $type );
133 133
 		do_action( $actionHook, $action, $request );
134
-		if( is_callable( [$controller, $method] )) {
134
+		if( is_callable( [$controller, $method] ) ) {
135 135
 			call_user_func( [$controller, $method], $request );
136 136
 			return;
137 137
 		}
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	protected function sendAjaxError( $error, array $request, $statusCode = 400 )
149 149
 	{
150 150
 		glsr_log()->error( $error )->info( $request );
151
-		wp_send_json_error([
151
+		wp_send_json_error( [
152 152
 			'message' => __( 'The form could not be submitted. Please notify the site administrator.', 'site-reviews' ),
153 153
 			'error' => $error,
154 154
 		], $statusCode );
Please login to merge, or discard this 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
 		check_admin_referer( $request['action'] );
21 23
 		$this->routeRequest( 'admin', $request['action'], $request );
22 24
 	}
@@ -38,10 +40,16 @@  discard block
 block discarded – undo
38 40
 	 */
39 41
 	public function routePublicPostRequest()
40 42
 	{
41
-		if( is_admin() )return;
43
+		if( is_admin() ) {
44
+			return;
45
+		}
42 46
 		$request = $this->getRequest();
43
-		if( !$this->isValidPostRequest( $request ))return;
44
-		if( !$this->isValidPublicNonce( $request ))return;
47
+		if( !$this->isValidPostRequest( $request )) {
48
+			return;
49
+		}
50
+		if( !$this->isValidPublicNonce( $request )) {
51
+			return;
52
+		}
45 53
 		$this->routeRequest( 'public', $request['action'], $request );
46 54
 	}
47 55
 
@@ -50,7 +58,9 @@  discard block
 block discarded – undo
50 58
 	 */
51 59
 	protected function checkAjaxNonce( array $request )
52 60
 	{
53
-		if( !is_user_logged_in() )return;
61
+		if( !is_user_logged_in() ) {
62
+			return;
63
+		}
54 64
 		if( !isset( $request['nonce'] )) {
55 65
 			$this->sendAjaxError( 'The request is missing a nonce', $request );
56 66
 		}
Please login to merge, or discard this patch.
compatibility.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,5 +9,5 @@
 block discarded – undo
9 9
  */
10 10
 add_filter( 'sbp_exclude_defer_scripts', function( $scriptHandles ) {
11 11
 	$scriptHandles[] = 'site-reviews/google-recaptcha';
12
-	return array_keys( array_flip( $scriptHandles ));
12
+	return array_keys( array_flip( $scriptHandles ) );
13 13
 });
Please login to merge, or discard this patch.