Passed
Push — hotfix/fix-counts ( 1ce239...9810ae )
by Paul
11:30 queued 06:23
created
plugin/Modules/Html/ReviewsHtml.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 		$this->reviews = $reviews;
32 32
 		$this->navigation = glsr( Partial::class )->build( 'pagination', [
33 33
 			'total' => $maxPageCount,
34
-		]);
35
-		parent::__construct( $reviews, ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS );
34
+		] );
35
+		parent::__construct( $reviews, ArrayObject::STD_PROP_LIST | ArrayObject::ARRAY_AS_PROPS );
36 36
 	}
37 37
 
38 38
 	/**
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 				'navigation' => $this->getNavigation(),
59 59
 				'reviews' => $this->getReviews(),
60 60
 			],
61
-		]);
61
+		] );
62 62
 	}
63 63
 
64 64
 	/**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 			$defaults[] = 'glsr-ajax-pagination';
74 74
 		}
75 75
 		$classes = explode( ' ', $this->args['class'] );
76
-		$classes = array_unique( array_merge( $defaults, $classes ));
76
+		$classes = array_unique( array_merge( $defaults, $classes ) );
77 77
 		return implode( ' ', $classes );
78 78
 	}
79 79
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	 */
93 93
 	protected function getReviews()
94 94
 	{
95
-		return empty( $this->reviews )
95
+		return empty($this->reviews)
96 96
 			? $this->getReviewsFallback()
97 97
 			: implode( PHP_EOL, $this->reviews );
98 98
 	}
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	protected function getReviewsFallback()
104 104
 	{
105
-		if( empty( $this->args['fallback'] ) && glsr( OptionManager::class )->getBool( 'settings.reviews.fallback' )) {
105
+		if( empty($this->args['fallback']) && glsr( OptionManager::class )->getBool( 'settings.reviews.fallback' ) ) {
106 106
 			$this->args['fallback'] = __( 'There are no reviews yet. Be the first one to write one.', 'site-reviews' );
107 107
 		}
108 108
 		$fallback = '<p class="glsr-no-margins">'.$this->args['fallback'].'</p>';
Please login to merge, or discard this patch.
site-reviews.php 2 patches
Spacing   +4 added lines, -4 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
 $check = new GL_Plugin_Check_v3( __FILE__ );
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
 $app = new GeminiLabs\SiteReviews\Application;
32 32
 $app->make( 'Provider' )->register( $app );
33
-register_activation_hook( __FILE__, array( $app, 'activate' ));
34
-register_deactivation_hook( __FILE__, array( $app, 'deactivate' ));
35
-register_shutdown_function( array( $app, 'catchFatalError' ));
33
+register_activation_hook( __FILE__, array( $app, 'activate' ) );
34
+register_deactivation_hook( __FILE__, array( $app, 'deactivate' ) );
35
+register_shutdown_function( array( $app, 'catchFatalError' ) );
36 36
 $app->init();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,9 @@
 block discarded – undo
22 22
 	require_once __DIR__.'/activate.php';
23 23
 }
24 24
 $check = new GL_Plugin_Check_v3( __FILE__ );
25
-if( !$check->canProceed() )return;
25
+if( !$check->canProceed() ) {
26
+	return;
27
+}
26 28
 require_once __DIR__.'/autoload.php';
27 29
 require_once __DIR__.'/compatibility.php';
28 30
 require_once __DIR__.'/deprecated.php';
Please login to merge, or discard this patch.
helpers.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 		'glsr_log',
21 21
 		'glsr_star_rating',
22 22
 	);
23
-	if( !in_array( $hook, $hooks ) || !function_exists( $hook ))return;
24
-	add_filter( $hook, function() use( $hook, $args ) {
23
+	if( !in_array( $hook, $hooks ) || !function_exists( $hook ) )return;
24
+	add_filter( $hook, function() use($hook, $args) {
25 25
 		array_shift( $args ); // remove the fallback value
26 26
 		return call_user_func_array( $hook, $args );
27 27
 	});
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function glsr( $alias = null ) {
34 34
 	$app = \GeminiLabs\SiteReviews\Application::load();
35
-	return !empty( $alias )
35
+	return !empty($alias)
36 36
 		? $app->make( $alias )
37 37
 		: $app;
38 38
 }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	$result = array();
47 47
 	foreach( $array as $subarray ) {
48 48
 		$subarray = (array)$subarray;
49
-		if( !isset( $subarray[$column] ))continue;
49
+		if( !isset($subarray[$column]) )continue;
50 50
 		$result[] = $subarray[$column];
51 51
 	}
52 52
 	return $result;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
  */
58 58
 function glsr_calculate_ratings() {
59 59
 	glsr( 'Controllers\AdminController' )->routerCountReviews( false );
60
-	glsr_log()->notice( __( 'Recalculated rating counts.', 'site-reviews' ));
60
+	glsr_log()->notice( __( 'Recalculated rating counts.', 'site-reviews' ) );
61 61
 }
62 62
 
63 63
 /**
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
  * @return \WP_Screen|object
75 75
  */
76 76
 function glsr_current_screen() {
77
-	if( function_exists( 'get_current_screen' )) {
77
+	if( function_exists( 'get_current_screen' ) ) {
78 78
 		$screen = get_current_screen();
79 79
 	}
80
-	return empty( $screen )
80
+	return empty($screen)
81 81
 		? (object)array_fill_keys( ['base', 'id', 'post_type'], null )
82 82
 		: $screen;
83 83
 }
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
  */
135 135
 function glsr_get_review( $post_id ) {
136 136
 	$post = null;
137
-	if( is_numeric( $post_id )) {
137
+	if( is_numeric( $post_id ) ) {
138 138
 		$post = get_post( $post_id );
139 139
 	}
140
-	if( !( $post instanceof WP_Post )) {
140
+	if( !($post instanceof WP_Post) ) {
141 141
 		$post = new WP_Post( (object)[] );
142 142
 	}
143 143
 	return glsr( 'Database\ReviewManager' )->single( $post );
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
  * @return array
148 148
  */
149 149
 function glsr_get_reviews( $args = array() ) {
150
-	return glsr( 'Database\ReviewManager' )->get( glsr( 'Helper' )->consolidateArray( $args ));
150
+	return glsr( 'Database\ReviewManager' )->get( glsr( 'Helper' )->consolidateArray( $args ) );
151 151
 }
152 152
 
153 153
 /**
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
 	$args = func_get_args();
158 158
 	$console = glsr( 'Modules\Console' );
159 159
 	$value = glsr( 'Helper' )->dataGet( $args, '0' );
160
-	return !empty( $value )
161
-		? $console->log( 'debug', $value, glsr( 'Helper' )->dataGet( $args, '1', [] ))
160
+	return !empty($value)
161
+		? $console->log( 'debug', $value, glsr( 'Helper' )->dataGet( $args, '1', [] ) )
162 162
 		: $console;
163 163
 }
164 164
 
Please login to merge, or discard this patch.
Braces   +32 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,7 +20,9 @@  discard block
 block discarded – undo
20 20
 		'glsr_log',
21 21
 		'glsr_star_rating',
22 22
 	);
23
-	if( !in_array( $hook, $hooks ) || !function_exists( $hook ))return;
23
+	if( !in_array( $hook, $hooks ) || !function_exists( $hook )) {
24
+		return;
25
+	}
24 26
 	add_filter( $hook, function() use( $hook, $args ) {
25 27
 		array_shift( $args ); // remove the fallback value
26 28
 		return call_user_func_array( $hook, $args );
@@ -30,7 +32,8 @@  discard block
 block discarded – undo
30 32
 /**
31 33
  * @return mixed
32 34
  */
33
-function glsr( $alias = null ) {
35
+function glsr( $alias = null )
36
+{
34 37
 	$app = \GeminiLabs\SiteReviews\Application::load();
35 38
 	return !empty( $alias )
36 39
 		? $app->make( $alias )
@@ -42,11 +45,14 @@  discard block
 block discarded – undo
42 45
  * @param $column string
43 46
  * @return array
44 47
  */
45
-function glsr_array_column( array $array, $column ) {
48
+function glsr_array_column( array $array, $column )
49
+{
46 50
 	$result = array();
47 51
 	foreach( $array as $subarray ) {
48 52
 		$subarray = (array)$subarray;
49
-		if( !isset( $subarray[$column] ))continue;
53
+		if( !isset( $subarray[$column] )) {
54
+			continue;
55
+		}
50 56
 		$result[] = $subarray[$column];
51 57
 	}
52 58
 	return $result;
@@ -55,7 +61,8 @@  discard block
 block discarded – undo
55 61
 /**
56 62
  * @return void
57 63
  */
58
-function glsr_calculate_ratings() {
64
+function glsr_calculate_ratings()
65
+{
59 66
 	glsr( 'Controllers\AdminController' )->routerCountReviews( false );
60 67
 	glsr_log()->notice( __( 'Recalculated rating counts.', 'site-reviews' ));
61 68
 }
@@ -63,7 +70,8 @@  discard block
 block discarded – undo
63 70
 /**
64 71
  * @return \GeminiLabs\SiteReviews\Review|false
65 72
  */
66
-function glsr_create_review( $reviewValues = array() ) {
73
+function glsr_create_review( $reviewValues = array() )
74
+{
67 75
 	$review = new \GeminiLabs\SiteReviews\Commands\CreateReview(
68 76
 		glsr( 'Helper' )->consolidateArray( $reviewValues )
69 77
 	);
@@ -73,7 +81,8 @@  discard block
 block discarded – undo
73 81
 /**
74 82
  * @return \WP_Screen|object
75 83
  */
76
-function glsr_current_screen() {
84
+function glsr_current_screen()
85
+{
77 86
 	if( function_exists( 'get_current_screen' )) {
78 87
 		$screen = get_current_screen();
79 88
 	}
@@ -86,7 +95,8 @@  discard block
 block discarded – undo
86 95
  * @param mixed ...$vars
87 96
  * @return void
88 97
  */
89
-function glsr_debug( ...$vars ) {
98
+function glsr_debug( ...$vars )
99
+{
90 100
 	if( count( $vars ) == 1 ) {
91 101
 		$value = htmlspecialchars( print_r( $vars[0], true ), ENT_QUOTES, 'UTF-8' );
92 102
 		printf( '<div class="glsr-debug"><pre>%s</pre></div>', $value );
@@ -106,7 +116,8 @@  discard block
 block discarded – undo
106 116
  * @param mixed $fallback
107 117
  * @return mixed
108 118
  */
109
-function glsr_get( $array, $path = '', $fallback = '' ) {
119
+function glsr_get( $array, $path = '', $fallback = '' )
120
+{
110 121
 	return glsr( 'Helper' )->dataGet( $array, $path, $fallback );
111 122
 }
112 123
 
@@ -115,7 +126,8 @@  discard block
 block discarded – undo
115 126
  * @param mixed $fallback
116 127
  * @return string|array
117 128
  */
118
-function glsr_get_option( $path = '', $fallback = '' ) {
129
+function glsr_get_option( $path = '', $fallback = '' )
130
+{
119 131
 	return is_string( $path )
120 132
 		? glsr( 'Database\OptionManager' )->get( 'settings.'.$path, $fallback )
121 133
 		: $fallback;
@@ -124,7 +136,8 @@  discard block
 block discarded – undo
124 136
 /**
125 137
  * @return array
126 138
  */
127
-function glsr_get_options() {
139
+function glsr_get_options()
140
+{
128 141
 	return glsr( 'Database\OptionManager' )->get( 'settings' );
129 142
 }
130 143
 
@@ -132,7 +145,8 @@  discard block
 block discarded – undo
132 145
  * @param int $post_id
133 146
  * @return \GeminiLabs\SiteReviews\Review
134 147
  */
135
-function glsr_get_review( $post_id ) {
148
+function glsr_get_review( $post_id )
149
+{
136 150
 	$post = null;
137 151
 	if( is_numeric( $post_id )) {
138 152
 		$post = get_post( $post_id );
@@ -146,14 +160,16 @@  discard block
 block discarded – undo
146 160
 /**
147 161
  * @return array
148 162
  */
149
-function glsr_get_reviews( $args = array() ) {
163
+function glsr_get_reviews( $args = array() )
164
+{
150 165
 	return glsr( 'Database\ReviewManager' )->get( glsr( 'Helper' )->consolidateArray( $args ));
151 166
 }
152 167
 
153 168
 /**
154 169
  * @return \GeminiLabs\SiteReviews\Modules\Console
155 170
  */
156
-function glsr_log() {
171
+function glsr_log()
172
+{
157 173
 	$args = func_get_args();
158 174
 	$console = glsr( 'Modules\Console' );
159 175
 	$value = glsr( 'Helper' )->dataGet( $args, '0' );
@@ -165,6 +181,7 @@  discard block
 block discarded – undo
165 181
 /**
166 182
  * @return string
167 183
  */
168
-function glsr_star_rating( $rating ) {
184
+function glsr_star_rating( $rating )
185
+{
169 186
 	return glsr( 'Modules\Html\Partial' )->build( 'star-rating', ['rating' => $rating] );
170 187
 }
Please login to merge, or discard this patch.
plugin/Commands/CreateReview.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 	public function __construct( $input )
31 31
 	{
32 32
 		$this->request = $input;
33
-		$this->ajax_request = isset( $input['_ajax_request'] );
33
+		$this->ajax_request = isset($input['_ajax_request']);
34 34
 		$this->assigned_to = $this->getNumeric( 'assign_to' );
35
-		$this->author = sanitize_text_field( $this->getUser( 'name' ));
35
+		$this->author = sanitize_text_field( $this->getUser( 'name' ) );
36 36
 		$this->avatar = $this->getAvatar();
37
-		$this->blacklisted = isset( $input['blacklisted'] );
38
-		$this->category = sanitize_key( $this->get( 'category' ));
39
-		$this->content = sanitize_textarea_field( $this->get( 'content' ));
37
+		$this->blacklisted = isset($input['blacklisted']);
38
+		$this->category = sanitize_key( $this->get( 'category' ) );
39
+		$this->content = sanitize_textarea_field( $this->get( 'content' ) );
40 40
 		$this->custom = $this->getCustom();
41 41
 		$this->date = $this->getDate( 'date' );
42
-		$this->email = sanitize_email( $this->getUser( 'email' ));
43
-		$this->form_id = sanitize_key( $this->get( 'form_id' ));
42
+		$this->email = sanitize_email( $this->getUser( 'email' ) );
43
+		$this->form_id = sanitize_key( $this->get( 'form_id' ) );
44 44
 		$this->ip_address = $this->get( 'ip_address' );
45
-		$this->post_id = intval( $this->get( '_post_id' ));
46
-		$this->rating = intval( $this->get( 'rating' ));
45
+		$this->post_id = intval( $this->get( '_post_id' ) );
46
+		$this->rating = intval( $this->get( 'rating' ) );
47 47
 		$this->referer = $this->get( '_referer' );
48
-		$this->response = sanitize_textarea_field( $this->get( 'response' ));
49
-		$this->terms = !empty( $input['terms'] );
50
-		$this->title = sanitize_text_field( $this->get( 'title' ));
51
-		$this->url = esc_url_raw( $this->get( 'url' ));
48
+		$this->response = sanitize_textarea_field( $this->get( 'response' ) );
49
+		$this->terms = !empty($input['terms']);
50
+		$this->title = sanitize_text_field( $this->get( 'title' ) );
51
+		$this->url = esc_url_raw( $this->get( 'url' ) );
52 52
 	}
53 53
 
54 54
 	/**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	{
68 68
 		$avatar = $this->get( 'avatar' );
69 69
 		return !filter_var( $avatar, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED )
70
-			? (string)get_avatar_url( $this->get( 'email' ))
70
+			? (string)get_avatar_url( $this->get( 'email' ) )
71 71
 			: $avatar;
72 72
 	}
73 73
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		$unset = apply_filters( 'site-reviews/create/unset-keys-from-custom', $unset );
85 85
 		$custom = $this->request;
86 86
 		foreach( $unset as $value ) {
87
-			unset( $custom[$value] );
87
+			unset($custom[$value]);
88 88
 		}
89 89
 		return $custom;
90 90
 	}
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	protected function getDate( $key )
97 97
 	{
98
-		$date = strtotime( $this->get( $key ));
98
+		$date = strtotime( $this->get( $key ) );
99 99
 		if( $date === false ) {
100 100
 			$date = time();
101 101
 		}
102
-		return get_date_from_gmt( gmdate( 'Y-m-d H:i:s', $date ));
102
+		return get_date_from_gmt( gmdate( 'Y-m-d H:i:s', $date ) );
103 103
 	}
104 104
 
105 105
 	/**
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 	protected function getUser( $key )
110 110
 	{
111 111
 		$value = $this->get( $key );
112
-		if( empty( $value )) {
112
+		if( empty($value) ) {
113 113
 			$user = wp_get_current_user();
114 114
 			$userValues = [
115 115
 				'email' => 'user_email',
116 116
 				'name' => 'display_name',
117 117
 			];
118
-			if( $user->exists() && array_key_exists( $key, $userValues )) {
118
+			if( $user->exists() && array_key_exists( $key, $userValues ) ) {
119 119
 				return $user->{$userValues[$key]};
120 120
 			}
121 121
 		}
Please login to merge, or discard this patch.
plugin/Modules/Html/Settings.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	protected function getSettingFields( $path )
45 45
 	{
46
-		return array_filter( $this->settings, function( $key ) use( $path ) {
46
+		return array_filter( $this->settings, function( $key ) use($path) {
47 47
 			return glsr( Helper::class )->startsWith( $path, $key );
48 48
 		}, ARRAY_FILTER_USE_KEY );
49 49
 	}
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 			$field = wp_parse_args( $field, [
59 59
 				'is_setting' => true,
60 60
 				'name' => $name,
61
-			]);
62
-			$rows.= new Field( $this->normalize( $field ));
61
+			] );
62
+			$rows .= new Field( $this->normalize( $field ) );
63 63
 		}
64 64
 		return $rows;
65 65
 	}
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	protected function getTemplateData( $id )
72 72
 	{
73
-		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ));
73
+		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ) );
74 74
 		return [
75 75
 			'context' => [
76 76
 				'rows' => $this->getSettingRows( $fields ),
@@ -84,12 +84,12 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	protected function getTemplateDataForAddons( $id )
86 86
 	{
87
-		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ));
87
+		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ) );
88 88
 		$settings = glsr( Helper::class )->convertDotNotationArray( $fields );
89 89
 		$settingKeys = array_keys( $settings['settings']['addons'] );
90 90
 		$results = [];
91 91
 		foreach( $settingKeys as $key ) {
92
-			$addonFields = array_filter( $fields, function( $path ) use( $key ) {
92
+			$addonFields = array_filter( $fields, function( $path ) use($key) {
93 93
 				return glsr( Helper::class )->startsWith( 'settings.addons.'.$key, $path );
94 94
 			}, ARRAY_FILTER_USE_KEY );
95 95
 			$results[$key] = $this->getSettingRows( $addonFields );
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	 */
107 107
 	protected function getTemplateDataForLicenses( $id )
108 108
 	{
109
-		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ));
109
+		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ) );
110 110
 		ksort( $fields );
111 111
 		return [
112 112
 			'context' => [
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	protected function getTemplateDataForTranslations()
122 122
 	{
123 123
 		$translations = glsr( Translation::class )->renderAll();
124
-		$class = empty( $translations )
124
+		$class = empty($translations)
125 125
 			? 'glsr-hidden'
126 126
 			: '';
127 127
 		return [
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 			$path,
145 145
 			glsr( Helper::class )->dataGet( glsr()->defaults, $path )
146 146
 		);
147
-		if( is_array( $expectedValue )) {
147
+		if( is_array( $expectedValue ) ) {
148 148
 			return is_array( $optionValue )
149
-				? count( array_intersect( $optionValue, $expectedValue )) === 0
149
+				? count( array_intersect( $optionValue, $expectedValue ) ) === 0
150 150
 				: !in_array( $optionValue, $expectedValue );
151 151
 		}
152 152
 		return $optionValue != $expectedValue;
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	protected function isMultiDependency( $path )
159 159
 	{
160
-		if( isset( $this->settings[$path] )) {
160
+		if( isset($this->settings[$path]) ) {
161 161
 			$field = $this->settings[$path];
162
-			return ( $field['type'] == 'checkbox' && !empty( $field['options'] ))
163
-				|| !empty( $field['multiple'] );
162
+			return ($field['type'] == 'checkbox' && !empty($field['options']))
163
+				|| !empty($field['multiple']);
164 164
 		}
165 165
 		return false;
166 166
 	}
@@ -181,17 +181,17 @@  discard block
 block discarded – undo
181 181
 	 */
182 182
 	protected function normalizeDependsOn( array $field )
183 183
 	{
184
-		if( !empty( $field['depends_on'] ) && is_array( $field['depends_on'] )) {
184
+		if( !empty($field['depends_on']) && is_array( $field['depends_on'] ) ) {
185 185
 			$path = key( $field['depends_on'] );
186 186
 			$expectedValue = $field['depends_on'][$path];
187 187
 			$fieldName = glsr( Helper::class )->convertPathToName( $path, OptionManager::databaseKey() );
188
-			if( $this->isMultiDependency( $path )) {
189
-				$fieldName.= '[]';
188
+			if( $this->isMultiDependency( $path ) ) {
189
+				$fieldName .= '[]';
190 190
 			}
191
-			$field['data-depends'] = json_encode([
191
+			$field['data-depends'] = json_encode( [
192 192
 				'name' => $fieldName,
193 193
 				'value' => $expectedValue,
194
-			], JSON_HEX_APOS|JSON_HEX_QUOT );
194
+			], JSON_HEX_APOS | JSON_HEX_QUOT );
195 195
 			$field['is_hidden'] = $this->isFieldHidden( $path, $expectedValue );
196 196
 		}
197 197
 		return $field;
@@ -202,9 +202,9 @@  discard block
 block discarded – undo
202 202
 	 */
203 203
 	protected function normalizeLabelAndLegend( array $field )
204 204
 	{
205
-		if( !empty( $field['label'] )) {
205
+		if( !empty($field['label']) ) {
206 206
 			$field['legend'] = $field['label'];
207
-			unset( $field['label'] );
207
+			unset($field['label']);
208 208
 		}
209 209
 		else {
210 210
 			$field['is_valid'] = false;
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	 */
219 219
 	protected function normalizeValue( array $field )
220 220
 	{
221
-		if( !isset( $field['value'] )) {
221
+		if( !isset($field['value']) ) {
222 222
 			$field['value'] = glsr( OptionManager::class )->get(
223 223
 				$field['name'],
224 224
 				$this->getFieldDefault( $field )
Please login to merge, or discard this patch.
plugin/Modules/Style.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
 			'templates/form/submit-button',
51 51
 			'templates/reviews-form',
52 52
 		];
53
-		if( !preg_match( '('.implode( '|', $styledViews ).')', $view )) {
53
+		if( !preg_match( '('.implode( '|', $styledViews ).')', $view ) ) {
54 54
 			return $view;
55 55
 		}
56 56
 		$views = $this->generatePossibleViews( $view );
57 57
 		foreach( $views as $possibleView ) {
58
-			if( !file_exists( glsr()->file( $possibleView )))continue;
58
+			if( !file_exists( glsr()->file( $possibleView ) ) )continue;
59 59
 			return glsr( Helper::class )->removePrefix( 'views/', $possibleView );
60 60
 		}
61 61
 		return $view;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function modifyField( Builder $instance )
90 90
 	{
91
-		if( !$this->isPublicInstance( $instance ) || empty( array_filter( $this->fields )))return;
91
+		if( !$this->isPublicInstance( $instance ) || empty(array_filter( $this->fields )) )return;
92 92
 		call_user_func_array( [$this, 'customize'], [&$instance] );
93 93
 	}
94 94
 
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	protected function customize( Builder $instance )
107 107
 	{
108
-		if( !array_key_exists( $instance->tag, $this->fields ))return;
109
-		$args = wp_parse_args( $instance->args, array_fill_keys( ['class', 'type'], '' ));
108
+		if( !array_key_exists( $instance->tag, $this->fields ) )return;
109
+		$args = wp_parse_args( $instance->args, array_fill_keys( ['class', 'type'], '' ) );
110 110
 		$key = $instance->tag.'_'.$args['type'];
111
-		$classes = glsr_get( $this->fields, $key, glsr_get( $this->fields, $instance->tag ));
111
+		$classes = glsr_get( $this->fields, $key, glsr_get( $this->fields, $instance->tag ) );
112 112
 		$instance->args['class'] = trim( $args['class'].' '.$classes );
113 113
 		do_action_ref_array( 'site-reviews/customize/'.$this->style, [&$instance] );
114 114
 	}
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 		$args = wp_parse_args( $instance->args, [
141 141
 			'is_public' => false,
142 142
 			'is_raw' => false,
143
-		]);
143
+		] );
144 144
 		if( is_admin() || !$args['is_public'] || $args['is_raw'] ) {
145 145
 			return false;
146 146
 		}
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,9 @@  discard block
 block discarded – undo
55 55
 		}
56 56
 		$views = $this->generatePossibleViews( $view );
57 57
 		foreach( $views as $possibleView ) {
58
-			if( !file_exists( glsr()->file( $possibleView )))continue;
58
+			if( !file_exists( glsr()->file( $possibleView ))) {
59
+				continue;
60
+			}
59 61
 			return glsr( Helper::class )->removePrefix( 'views/', $possibleView );
60 62
 		}
61 63
 		return $view;
@@ -88,7 +90,9 @@  discard block
 block discarded – undo
88 90
 	 */
89 91
 	public function modifyField( Builder $instance )
90 92
 	{
91
-		if( !$this->isPublicInstance( $instance ) || empty( array_filter( $this->fields )))return;
93
+		if( !$this->isPublicInstance( $instance ) || empty( array_filter( $this->fields ))) {
94
+			return;
95
+		}
92 96
 		call_user_func_array( [$this, 'customize'], [&$instance] );
93 97
 	}
94 98
 
@@ -105,7 +109,9 @@  discard block
 block discarded – undo
105 109
 	 */
106 110
 	protected function customize( Builder $instance )
107 111
 	{
108
-		if( !array_key_exists( $instance->tag, $this->fields ))return;
112
+		if( !array_key_exists( $instance->tag, $this->fields )) {
113
+			return;
114
+		}
109 115
 		$args = wp_parse_args( $instance->args, array_fill_keys( ['class', 'type'], '' ));
110 116
 		$key = $instance->tag.'_'.$args['type'];
111 117
 		$classes = glsr_get( $this->fields, $key, glsr_get( $this->fields, $instance->tag ));
Please login to merge, or discard this patch.
plugin/Modules/Console.php 2 patches
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -185,7 +185,9 @@  discard block
 block discarded – undo
185 185
 		$once = glsr( Helper::class )->consolidateArray( $once );
186 186
 		$levels = $this->getLevels();
187 187
 		foreach( $once as $entry ) {
188
-			if( !in_array( glsr_get( $entry, 'level' ), $levels ))continue;
188
+			if( !in_array( glsr_get( $entry, 'level' ), $levels )) {
189
+				continue;
190
+			}
189 191
 			$level = glsr_get( $entry, 'level' );
190 192
 			$message = glsr_get( $entry, 'message' );
191 193
 			$backtraceLine = glsr_get( $entry, 'backtrace' );
@@ -218,7 +220,9 @@  discard block
 block discarded – undo
218 220
 			return glsr_get( $entry, 'level' ) == $level
219 221
 				&& glsr_get( $entry, 'handle' ) == $handle;
220 222
 		});
221
-		if( !empty( $filtered ))return;
223
+		if( !empty( $filtered )) {
224
+			return;
225
+		}
222 226
 		$once[] = [
223 227
 			'backtrace' => $this->getBacktraceLineFromData( $data ),
224 228
 			'handle' => $handle,
@@ -411,7 +415,9 @@  discard block
 block discarded – undo
411 415
 	 */
412 416
 	protected function reset()
413 417
 	{
414
-		if( $this->size() <= pow( 1024, 2 ) / 8 )return;
418
+		if( $this->size() <= pow( 1024, 2 ) / 8 ) {
419
+			return;
420
+		}
415 421
 		$this->clear();
416 422
 		file_put_contents(
417 423
 			$this->file,
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 
11 11
 class Console
12 12
 {
13
-	const DEBUG_0 = 'debug';         // Detailed debug information
14
-	const INFO_1 = 'info';           // Interesting events
15
-	const NOTICE_2 = 'notice';       // Normal but significant events
16
-	const WARNING_3 = 'warning';     // Exceptional occurrences that are not errors
17
-	const ERROR_4 = 'error';         // Runtime errors that do not require immediate action
18
-	const CRITICAL_5 = 'critical';   // Critical conditions
19
-	const ALERT_6 = 'alert';         // Action must be taken immediately
13
+	const DEBUG_0 = 'debug'; // Detailed debug information
14
+	const INFO_1 = 'info'; // Interesting events
15
+	const NOTICE_2 = 'notice'; // Normal but significant events
16
+	const WARNING_3 = 'warning'; // Exceptional occurrences that are not errors
17
+	const ERROR_4 = 'error'; // Runtime errors that do not require immediate action
18
+	const CRITICAL_5 = 'critical'; // Critical conditions
19
+	const ALERT_6 = 'alert'; // Action must be taken immediately
20 20
 	const EMERGENCY_7 = 'emergency'; // System is unusable
21 21
 
22 22
 	protected $file;
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public function get()
113 113
 	{
114
-		return empty( $this->log )
114
+		return empty($this->log)
115 115
 			? __( 'Console is empty', 'site-reviews' )
116 116
 			: $this->log;
117 117
 	}
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function getLevel()
123 123
 	{
124
-		return intval( apply_filters( 'site-reviews/console/level', 2 ));
124
+		return intval( apply_filters( 'site-reviews/console/level', 2 ) );
125 125
 	}
126 126
 
127 127
 	/**
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	public function getLevels()
131 131
 	{
132
-		return array_values(( new ReflectionClass( __CLASS__ ))->getConstants() );
132
+		return array_values( (new ReflectionClass( __CLASS__ ))->getConstants() );
133 133
 	}
134 134
 
135 135
 	/**
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
 	public function humanSize( $valueIfEmpty = null )
149 149
 	{
150 150
 		$bytes = $this->size();
151
-		if( empty( $bytes ) && is_string( $valueIfEmpty )) {
151
+		if( empty($bytes) && is_string( $valueIfEmpty ) ) {
152 152
 			return $valueIfEmpty;
153 153
 		}
154
-		$exponent = floor( log( max( $bytes, 1 ), 1024 ));
155
-		return round( $bytes / pow( 1024, $exponent ), 2 ).' '.['bytes','KB','MB','GB'][$exponent];
154
+		$exponent = floor( log( max( $bytes, 1 ), 1024 ) );
155
+		return round( $bytes / pow( 1024, $exponent ), 2 ).' '.['bytes', 'KB', 'MB', 'GB'][$exponent];
156 156
 	}
157 157
 
158 158
 	/**
@@ -176,15 +176,15 @@  discard block
 block discarded – undo
176 176
 	 */
177 177
 	public function log( $level, $message, $context = [], $backtraceLine = '' )
178 178
 	{
179
-		if( empty( $backtraceLine )) {
179
+		if( empty($backtraceLine) ) {
180 180
 			$backtraceLine = $this->getBacktraceLine();
181 181
 		}
182
-		if( $this->canLogEntry( $level, $backtraceLine )) {
182
+		if( $this->canLogEntry( $level, $backtraceLine ) ) {
183 183
 			$context = glsr( Helper::class )->consolidateArray( $context );
184 184
 			$backtraceLine = $this->normalizeBacktraceLine( $backtraceLine );
185 185
 			$message = $this->interpolate( $message, $context );
186 186
 			$entry = $this->buildLogEntry( $level, $message, $backtraceLine );
187
-			file_put_contents( $this->file, $entry.PHP_EOL, FILE_APPEND|LOCK_EX );
187
+			file_put_contents( $this->file, $entry.PHP_EOL, FILE_APPEND | LOCK_EX );
188 188
 			apply_filters( 'console', $message, $level, $backtraceLine ); // Show in Blackbar plugin if installed
189 189
 			$this->reset();
190 190
 		}
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 		$once = glsr( Helper::class )->consolidateArray( $once );
201 201
 		$levels = $this->getLevels();
202 202
 		foreach( $once as $entry ) {
203
-			if( !in_array( glsr_get( $entry, 'level' ), $levels ))continue;
203
+			if( !in_array( glsr_get( $entry, 'level' ), $levels ) )continue;
204 204
 			$level = glsr_get( $entry, 'level' );
205 205
 			$message = glsr_get( $entry, 'message' );
206 206
 			$backtraceLine = glsr_get( $entry, 'backtrace' );
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
 	{
230 230
 		$once = glsr( Session::class )->get( $this->onceSessionKey, [] );
231 231
 		$once = glsr( Helper::class )->consolidateArray( $once );
232
-		$filtered = array_filter( $once, function( $entry ) use( $level, $handle ) {
232
+		$filtered = array_filter( $once, function( $entry ) use($level, $handle) {
233 233
 			return glsr_get( $entry, 'level' ) == $level
234 234
 				&& glsr_get( $entry, 'handle' ) == $handle;
235 235
 		});
236
-		if( !empty( $filtered ))return;
236
+		if( !empty($filtered) )return;
237 237
 		$once[] = [
238 238
 			'backtrace' => $this->getBacktraceLineFromData( $data ),
239 239
 			'handle' => $handle,
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
 	protected function getBacktraceLine()
315 315
 	{
316 316
 		$backtrace = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 6 );
317
-		$search = array_search( 'log', glsr_array_column( $backtrace, 'function' ));
317
+		$search = array_search( 'log', glsr_array_column( $backtrace, 'function' ) );
318 318
 		if( $search !== false ) {
319
-			$index = glsr_get( $backtrace, ( $search + 2 ).'.function' ) == '{closure}'
319
+			$index = glsr_get( $backtrace, ($search + 2).'.function' ) == '{closure}'
320 320
 				? $search + 4
321 321
 				: $search + 1;
322 322
 			return $this->buildBacktraceLine( $backtrace, $index );
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 	 */
356 356
 	protected function interpolate( $message, $context = [] )
357 357
 	{
358
-		if( $this->isObjectOrArray( $message ) || !is_array( $context )) {
358
+		if( $this->isObjectOrArray( $message ) || !is_array( $context ) ) {
359 359
 			return print_r( $message, true );
360 360
 		}
361 361
 		$replace = [];
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 			glsr()->path( 'plugin/' ),
385 385
 			glsr()->path( 'plugin/', false ),
386 386
 			trailingslashit( glsr()->path() ),
387
-			trailingslashit( glsr()->path( '', false )),
387
+			trailingslashit( glsr()->path( '', false ) ),
388 388
 			WP_CONTENT_DIR,
389 389
 			ABSPATH
390 390
 		];
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 		if( $value instanceof DateTime ) {
413 413
 			$value = $value->format( 'Y-m-d H:i:s' );
414 414
 		}
415
-		else if( $this->isObjectOrArray( $value )) {
415
+		else if( $this->isObjectOrArray( $value ) ) {
416 416
 			$value = json_encode( $value );
417 417
 		}
418 418
 		return (string)$value;
Please login to merge, or discard this patch.
plugin/Modules/Translation.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$translations = $this->translations();
32 32
 		$entries = $this->filter( $translations, $this->entries() )->results();
33
-		array_walk( $translations, function( &$entry ) use( $entries ) {
33
+		array_walk( $translations, function( &$entry ) use($entries) {
34 34
 			$entry['desc'] = array_key_exists( $entry['id'], $entries )
35 35
 				? $this->getEntryString( $entries[$entry['id']], 'msgctxt' )
36 36
 				: '';
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function entries()
45 45
 	{
46
-		if( !isset( $this->entries )) {
46
+		if( !isset($this->entries) ) {
47 47
 			$potFile = glsr()->path( glsr()->languages.'/'.Application::ID.'.pot' );
48 48
 			$entries = $this->extractEntriesFromPotFile( $potFile );
49 49
 			$entries = apply_filters( 'site-reviews/translation/entries', $entries );
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function filter( $filterWith = null, $entries = null, $intersect = true )
90 90
 	{
91
-		if( !is_array( $entries )) {
91
+		if( !is_array( $entries ) ) {
92 92
 			$entries = $this->results;
93 93
 		}
94
-		if( !is_array( $filterWith )) {
94
+		if( !is_array( $filterWith ) ) {
95 95
 			$filterWith = $this->translations();
96 96
 		}
97
-		$keys = array_flip( glsr_array_column( $filterWith, 'id' ));
97
+		$keys = array_flip( glsr_array_column( $filterWith, 'id' ) );
98 98
 		$this->results = $intersect
99 99
 			? array_intersect_key( $entries, $keys )
100 100
 			: array_diff_key( $entries, $keys );
@@ -108,17 +108,17 @@  discard block
 block discarded – undo
108 108
 	public function render( $template, array $entry )
109 109
 	{
110 110
 		$data = array_combine(
111
-			array_map( function( $key ) { return 'data.'.$key; }, array_keys( $entry )),
111
+			array_map( function( $key ) { return 'data.'.$key; }, array_keys( $entry ) ),
112 112
 			$entry
113 113
 		);
114 114
 		$data['data.class'] = $data['data.error'] = '';
115
-		if( array_search( $entry['s1'], glsr_array_column( $this->entries(), 'msgid' )) === false ) {
115
+		if( array_search( $entry['s1'], glsr_array_column( $this->entries(), 'msgid' ) ) === false ) {
116 116
 			$data['data.class'] = 'is-invalid';
117 117
 			$data['data.error'] = __( 'This custom translation is no longer valid as the original text has been changed or removed.', 'site-reviews' );
118 118
 		}
119 119
 		return glsr( Template::class )->build( 'partials/translations/'.$template, [
120 120
 			'context' => $data,
121
-		]);
121
+		] );
122 122
 	}
123 123
 
124 124
 	/**
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
 				'p1' => $this->getEntryString( $entry, 'msgid_plural' ),
151 151
 				's1' => $this->getEntryString( $entry, 'msgid' ),
152 152
 			];
153
-			$text = !empty( $data['p1'] )
153
+			$text = !empty($data['p1'])
154 154
 				? sprintf( '%s | %s', $data['s1'], $data['p1'] )
155 155
 				: $data['s1'];
156 156
 			$rendered .= $this->render( 'result', [
157
-				'entry' => json_encode( $data, JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_TAG|JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE ),
157
+				'entry' => json_encode( $data, JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_TAG | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ),
158 158
 				'text' => wp_strip_all_tags( $text ),
159
-			]);
159
+			] );
160 160
 		}
161 161
 		if( $resetAfterRender ) {
162 162
 			$this->reset();
@@ -189,12 +189,12 @@  discard block
 block discarded – undo
189 189
 	public function search( $needle = '' )
190 190
 	{
191 191
 		$this->reset();
192
-		$needle = trim( strtolower( $needle ));
192
+		$needle = trim( strtolower( $needle ) );
193 193
 		foreach( $this->entries() as $key => $entry ) {
194
-			$single = strtolower( $this->getEntryString( $entry, 'msgid' ));
195
-			$plural = strtolower( $this->getEntryString( $entry, 'msgid_plural' ));
194
+			$single = strtolower( $this->getEntryString( $entry, 'msgid' ) );
195
+			$plural = strtolower( $this->getEntryString( $entry, 'msgid_plural' ) );
196 196
 			if( strlen( $needle ) < static::SEARCH_THRESHOLD ) {
197
-				if( in_array( $needle, [$single, $plural] )) {
197
+				if( in_array( $needle, [$single, $plural] ) ) {
198 198
 					$this->results[$key] = $entry;
199 199
 				}
200 200
 			}
@@ -212,10 +212,10 @@  discard block
 block discarded – undo
212 212
 	public function translations()
213 213
 	{
214 214
 		static $translations;
215
-		if( empty( $translations )) {
215
+		if( empty($translations) ) {
216 216
 			$settings = glsr( OptionManager::class )->get( 'settings' );
217
-			$translations = isset( $settings['strings'] )
218
-				? $this->normalizeSettings( (array) $settings['strings'] )
217
+			$translations = isset($settings['strings'])
218
+				? $this->normalizeSettings( (array)$settings['strings'] )
219 219
 				: [];
220 220
 		}
221 221
 		return $translations;
@@ -227,8 +227,8 @@  discard block
 block discarded – undo
227 227
 	 */
228 228
 	protected function getEntryString( array $entry, $key )
229 229
 	{
230
-		return isset( $entry[$key] )
231
-			? implode( '', (array) $entry[$key] )
230
+		return isset($entry[$key])
231
+			? implode( '', (array)$entry[$key] )
232 232
 			: '';
233 233
 	}
234 234
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 		$keys = [
241 241
 			'msgctxt', 'msgid', 'msgid_plural', 'msgstr', 'msgstr[0]', 'msgstr[1]',
242 242
 		];
243
-		array_walk( $entries, function( &$entry ) use( $keys ) {
243
+		array_walk( $entries, function( &$entry ) use($keys) {
244 244
 			foreach( $keys as $key ) {
245 245
 				try {
246 246
 					$entry = $this->normalizeEntryString( $entry, $key );
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 	 */
261 261
 	protected function normalizeEntryString( array $entry, $key )
262 262
 	{
263
-		if( isset( $entry[$key] )) {
263
+		if( isset($entry[$key]) ) {
264 264
 			$entry[$key] = $this->getEntryString( $entry, $key );
265 265
 		}
266 266
 		return $entry;
@@ -274,11 +274,11 @@  discard block
 block discarded – undo
274 274
 		$defaultString = array_fill_keys( ['id', 's1', 's2', 'p1', 'p2'], '' );
275 275
 		$strings = array_filter( $strings, 'is_array' );
276 276
 		foreach( $strings as &$string ) {
277
-			$string['type'] = isset( $string['p1'] ) ? 'plural' : 'single';
277
+			$string['type'] = isset($string['p1']) ? 'plural' : 'single';
278 278
 			$string = wp_parse_args( $string, $defaultString );
279 279
 		}
280 280
 		return array_filter( $strings, function( $string ) {
281
-			return !empty( $string['id'] );
281
+			return !empty($string['id']);
282 282
 		});
283 283
 	}
284 284
 }
Please login to merge, or discard this patch.
plugin/Controllers/SettingsController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	 */
18 18
 	public function callbackRegisterSettings( $input )
19 19
 	{
20
-		if( !is_array( $input )) {
20
+		if( !is_array( $input ) ) {
21 21
 			$input = ['settings' => []];
22 22
 		}
23 23
 		if( key( $input ) == 'settings' ) {
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 			$options = $this->sanitizeSubmissions( $input, $options );
27 27
 			$options = $this->sanitizeTranslations( $input, $options );
28 28
 			if( filter_input( INPUT_POST, 'option_page' ) == Application::ID.'-settings' ) {
29
-				glsr( Notice::class )->addSuccess( __( 'Settings updated.', 'site-reviews' ));
29
+				glsr( Notice::class )->addSuccess( __( 'Settings updated.', 'site-reviews' ) );
30 30
 			}
31 31
 			return $options;
32 32
 		}
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	{
42 42
 		register_setting( Application::ID.'-settings', OptionManager::databaseKey(), [
43 43
 			'sanitize_callback' => [$this, 'callbackRegisterSettings'],
44
-		]);
44
+		] );
45 45
 	}
46 46
 
47 47
 	/**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	protected function sanitizeSubmissions( array $input, array $options )
67 67
 	{
68 68
 		$inputForm = $input['settings']['submissions'];
69
-		$options['settings']['submissions']['required'] = isset( $inputForm['required'] )
69
+		$options['settings']['submissions']['required'] = isset($inputForm['required'])
70 70
 			? $inputForm['required']
71 71
 			: [];
72 72
 		return $options;
@@ -77,17 +77,17 @@  discard block
 block discarded – undo
77 77
 	 */
78 78
 	protected function sanitizeTranslations( array $input, array $options )
79 79
 	{
80
-		if( isset( $input['settings']['strings'] )) {
81
-			$options['settings']['strings'] = array_values( array_filter( $input['settings']['strings'] ));
80
+		if( isset($input['settings']['strings']) ) {
81
+			$options['settings']['strings'] = array_values( array_filter( $input['settings']['strings'] ) );
82 82
 			$allowedTags = [
83 83
 				'a' => ['class' => [], 'href' => [], 'target' => []],
84 84
 				'span' => ['class' => []],
85 85
 			];
86
-			array_walk( $options['settings']['strings'], function( &$string ) use( $allowedTags ) {
87
-				if( isset( $string['s2'] )) {
86
+			array_walk( $options['settings']['strings'], function( &$string ) use($allowedTags) {
87
+				if( isset($string['s2']) ) {
88 88
 					$string['s2'] = wp_kses( $string['s2'], $allowedTags );
89 89
 				}
90
-				if( isset( $string['p2'] )) {
90
+				if( isset($string['p2']) ) {
91 91
 					$string['p2'] = wp_kses( $string['p2'], $allowedTags );
92 92
 				}
93 93
 			});
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
 	protected function isPolylangActiveAndSupported()
102 102
 	{
103 103
 		if( !glsr( Polylang::class )->isActive() ) {
104
-			glsr( Notice::class )->addError( __( 'Please install/activate the Polylang plugin to enable integration.', 'site-reviews' ));
104
+			glsr( Notice::class )->addError( __( 'Please install/activate the Polylang plugin to enable integration.', 'site-reviews' ) );
105 105
 			return false;
106 106
 		}
107 107
 		else if( !glsr( Polylang::class )->isSupported() ) {
108
-			glsr( Notice::class )->addError( __( 'Please update the Polylang plugin to v2.3.0 or greater to enable integration.', 'site-reviews' ));
108
+			glsr( Notice::class )->addError( __( 'Please update the Polylang plugin to v2.3.0 or greater to enable integration.', 'site-reviews' ) );
109 109
 			return false;
110 110
 		}
111 111
 		return true;
Please login to merge, or discard this patch.