19 declare(strict_types=1);
44 if (!is_array($array)) {
53 public function isString($string,
bool $allow_empty =
true): void
55 if (!is_string($string)) {
56 if (is_array($string)) {
57 $string = json_encode($string);
61 if (!$allow_empty && $string ==
"") {
70 public function isIndex($index, array $array): void
72 if (!array_key_exists($index, $array)) {
83 if (array_key_exists($index, $array)) {
92 public function hasIndex(array $array, $index): void
94 if (!array_key_exists($index, $array)) {
103 public function isTypeOf($element,
string $class_name): void
105 if (!get_class($element) == $class_name) {
106 throw $this->f->exception(
108 "Expected: " . $class_name .
" got " . get_class($element)
isString($string, bool $allow_empty=true)
isIndex($index, array $array)
isNotIndex($index, array $array)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isTypeOf($element, string $class_name)
Tests properties and throws exceptions if not met.
hasIndex(array $array, $index)