Exemplo n.º 1
0
 /**
  * Get the type string for the given parameter name.
  *
  * @param $name
  *
  * @return \Box\TestScribe\PHPDoc\PHPDocType
  */
 public function getParamTypeString($name)
 {
     // @TODO (ryang 5/31/14) : handle parameters with multiple types and array type.
     $argumentService = new MethodArgumentService();
     // @TODO (ryang 12/5/14) : optimization: scan all parameters in one pass.
     // Check if the parameter is a class and has type information using type hinting
     $paramClassName = $argumentService->getFullyQualifiedClassNameIfAvailable($this->reflectionMethod, $name);
     if ($paramClassName) {
         $type = PHPDoc\PHPDocType::lookup($paramClassName);
     } else {
         // Fall back to PHPDoc
         $type = $this->getParamInfo($name);
     }
     return $type;
 }