1: <?php declare(strict_types=1);
2:
3: namespace Salient\PHPDoc\Tag;
4:
5: /**
6: * @api
7: */
8: class ReturnTag extends AbstractTag
9: {
10: /**
11: * Creates a new ReturnTag object
12: */
13: public function __construct(
14: string $type,
15: ?string $description = null,
16: ?string $class = null,
17: ?string $member = null,
18: array $aliases = []
19: ) {
20: parent::__construct('return', null, $type, $description, $class, $member, $aliases);
21: }
22:
23: /**
24: * @inheritDoc
25: */
26: public function getType(): string
27: {
28: return $this->Type;
29: }
30:
31: /**
32: * @inheritDoc
33: */
34: public function __toString(): string
35: {
36: $string = "@{$this->Tag} {$this->Type}";
37: if ($this->Description !== null) {
38: $string .= " {$this->Description}";
39: }
40: return $string;
41: }
42: }
43: