Exemplo n.º 1
0
 /**
  * Get a value of the given type from users.
  *
  * @param PHPDocType $type
  *
  * @throws \RuntimeException
  * @return bool|string|array
  */
 public function getValue($type)
 {
     $rc = null;
     if ($type->isComposite()) {
         $type = $this->getSingleTypeFromComposite($type);
     }
     $typeString = $type->getRepresentation();
     if ($type->isArray()) {
         $rc = $this->getArray();
     } else {
         if ($type->isPrimitiveType()) {
             $rc = $this->getPrimitive($typeString);
         } else {
             $msg = "Getting the value of the type ( {$typeString} ) is not supported yet." . " Please file an enhancement request.";
             throw new \RuntimeException($msg);
         }
     }
     return $rc;
 }