Code Duplication    Length = 19-19 lines in 2 locations

engine/classes/ElggDiskFilestore.php 1 location

@@ 393-411 (lines=19) @@
390
	 * @return array
391
	 * @deprecated 1.8 Files are stored by date and guid; no need for this.
392
	 */
393
	private function mb_str_split($string, $charset = 'UTF8') {
394
		elgg_deprecated_notice('\ElggDiskFilestore::mb_str_split() is deprecated.', 1.8);
395
396
		if (is_callable('mb_substr')) {
397
			$length = mb_strlen($string);
398
			$array = array();
399
400
			while ($length) {
401
				$array[] = mb_substr($string, 0, 1, $charset);
402
				$string = mb_substr($string, 1, $length, $charset);
403
404
				$length = mb_strlen($string);
405
			}
406
407
			return $array;
408
		} else {
409
			return str_split($string);
410
		}
411
	}
412
	// @codingStandardsIgnoreEnd
413
414
	/**

engine/lib/upgrades/2009102801.php 1 location

@@ 68-86 (lines=19) @@
65
 *
66
 * @return array|false
67
 */
68
function mb_str_split($string, $charset = 'UTF8') {
69
	if (is_callable('mb_substr')) {
70
		$length = mb_strlen($string);
71
		$array = array();
72
73
		while ($length) {
74
			$array[] = mb_substr($string, 0, 1, $charset);
75
			$string = mb_substr($string, 1, $length, $charset);
76
77
			$length = mb_strlen($string);
78
		}
79
80
		return $array;
81
	} else {
82
		return str_split($string);
83
	}
84
85
	return false;
86
}
87
88
89
/**