28 function ($value) use ($on_element) {
29 if (!is_array($value)) {
32 foreach ($value as $item) {
33 if (!$on_element->
accepts($item)) {
40 function (
$txt, $value) use ($on_element) {
41 if (!is_array($value)) {
42 return $txt(
"not_an_array", gettype($value));
45 foreach ($value as $item) {
47 if ($sub_problem !== null) {
48 $sub_problems[] = $sub_problem;
51 return $txt(
"not_an_array_of", implode(
" ", $sub_problems));
A constraint encodes some resrtictions on values.
problemWith($value)
Tells what the problem with the provided value is.
accepts($value)
Tells if the provided value complies.
__construct(Data\Factory $data_factory, Constraint $on_element, \ilLanguage $lng)
IsArrayOf constructor.