| Total Complexity | 5 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 16 | final class Parameter implements HasType, Stringable |
||
| 17 | { |
||
| 18 | use WithVariable; |
||
| 19 | |||
| 20 | 40 | public function __construct( |
|
| 21 | Variable $variable, |
||
| 22 | private readonly bool $isVariadic = false, |
||
|
|
|||
| 23 | private readonly bool $isByReference = false |
||
| 24 | ) { |
||
| 25 | 40 | $this->variable = $variable; |
|
| 26 | } |
||
| 27 | |||
| 28 | /** @return Name[] */ |
||
| 29 | 14 | public function references(): array |
|
| 30 | { |
||
| 31 | 14 | return $this->variable->references(); |
|
| 32 | } |
||
| 33 | |||
| 34 | 16 | public function __toString(): string |
|
| 35 | { |
||
| 36 | 16 | return sprintf( |
|
| 37 | '%s%s%s', |
||
| 38 | 16 | $this->isVariadic ? '...' : '', |
|
| 39 | 16 | $this->isByReference ? '&' : '', |
|
| 40 | 16 | $this->variable |
|
| 41 | ); |
||
| 44 |