Conditions | 6 |
Paths | 12 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public static function isElementValid($element, $array) |
||
21 | { |
||
22 | foreach ($array as $key => $item) { |
||
23 | if (is_object($item)) { |
||
24 | $array[$key] = ArrayConverter::convertToPlainArray($item); |
||
25 | } |
||
26 | } |
||
27 | |||
28 | if (is_object($element)) { |
||
29 | $element = ArrayConverter::convertToPlainArray($element); |
||
30 | } |
||
31 | |||
32 | $FirstItemKeyMap = array_keys(current($array)); |
||
33 | $ItemKeyMap = array_keys($element); |
||
34 | |||
35 | if (count(array_diff($FirstItemKeyMap, $ItemKeyMap)) > 0 || count(array_diff($ItemKeyMap, $FirstItemKeyMap)) > 0) { |
||
36 | return false; |
||
37 | } |
||
38 | |||
39 | return true; |
||
40 | } |
||
57 |