1 | <?php |
||
20 | final class Argument |
||
21 | { |
||
22 | /** |
||
23 | * @var string name of the Argument |
||
24 | */ |
||
25 | private $name = null; |
||
26 | |||
27 | /** @var string[] $type an array of normalized types that should be in this Argument */ |
||
28 | private $types = []; |
||
29 | |||
30 | /** @var string|null $default the default value for an argument or null if none is provided */ |
||
31 | private $default = null; |
||
32 | |||
33 | /** @var bool $byReference whether the argument passes the parameter by reference instead of by value */ |
||
34 | private $byReference = false; |
||
35 | |||
36 | /** @var boolean Determines if this Argument represents a variadic argument */ |
||
37 | private $isVariadic = false; |
||
38 | |||
39 | /** |
||
40 | * Initializes the object. |
||
41 | */ |
||
42 | 4 | public function __construct(string $name, string $default = null, bool $byReference = false, bool $isVariadic = false) |
|
49 | |||
50 | /** |
||
51 | * Returns the name of this argument. |
||
52 | */ |
||
53 | 1 | public function getName(): string |
|
57 | |||
58 | /** |
||
59 | * {@inheritDoc} |
||
60 | */ |
||
61 | 1 | public function getTypes(): array |
|
65 | |||
66 | /** |
||
67 | * Add a type. |
||
68 | * @param mixed $type |
||
69 | */ |
||
70 | 1 | public function addType($type): void |
|
74 | |||
75 | /** |
||
76 | * {@inheritDoc} |
||
77 | */ |
||
78 | 1 | public function getDefault(): ?string |
|
82 | |||
83 | /** |
||
84 | * {@inheritDoc} |
||
85 | */ |
||
86 | 1 | public function isByReference(): bool |
|
90 | |||
91 | /** |
||
92 | * Returns whether this argument represents a variadic argument. |
||
93 | */ |
||
94 | 1 | public function isVariadic(): bool |
|
98 | } |
||
99 |