Code Duplication    Length = 7-12 lines in 2 locations

core/Helper/Helper.php 2 locations

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