Code Duplication    Length = 7-12 lines in 2 locations

core/Helper/Helper.php 2 locations

@@ 296-307 (lines=12) @@
293
	 * @param  string $label
294
	 * @return string
295
	 */
296
	public static function normalize_label( $label ) {
297
		// remove the leading underscore(if it's there)
298
		$label = preg_replace( '~^_~', '', $label );
299
300
		// remove the leading "crb_"(if it's there)
301
		$label = preg_replace( '~^crb_~', '', $label );
302
303
		// split the name into words and make them capitalized
304
		$label = mb_convert_case( str_replace( '_', ' ', $label ), MB_CASE_TITLE );
305
306
		return $label;
307
	}
308
309
	/**
310
	 * Normalize a type string representing an object type
@@ 315-321 (lines=7) @@
312
	 * @param  string $type
313
	 * @return string
314
	 */
315
	public static function normalize_type( $type ) {
316
		$normalized_type = str_replace( ' ', '_', $type );
317
		$normalized_type = preg_replace( '/[_\s]+/', '_', $normalized_type );
318
		$normalized_type = preg_replace( '/^_|_$/', '', $normalized_type );
319
		$normalized_type = strtolower( $normalized_type );
320
		return $normalized_type;
321
	}
322
323
	/**
324
	 * Convert a string representing an object type to a fully qualified class name