Code Duplication    Length = 13-17 lines in 2 locations

includes/SiteConfiguration.php 2 locations

@@ 216-228 (lines=13) @@
213
214
				// Do tag settings
215
				foreach ( $params['tags'] as $tag ) {
216
					if ( array_key_exists( $tag, $thisSetting ) ) {
217
						if ( is_array( $retval ) && is_array( $thisSetting[$tag] ) ) {
218
							$retval = self::arrayMerge( $retval, $thisSetting[$tag] );
219
						} else {
220
							$retval = $thisSetting[$tag];
221
						}
222
						break 2;
223
					} elseif ( array_key_exists( "+$tag", $thisSetting ) && is_array( $thisSetting["+$tag"] ) ) {
224
						if ( $retval === null ) {
225
							$retval = [];
226
						}
227
						$retval = self::arrayMerge( $retval, $thisSetting["+$tag"] );
228
					}
229
				}
230
				// Do suffix settings
231
				$suffix = $params['suffix'];
@@ 232-248 (lines=17) @@
229
				}
230
				// Do suffix settings
231
				$suffix = $params['suffix'];
232
				if ( !is_null( $suffix ) ) {
233
					if ( array_key_exists( $suffix, $thisSetting ) ) {
234
						if ( is_array( $retval ) && is_array( $thisSetting[$suffix] ) ) {
235
							$retval = self::arrayMerge( $retval, $thisSetting[$suffix] );
236
						} else {
237
							$retval = $thisSetting[$suffix];
238
						}
239
						break;
240
					} elseif ( array_key_exists( "+$suffix", $thisSetting )
241
						&& is_array( $thisSetting["+$suffix"] )
242
					) {
243
						if ( $retval === null ) {
244
							$retval = [];
245
						}
246
						$retval = self::arrayMerge( $retval, $thisSetting["+$suffix"] );
247
					}
248
				}
249
250
				// Fall back to default.
251
				if ( array_key_exists( 'default', $thisSetting ) ) {