private function setupProperty($value) { @(list($id, $typeAndDesc) = explode(':', $value, 2)); if (!isset($typeAndDesc)) { die('The type of property ' . $id . ' is empty.'); } @(list($type, $description) = explode(' ', $typeAndDesc, 2)); if (isset($description)) { $this->curParams['description'] = $description; } $type = trim($type); $this->curParams['id'] = $id; if (TypeUtils::isArray($type)) { if (TypeUtils::isPrimitive(TypeUtils::getType($type))) { $itemType = 'type'; } else { $itemType = '$ref'; } $this->curParams['itemType'] = $itemType; $this->curParams['items'] = TypeUtils::getType($type); $type = 'Array'; } else { if (TypeUtils::isRange($type)) { list($min, $max) = TypeUtils::getRange($type); $this->curParams['min'] = intval(trim($min)); $this->curParams['max'] = intval(trim($max)); $this->curParams['valueType'] = 'RANGE'; $type = 'int'; } else { if (TypeUtils::isList($type)) { list($type, $values) = TypeUtils::getList($type); $this->curParams['values'] = $values; $this->curParams['valueType'] = "LIST"; } } } $this->curParams['type'] = $type; }