Code Duplication    Length = 8-10 lines in 2 locations

func/array.php 1 location

@@ 26-33 (lines=8) @@
23
 * @param	mixed	$val		Default val if not assigned.
24
 */
25
function ArrayAdd (&$ar_srce, $key, $val = 1) {
26
	if (isset($ar_srce[$key])) {
27
		if (is_string($val))
28
			$ar_srce[$key] .= $val;
29
		else
30
			$ar_srce[$key] += $val;
31
	}
32
	else
33
		$ar_srce[$key] = $val;
34
35
	return $ar_srce;
36
} // end of func ArrayAdd

src/Fwlib/Util/Common/ArrayUtil.php 1 location

@@ 66-75 (lines=10) @@
63
     */
64
    public function increaseByKey(&$source, $key, $val = 1)
65
    {
66
        if (isset($source[$key])) {
67
            // Force type of result value by param $val
68
            if (is_string($val)) {
69
                $source[$key] .= $val;
70
            } else {
71
                $source[$key] += $val;
72
            }
73
        } else {
74
            $source[$key] = $val;
75
        }
76
77
        return $source;
78
    }