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