ArrayUtilities does not seem to conform to the naming convention (Utils?$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
Loading history...
11
{
12
6
public static function is_multidimensional(array &$array)
This check looks for method names that are not written in camelCase.
In camelCase names are written without any punctuation, the start of each new
word being marked by a capital letter. Thus the name
database connection seeker becomes databaseConnectionSeeker.
function is_multidimensional() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
Loading history...
13
{
14
6
foreach ($array as $element)
15
{
16
6
if (is_array($element))
17
6
{
18
1
return true;
19
}
20
5
}
21
22
5
return false;
23
}
24
25
/**
26
* @param array $array1
27
* @param array $array2
28
* @param string $keyField
29
*
30
* @return array
31
*/
32
27
public static function array_merge_defaults(array &$array1, array &$array2, $keyField)
function array_merge_defaults() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
This check looks for method names that are not written in camelCase.
In camelCase names are written without any punctuation, the start of each new
word being marked by a capital letter. Thus the name
database connection seeker becomes databaseConnectionSeeker.
Loading history...
33
{
34
27
$merged = $array1;
35
36
27
foreach ($array2 as $key => &$value)
37
{
38
14
$valueMerged = false;
39
40
14
foreach ($merged as $mergedKey => &$item)
41
{
42
14
if (is_array($item) && array_key_exists($keyField, $item) && $item[$keyField] == $value[$keyField])
43
14
{
44
$item = array_merge($item, $value);
45
$valueMerged = true;
46
47
break;
48
}
49
14
elseif ($mergedKey == $key)
50
{
51
14
if (is_numeric($mergedKey))
52
14
{
53
$merged[] = $value;
54
}
55
14
elseif (is_array($item))
56
{
57
14
$item = array_unique(array_merge($item, $value));
58
14
}
59
else
60
{
61
14
$item = $value;
62
}
63
64
14
$valueMerged = true;
65
66
14
break;
67
}
68
14
}
69
70
14
if (!$valueMerged)
71
14
{
72
14
$merged[$key] = $value;
73
14
}
74
27
}
75
76
27
return $merged;
77
}
78
79
/**
80
* @param string $key
81
* @param array $array
82
* @param bool $considerOffset
83
*
84
* @return array
85
*/
86
public static function associative_array_split($key, array &$array, $considerOffset = true)
function associative_array_split() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
This check looks for method names that are not written in camelCase.
In camelCase names are written without any punctuation, the start of each new
word being marked by a capital letter. Thus the name
database connection seeker becomes databaseConnectionSeeker.
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.