Skip to content

Commit d2414cd

Browse files
committed
Add setType and addType
1 parent 070b137 commit d2414cd

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/Barryvdh/Reflection/DocBlock/Tag/ReturnTag.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,35 @@ public function getType()
8181
return (string) $this->getTypesCollection();
8282
}
8383

84+
/**
85+
* Set the type section of the variable
86+
*
87+
* @param string $type
88+
* @return $this
89+
*/
90+
public function setType($type)
91+
{
92+
$this->type = $type;
93+
$this->types = null;
94+
$this->content = null;
95+
return $this;
96+
}
97+
98+
/**
99+
* Add a type to the type section of the variable
100+
*
101+
* @param string $type
102+
* @return $this
103+
*/
104+
public function addType($type)
105+
{
106+
$this->type = $this->type . Collection::OPERATOR_OR . $type;
107+
$this->types = null;
108+
$this->content = null;
109+
return $this;
110+
}
111+
112+
84113
/**
85114
* Returns the type collection.
86115
*

0 commit comments

Comments
 (0)