1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\PhpDoc\Tag;
4:
5: use PHPStan\Type\Type;
6:
7: /**
8: * @api
9: */
10: final class ReturnTag implements TypedTag
11: {
12:
13: public function __construct(private Type $type, private bool $isExplicit)
14: {
15: }
16:
17: public function getType(): Type
18: {
19: return $this->type;
20: }
21:
22: public function isExplicit(): bool
23: {
24: return $this->isExplicit;
25: }
26:
27: public function withType(Type $type): self
28: {
29: return new self($type, $this->isExplicit);
30: }
31:
32: public function toImplicit(): self
33: {
34: return new self($this->type, false);
35: }
36:
37: }
38: