- if ($this->name !== "__construct" && $this->returns[0]) {
- $tags[] = "return {$this->returns[0]} {$this->returns[1]}";
+ if ($this->name !== "__construct" && $this->returns) {
+
+ if (count($this->returns) > 1) {
+ $type = implode("|", $this->saneTypes(array_column($this->returns, 0)));
+ $desc = "";
+ foreach ($this->returns as list($typ, $ret)) {
+ if (strlen($desc)) {
+ $desc .= "\n\t\t or ";
+ }
+ $desc .= $this->saneType($typ, false) . " " . $ret;
+ }
+ } else {
+ $type = $this->saneType($this->returns[0][0], false);
+ $desc = $this->returns[0][1];
+ }
+ $tags[] = "return $type $desc";