This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
40
{
41
if (null == $var) {
42
return true;
43
}
44
if (!($var instanceof $insanceOf)) {
45
return false;
46
}
47
return false;
48
}
49
50
protected function isValidArray($arr, $instanceOf, $minCount = -1, $maxCount = -1)
51
{
52
if (null == $arr) {
53
return false;
54
}
55
if (!is_array($arr)) {
56
return false;
57
}
58
$numberOfItem = count($arr);
59
if ($minCount != -1 && $numberOfItem < $minCount) {
60
return false;
61
}
62
if ($maxCount != -1 && $numberOfItem > $maxCount) {
63
return false;
64
}
65
foreach ($arr as $item) {
66
if (!($item instanceof $instanceOf)) {
67
return false;
68
}
69
}
70
return true;
71
}
72
73
protected function IsChildArrayOK(array $arr, &$msg)
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.