1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\PHPDoc\Tag; |
4: | |
5: | use Salient\Core\Concern\HasMutator; |
6: | |
7: | |
8: | |
9: | |
10: | class VarTag extends AbstractTag |
11: | { |
12: | use HasMutator; |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | public function __construct( |
20: | string $type, |
21: | ?string $name = null, |
22: | ?string $description = null, |
23: | ?string $class = null, |
24: | ?string $member = null |
25: | ) { |
26: | parent::__construct('var', $name, $type, $description, $class, $member); |
27: | } |
28: | |
29: | |
30: | |
31: | |
32: | public function getType(): string |
33: | { |
34: | return $this->Type; |
35: | } |
36: | |
37: | |
38: | |
39: | |
40: | |
41: | |
42: | public function withName(?string $name) |
43: | { |
44: | if ($name === null) { |
45: | return $this->without('Name'); |
46: | } |
47: | return $this->with('Name', $this->filterString($name, 'name')); |
48: | } |
49: | } |
50: | |