protected function validateType($type, $data) { $types = (array) $type; $result = false; foreach ($types as $type) { if (Utils::checkType($type, $data)) { $result = true; break; } } if (!$result) { $this->throwError(sprintf("value must be of type '%s'", implode(', ', $types))); } }
public function testFail() { $value = array(1, 2, 3); $this->assertFalse(Utils::checkType('object', $value)); }