Passed
Push — master ( cb56ad...f2f23d )
by Paul
04:37
created
plugin/Controllers/AjaxController.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	 */
23 23
 	public function routerChangeStatus( array $request )
24 24
 	{
25
-		wp_send_json_success( $this->execute( new ChangeStatus( $request )));
25
+		wp_send_json_success( $this->execute( new ChangeStatus( $request ) ) );
26 26
 	}
27 27
 
28 28
 	/**
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	public function routerClearConsole()
32 32
 	{
33 33
 		glsr( AdminController::class )->routerClearConsole();
34
-		wp_send_json_success([
34
+		wp_send_json_success( [
35 35
 			'console' => glsr( Console::class )->get(),
36 36
 			'notices' => glsr( Notice::class )->get(),
37
-		]);
37
+		] );
38 38
 	}
39 39
 
40 40
 	/**
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 	public function routerCountReviews()
44 44
 	{
45 45
 		glsr( AdminController::class )->routerCountReviews();
46
-		wp_send_json_success([
46
+		wp_send_json_success( [
47 47
 			'notices' => glsr( Notice::class )->get(),
48
-		]);
48
+		] );
49 49
 	}
50 50
 
51 51
 	/**
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 	{
56 56
 		$shortcode = $request['shortcode'];
57 57
 		$response = false;
58
-		if( array_key_exists( $shortcode, glsr()->mceShortcodes )) {
58
+		if( array_key_exists( $shortcode, glsr()->mceShortcodes ) ) {
59 59
 			$data = glsr()->mceShortcodes[$shortcode];
60
-			if( !empty( $data['errors'] )) {
60
+			if( !empty($data['errors']) ) {
61 61
 				$data['btn_okay'] = [esc_html__( 'Okay', 'site-reviews' )];
62 62
 			}
63 63
 			$response = [
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
 	public function routerFetchConsole()
78 78
 	{
79 79
 		glsr( AdminController::class )->routerFetchConsole();
80
-		wp_send_json_success([
80
+		wp_send_json_success( [
81 81
 			'console' => glsr( Console::class )->get(),
82 82
 			'notices' => glsr( Notice::class )->get(),
83
-		]);
83
+		] );
84 84
 	}
85 85
 
86 86
 	/**
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 	public function routerSearchPosts( array $request )
90 90
 	{
91 91
 		$results = glsr( Database::class )->searchPosts( $request['search'] );
92
-		wp_send_json_success([
92
+		wp_send_json_success( [
93 93
 			'empty' => '<div>'.__( 'Nothing found.', 'site-reviews' ).'</div>',
94 94
 			'items' => $results,
95
-		]);
95
+		] );
96 96
 	}
97 97
 
98 98
 	/**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public function routerSearchTranslations( array $request )
102 102
 	{
103
-		if( empty( $request['exclude'] )) {
103
+		if( empty($request['exclude']) ) {
104 104
 			$request['exclude'] = [];
105 105
 		}
106 106
 		$results = glsr( Translation::class )
@@ -108,10 +108,10 @@  discard block
 block discarded – undo
108 108
 			->exclude()
109 109
 			->exclude( $request['exclude'] )
110 110
 			->renderResults();
111
-		wp_send_json_success([
111
+		wp_send_json_success( [
112 112
 			'empty' => '<div>'.__( 'Nothing found.', 'site-reviews' ).'</div>',
113 113
 			'items' => $results,
114
-		]);
114
+		] );
115 115
 	}
116 116
 
117 117
 	/**
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	public function routerSubmitReview( array $request )
121 121
 	{
122 122
 		$command = glsr( PublicController::class )->routerSubmitReview( $request );
123
-		$redirect = trim( strval( get_post_meta( $command->post_id, 'redirect_to', true )));
123
+		$redirect = trim( strval( get_post_meta( $command->post_id, 'redirect_to', true ) ) );
124 124
 		$redirect = apply_filters( 'site-reviews/review/redirect', $redirect, $command );
125 125
 		$data = [
126 126
 			'errors' => glsr( Session::class )->get( $command->form_id.'errors', false, true ),
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 	 */
141 141
 	public function routerTogglePinned( array $request )
142 142
 	{
143
-		$isPinned = $this->execute( new TogglePinned( $request ));
144
-		wp_send_json_success([
143
+		$isPinned = $this->execute( new TogglePinned( $request ) );
144
+		wp_send_json_success( [
145 145
 			'notices' => glsr( Notice::class )->get(),
146 146
 			'pinned' => $isPinned,
147
-		]);
147
+		] );
148 148
 	}
149 149
 }
Please login to merge, or discard this patch.
plugin/Controllers/PublicController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 	public function filterEnqueuedScripts( $tag, $handle )
34 34
 	{
35 35
 		$scripts = [Application::ID.'/google-recaptcha'];
36
-		if( in_array( $handle, apply_filters( 'site-reviews/async-scripts', $scripts ))) {
36
+		if( in_array( $handle, apply_filters( 'site-reviews/async-scripts', $scripts ) ) ) {
37 37
 			$tag = str_replace( ' src=', ' async src=', $tag );
38 38
 		}
39
-		if( in_array( $handle, apply_filters( 'site-reviews/defer-scripts', $scripts ))) {
39
+		if( in_array( $handle, apply_filters( 'site-reviews/defer-scripts', $scripts ) ) ) {
40 40
 			$tag = str_replace( ' src=', ' defer src=', $tag );
41 41
 		}
42 42
 		return $tag;
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public function filterFieldOrder( array $config )
51 51
 	{
52
-		$order = (array)apply_filters( 'site-reviews/submission-form/order', array_keys( $config ));
52
+		$order = (array)apply_filters( 'site-reviews/submission-form/order', array_keys( $config ) );
53 53
 		return array_intersect_key( array_merge( array_flip( $order ), $config ), $config );
54 54
 	}
55 55
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	{
101 101
 		$validated = glsr( ValidateReview::class )->validate( $request );
102 102
 		$command = new CreateReview( $validated->request );
103
-		if( empty( $validated->error ) && !$validated->recaptchaIsUnset ) {
103
+		if( empty($validated->error) && !$validated->recaptchaIsUnset ) {
104 104
 			$this->execute( $command );
105 105
 		}
106 106
 		return $command;
Please login to merge, or discard this patch.
plugin/Handlers/CreateReview.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,13 +17,13 @@  discard block
 block discarded – undo
17 17
 		$review = glsr( ReviewManager::class )->create( $command );
18 18
 		if( !$review ) {
19 19
 			glsr( Session::class )->set( $command->form_id.'errors', [] );
20
-			glsr( Session::class )->set( $command->form_id.'message', __( 'Your review could not be submitted and the error has been logged. Please notify the site admin.', 'site-reviews' ));
20
+			glsr( Session::class )->set( $command->form_id.'message', __( 'Your review could not be submitted and the error has been logged. Please notify the site admin.', 'site-reviews' ) );
21 21
 			return;
22 22
 		}
23
-		glsr( Session::class )->set( $command->form_id.'message', __( 'Your review has been submitted!', 'site-reviews' ));
23
+		glsr( Session::class )->set( $command->form_id.'message', __( 'Your review has been submitted!', 'site-reviews' ) );
24 24
 		glsr( Notification::class )->send( $review );
25 25
 		if( $command->ajax_request )return;
26
-		wp_safe_redirect( $this->getReferer( $command ));
26
+		wp_safe_redirect( $this->getReferer( $command ) );
27 27
 		exit;
28 28
 	}
29 29
 
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	protected function getReferer( Command $command )
34 34
 	{
35
-		$referer = trim( strval( get_post_meta( $command->post_id, 'redirect_to', true )));
35
+		$referer = trim( strval( get_post_meta( $command->post_id, 'redirect_to', true ) ) );
36 36
 		$referer = apply_filters( 'site-reviews/review/redirect', $referer, $command );
37
-		if( empty( $referer )) {
37
+		if( empty($referer) ) {
38 38
 			$referer = $command->referer;
39 39
 		}
40
-		if( empty( $referer )) {
40
+		if( empty($referer) ) {
41 41
 			glsr_log()->warning( 'The form referer ($_SERVER[REQUEST_URI]) was empty.' )->info( $command );
42 42
 			$referer = home_url();
43 43
 		}
Please login to merge, or discard this patch.