@@ -84,7 +84,9 @@ discard block |
||
84 | 84 | $reviewValues = []; |
85 | 85 | foreach( $review as $key => $value ) { |
86 | 86 | $method = glsr( Helper::class )->buildMethodName( $key, 'buildOption' ); |
87 | - if( !method_exists( $this, $method ))continue; |
|
87 | + if( !method_exists( $this, $method )) { |
|
88 | + continue; |
|
89 | + } |
|
88 | 90 | $reviewValues[$key] = $this->$method( $key, $value ); |
89 | 91 | } |
90 | 92 | $reviewValues = apply_filters( 'site-reviews/review/build/after', (array)$reviewValues ); |
@@ -98,9 +100,13 @@ discard block |
||
98 | 100 | */ |
99 | 101 | protected function buildOptionAssignedTo( $key, $value ) |
100 | 102 | { |
101 | - if( $this->isHidden( $key, 'settings.reviews.assigned_links' ))return; |
|
103 | + if( $this->isHidden( $key, 'settings.reviews.assigned_links' )) { |
|
104 | + return; |
|
105 | + } |
|
102 | 106 | $post = get_post( intval( $value )); |
103 | - if( !( $post instanceof WP_Post ))return; |
|
107 | + if( !( $post instanceof WP_Post )) { |
|
108 | + return; |
|
109 | + } |
|
104 | 110 | $permalink = glsr( Builder::class )->a( get_the_title( $post->ID ), [ |
105 | 111 | 'href' => get_the_permalink( $post->ID ), |
106 | 112 | ]); |
@@ -115,7 +121,9 @@ discard block |
||
115 | 121 | */ |
116 | 122 | protected function buildOptionAuthor( $key, $value ) |
117 | 123 | { |
118 | - if( $this->isHidden( $key ))return; |
|
124 | + if( $this->isHidden( $key )) { |
|
125 | + return; |
|
126 | + } |
|
119 | 127 | return $this->wrap( $key, '<span>'.$value.'</span>' ); |
120 | 128 | } |
121 | 129 | |
@@ -126,7 +134,9 @@ discard block |
||
126 | 134 | */ |
127 | 135 | protected function buildOptionAvatar( $key, $value ) |
128 | 136 | { |
129 | - if( $this->isHidden( $key, 'settings.reviews.avatars' ))return; |
|
137 | + if( $this->isHidden( $key, 'settings.reviews.avatars' )) { |
|
138 | + return; |
|
139 | + } |
|
130 | 140 | $size = $this->getOption( 'settings.reviews.avatars_size', 40 ); |
131 | 141 | return $this->wrap( $key, glsr( Builder::class )->img([ |
132 | 142 | 'src' => $this->generateAvatar( $value ), |
@@ -143,7 +153,9 @@ discard block |
||
143 | 153 | protected function buildOptionContent( $key, $value ) |
144 | 154 | { |
145 | 155 | $text = $this->normalizeText( $value ); |
146 | - if( $this->isHiddenOrEmpty( $key, $text ))return; |
|
156 | + if( $this->isHiddenOrEmpty( $key, $text )) { |
|
157 | + return; |
|
158 | + } |
|
147 | 159 | return $this->wrap( $key, '<p>'.$text.'</p>' ); |
148 | 160 | } |
149 | 161 | |
@@ -154,7 +166,9 @@ discard block |
||
154 | 166 | */ |
155 | 167 | protected function buildOptionDate( $key, $value ) |
156 | 168 | { |
157 | - if( $this->isHidden( $key ))return; |
|
169 | + if( $this->isHidden( $key )) { |
|
170 | + return; |
|
171 | + } |
|
158 | 172 | $dateFormat = $this->getOption( 'settings.reviews.date.format', 'default' ); |
159 | 173 | if( $dateFormat == 'relative' ) { |
160 | 174 | $date = glsr( Date::class )->relative( $value ); |
@@ -175,7 +189,9 @@ discard block |
||
175 | 189 | */ |
176 | 190 | protected function buildOptionRating( $key, $value ) |
177 | 191 | { |
178 | - if( $this->isHiddenOrEmpty( $key, $value ))return; |
|
192 | + if( $this->isHiddenOrEmpty( $key, $value )) { |
|
193 | + return; |
|
194 | + } |
|
179 | 195 | $rating = glsr( Partial::class )->build( 'star-rating', [ |
180 | 196 | 'rating' => $value, |
181 | 197 | ]); |
@@ -189,7 +205,9 @@ discard block |
||
189 | 205 | */ |
190 | 206 | protected function buildOptionResponse( $key, $value ) |
191 | 207 | { |
192 | - if( $this->isHiddenOrEmpty( $key, $value ))return; |
|
208 | + if( $this->isHiddenOrEmpty( $key, $value )) { |
|
209 | + return; |
|
210 | + } |
|
193 | 211 | $title = sprintf( __( 'Response from %s', 'site-reviews' ), get_bloginfo( 'name' )); |
194 | 212 | $text = $this->normalizeText( $value ); |
195 | 213 | $text = '<p><strong>'.$title.'</strong></p><p>'.$text.'</p>'; |
@@ -206,7 +224,9 @@ discard block |
||
206 | 224 | */ |
207 | 225 | protected function buildOptionTitle( $key, $value ) |
208 | 226 | { |
209 | - if( $this->isHidden( $key ))return; |
|
227 | + if( $this->isHidden( $key )) { |
|
228 | + return; |
|
229 | + } |
|
210 | 230 | if( empty( $value )) { |
211 | 231 | $value = __( 'No Title', 'site-reviews' ); |
212 | 232 | } |
@@ -238,7 +258,9 @@ discard block |
||
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 |
||
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 ); |