Code Duplication    Length = 7-12 lines in 2 locations

core/Helper/Helper.php 2 locations

@@ 253-264 (lines=12) @@
250
	 * @param  string $label
251
	 * @return string
252
	 */
253
	public static function normalize_label( $label ) {
254
		// remove the leading underscore(if it's there)
255
		$label = preg_replace( '~^_~', '', $label );
256
257
		// remove the leading "crb_"(if it's there)
258
		$label = preg_replace( '~^crb_~', '', $label );
259
260
		// split the name into words and make them capitalized
261
		$label = mb_convert_case( str_replace( '_', ' ', $label ), MB_CASE_TITLE );
262
263
		return $label;
264
	}
265
266
	/**
267
	 * Normalize a type string representing an object type
@@ 272-278 (lines=7) @@
269
	 * @param  string $type
270
	 * @return string
271
	 */
272
	public static function normalize_type( $type ) {
273
		$normalized_type = str_replace( ' ', '_', $type );
274
		$normalized_type = preg_replace( '/[_\s]+/', '_', $normalized_type );
275
		$normalized_type = preg_replace( '/^_|_$/', '', $normalized_type );
276
		$normalized_type = strtolower( $normalized_type );
277
		return $normalized_type;
278
	}
279
280
	/**
281
	 * Convert a string representing an object type to a fully qualified class name