Passed
Push — master ( 71fe18...341f99 )
by Paul
05:12
created
site-reviews.php 1 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__.'/deprecated.php';
Please login to merge, or discard this patch.
plugin/Modules/Html/Partials/SiteReviews.php 1 patch
Braces   +39 added lines, -13 removed lines patch added patch discarded remove patch
@@ -83,7 +83,9 @@  discard block
 block discarded – undo
83 83
 		$reviewValues = [];
84 84
 		foreach( $review as $key => $value ) {
85 85
 			$method = glsr( Helper::class )->buildMethodName( $key, 'buildOption' );
86
-			if( !method_exists( $this, $method ))continue;
86
+			if( !method_exists( $this, $method )) {
87
+				continue;
88
+			}
87 89
 			$reviewValues[$key] = $this->$method( $key, $value );
88 90
 		}
89 91
 		$reviewValues = apply_filters( 'site-reviews/review/build/after', (array)$reviewValues );
@@ -97,9 +99,13 @@  discard block
 block discarded – undo
97 99
 	 */
98 100
 	protected function buildOptionAssignedTo( $key, $value )
99 101
 	{
100
-		if( $this->isHiddenOrEmpty( $key, 'settings.reviews.assigned_links.enabled' ))return;
102
+		if( $this->isHiddenOrEmpty( $key, 'settings.reviews.assigned_links.enabled' )) {
103
+			return;
104
+		}
101 105
 		$post = get_post( intval( $value ));
102
-		if( !( $post instanceof WP_Post ))return;
106
+		if( !( $post instanceof WP_Post )) {
107
+			return;
108
+		}
103 109
 		$permalink = glsr( Builder::class )->a( get_the_title( $post->ID ), [
104 110
 			'href' => get_the_permalink( $post->ID ),
105 111
 		]);
@@ -114,7 +120,9 @@  discard block
 block discarded – undo
114 120
 	 */
115 121
 	protected function buildOptionAuthor( $key, $value )
116 122
 	{
117
-		if( $this->isHidden( $key ))return;
123
+		if( $this->isHidden( $key )) {
124
+			return;
125
+		}
118 126
 		$prefix = !$this->isOptionEnabled( 'settings.reviews.avatars.enabled' )
119 127
 			? apply_filters( 'site-reviews/review/author/prefix', '—' )
120 128
 			: '';
@@ -128,7 +136,9 @@  discard block
 block discarded – undo
128 136
 	 */
129 137
 	protected function buildOptionAvatar( $key, $value )
130 138
 	{
131
-		if( $this->isHidden( $key, 'settings.reviews.avatars.enabled' ))return;
139
+		if( $this->isHidden( $key, 'settings.reviews.avatars.enabled' )) {
140
+			return;
141
+		}
132 142
 		$size = $this->getOption( 'settings.reviews.avatars.size', 40 );
133 143
 		return $this->wrap( $key, glsr( Builder::class )->img([
134 144
 			'src' => $this->generateAvatar( $value ),
@@ -145,7 +155,9 @@  discard block
 block discarded – undo
145 155
 	protected function buildOptionContent( $key, $value )
146 156
 	{
147 157
 		$text = $this->normalizeText( $value );
148
-		if( $this->isHiddenOrEmpty( $key, $text ))return;
158
+		if( $this->isHiddenOrEmpty( $key, $text )) {
159
+			return;
160
+		}
149 161
 		return $this->wrap( $key, '<p>'.$text.'</p>' );
150 162
 	}
151 163
 
@@ -156,7 +168,9 @@  discard block
 block discarded – undo
156 168
 	 */
157 169
 	protected function buildOptionDate( $key, $value )
158 170
 	{
159
-		if( $this->isHidden( $key ))return;
171
+		if( $this->isHidden( $key )) {
172
+			return;
173
+		}
160 174
 		$dateFormat = $this->getOption( 'settings.reviews.date.format', 'default' );
161 175
 		if( $dateFormat == 'relative' ) {
162 176
 			$date = glsr( Date::class )->relative( $value );
@@ -177,7 +191,9 @@  discard block
 block discarded – undo
177 191
 	 */
178 192
 	protected function buildOptionRating( $key, $value )
179 193
 	{
180
-		if( $this->isHiddenOrEmpty( $key, $value ))return;
194
+		if( $this->isHiddenOrEmpty( $key, $value )) {
195
+			return;
196
+		}
181 197
 		$rating = glsr( Html::class )->buildPartial( 'star-rating', [
182 198
 			'rating' => $value,
183 199
 		]);
@@ -191,7 +207,9 @@  discard block
 block discarded – undo
191 207
 	 */
192 208
 	protected function buildOptionResponse( $key, $value )
193 209
 	{
194
-		if( $this->isHiddenOrEmpty( $key, $value ))return;
210
+		if( $this->isHiddenOrEmpty( $key, $value )) {
211
+			return;
212
+		}
195 213
 		$title = sprintf( __( 'Response from %s', 'site-reviews' ), get_bloginfo( 'name' ));
196 214
 		$text = $this->normalizeText( $value );
197 215
 		$text = '<p><strong>'.$title.'</strong></p><p>'.$text.'</p>';
@@ -208,7 +226,9 @@  discard block
 block discarded – undo
208 226
 	 */
209 227
 	protected function buildOptionTitle( $key, $value )
210 228
 	{
211
-		if( $this->isHidden( $key ))return;
229
+		if( $this->isHidden( $key )) {
230
+			return;
231
+		}
212 232
 		if( empty( $value )) {
213 233
 			$value = __( 'No Title', 'site-reviews' );
214 234
 		}
@@ -238,7 +258,9 @@  discard block
 block discarded – undo
238 258
 	 */
239 259
 	protected function generateSchema()
240 260
 	{
241
-		if( !wp_validate_boolean( $this->args['schema'] ))return;
261
+		if( !wp_validate_boolean( $this->args['schema'] )) {
262
+			return;
263
+		}
242 264
 		glsr( Schema::class )->store(
243 265
 			glsr( Schema::class )->build( $this->args )
244 266
 		);
@@ -288,9 +310,13 @@  discard block
 block discarded – undo
288 310
 		$words->setText( $text );
289 311
 		$count = 0;
290 312
 		foreach( $words as $offset ){
291
-			if( $words->getRuleStatus() === IntlRuleBasedBreakIterator::WORD_NONE )continue;
313
+			if( $words->getRuleStatus() === IntlRuleBasedBreakIterator::WORD_NONE ) {
314
+				continue;
315
+			}
292 316
 			$count++;
293
-			if( $count != $limit )continue;
317
+			if( $count != $limit ) {
318
+				continue;
319
+			}
294 320
 			return $offset;
295 321
 		}
296 322
 		return strlen( $text );
Please login to merge, or discard this patch.