Passed
Push — master ( 525778...0f3274 )
by Paul
04:54
created
plugin/Modules/Html/Partials/SiteReviews.php 1 patch
Braces   +33 added lines, -11 removed lines patch added patch discarded remove patch
@@ -74,7 +74,9 @@  discard block
 block discarded – undo
74 74
 		$generatedReview = [];
75 75
 		foreach( $review as $key => $value ) {
76 76
 			$method = glsr( Helper::class )->buildMethodName( $key, 'buildReview' );
77
-			if( !method_exists( $this, $method ))continue;
77
+			if( !method_exists( $this, $method )) {
78
+				continue;
79
+			}
78 80
 			$generatedReview[$key] = $this->$method( $key, $value );
79 81
 		}
80 82
 		return (object)$generatedReview;
@@ -89,9 +91,13 @@  discard block
 block discarded – undo
89 91
 	{
90 92
 		if( !$this->isOptionEnabled( 'settings.reviews.assigned_links.enabled' )
91 93
 			|| empty( $value )
92
-		)return;
94
+		) {
95
+			return;
96
+		}
93 97
 		$post = get_post( intval( $value ));
94
-		if( !( $post instanceof WP_Post ))return;
98
+		if( !( $post instanceof WP_Post )) {
99
+			return;
100
+		}
95 101
 		$permalink = glsr( Builder::class )->a( get_the_title( $post->ID ), [
96 102
 			'href' => get_the_permalink( $post->ID ),
97 103
 		]);
@@ -106,7 +112,9 @@  discard block
 block discarded – undo
106 112
 	 */
107 113
 	protected function buildReviewAuthor( $key, $value )
108 114
 	{
109
-		if( $this->isHidden( $key ))return;
115
+		if( $this->isHidden( $key )) {
116
+			return;
117
+		}
110 118
 		$prefix = !$this->isOptionEnabled( 'settings.reviews.avatars.enabled' )
111 119
 			? apply_filters( 'site-reviews/review/author/prefix', '—' )
112 120
 			: '';
@@ -120,7 +128,9 @@  discard block
 block discarded – undo
120 128
 	 */
121 129
 	protected function buildReviewAvatar( $key, $value )
122 130
 	{
123
-		if( $this->isHidden( $key, 'settings.reviews.avatars.enabled' ))return;
131
+		if( $this->isHidden( $key, 'settings.reviews.avatars.enabled' )) {
132
+			return;
133
+		}
124 134
 		$size = $this->getOption( 'settings.reviews.avatars.size', 36 );
125 135
 		return $this->wrap( $key, glsr( Builder::class )->img([
126 136
 			'src' => $value,
@@ -137,7 +147,9 @@  discard block
 block discarded – undo
137 147
 	protected function buildReviewContent( $key, $value )
138 148
 	{
139 149
 		$text = $this->normalizeText( $value );
140
-		if( $this->isHiddenOrEmpty( $key, $text ))return;
150
+		if( $this->isHiddenOrEmpty( $key, $text )) {
151
+			return;
152
+		}
141 153
 		return $this->wrap( $key, $text );
142 154
 	}
143 155
 
@@ -148,7 +160,9 @@  discard block
 block discarded – undo
148 160
 	 */
149 161
 	protected function buildReviewDate( $key, $value )
150 162
 	{
151
-		if( $this->isHidden( $key ))return;
163
+		if( $this->isHidden( $key )) {
164
+			return;
165
+		}
152 166
 		$dateFormat = $this->getOption( 'settings.reviews.date.format', 'default' );
153 167
 		if( $dateFormat == 'relative' ) {
154 168
 			$date = glsr( Date::class )->relative( $value );
@@ -169,7 +183,9 @@  discard block
 block discarded – undo
169 183
 	 */
170 184
 	protected function buildReviewRating( $key, $value )
171 185
 	{
172
-		if( $this->isHiddenOrEmpty( $key, $value ))return;
186
+		if( $this->isHiddenOrEmpty( $key, $value )) {
187
+			return;
188
+		}
173 189
 		$rating = glsr( Html::class )->buildPartial( 'star-rating', [
174 190
 			'rating' => $value,
175 191
 		]);
@@ -183,7 +199,9 @@  discard block
 block discarded – undo
183 199
 	 */
184 200
 	protected function buildReviewResponse( $key, $value )
185 201
 	{
186
-		if( $this->isHiddenOrEmpty( $key, $value ))return;
202
+		if( $this->isHiddenOrEmpty( $key, $value )) {
203
+			return;
204
+		}
187 205
 		$title = sprintf( __( 'Response from %s', 'site-reviews' ), get_bloginfo( 'name' ));
188 206
 		$text = $this->normalizeText( $value );
189 207
 		return $this->wrap( $key, '<p><strong>'.$title.'</strong></p>'.$text );
@@ -196,7 +214,9 @@  discard block
 block discarded – undo
196 214
 	 */
197 215
 	protected function buildReviewTitle( $key, $value )
198 216
 	{
199
-		if( $this->isHidden( $key ))return;
217
+		if( $this->isHidden( $key )) {
218
+			return;
219
+		}
200 220
 		if( empty( $value )) {
201 221
 			$value = __( 'No Title', 'site-reviews' );
202 222
 		}
@@ -208,7 +228,9 @@  discard block
 block discarded – undo
208 228
 	 */
209 229
 	protected function generateSchema()
210 230
 	{
211
-		if( !wp_validate_boolean( $this->args['schema'] ))return;
231
+		if( !wp_validate_boolean( $this->args['schema'] )) {
232
+			return;
233
+		}
212 234
 		glsr( Schema::class )->store( glsr( Schema::class )->build( $this->args ));
213 235
 	}
214 236
 
Please login to merge, or discard this patch.