Ejemplo n.º 1
0
 /**
  * Infer the response type from the responseClass value
  */
 protected function inferResponseType()
 {
     static $primitives = array('array' => 1, 'boolean' => 1, 'string' => 1, 'integer' => 1, '' => 1);
     if (isset($primitives[$this->responseClass])) {
         $this->responseType = self::TYPE_PRIMITIVE;
     } elseif ($this->description && $this->description->hasModel($this->responseClass)) {
         $this->responseType = self::TYPE_MODEL;
     } else {
         $this->responseType = self::TYPE_CLASS;
     }
 }
 /**
  * Infer the response type from the responseClass value
  */
 protected function inferResponseType()
 {
     if (!$this->responseClass || $this->responseClass == 'array' || $this->responseClass == 'string' || $this->responseClass == 'boolean' || $this->responseClass == 'integer') {
         $this->responseType = self::TYPE_PRIMITIVE;
     } elseif ($this->description && $this->description->hasModel($this->responseClass)) {
         $this->responseType = self::TYPE_MODEL;
     } elseif (strpos($this->responseClass, '\\') !== false) {
         $this->responseType = self::TYPE_CLASS;
     } else {
         $this->responseType = self::TYPE_PRIMITIVE;
     }
 }