1: <?php declare(strict_types=1);
2:
3: namespace Salient\PHPDoc\Tag;
4:
5: /**
6: * A "@param" tag
7: */
8: class ParamTag extends AbstractTag
9: {
10: protected bool $IsPassedByReference;
11: protected bool $IsVariadic;
12:
13: /**
14: * Creates a new ParamTag object
15: *
16: * @param class-string|null $class
17: */
18: public function __construct(
19: string $name,
20: ?string $type = null,
21: bool $isPassedByReference = false,
22: bool $isVariadic = false,
23: ?string $description = null,
24: ?string $class = null,
25: ?string $member = null
26: ) {
27: parent::__construct('param', $name, $type, $description, $class, $member);
28: $this->IsPassedByReference = $isPassedByReference;
29: $this->IsVariadic = $isVariadic;
30: }
31:
32: /**
33: * @inheritDoc
34: */
35: public function getName(): string
36: {
37: return $this->Name;
38: }
39:
40: /**
41: * Check if the parameter is passed by reference
42: */
43: public function isPassedByReference(): bool
44: {
45: return $this->IsPassedByReference;
46: }
47:
48: /**
49: * Check if the parameter is variadic
50: */
51: public function isVariadic(): bool
52: {
53: return $this->IsVariadic;
54: }
55: }
56: