| 1 | <?php |
||
| 10 | final class ParenthesizedList |
||
| 11 | { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var array |
||
| 15 | */ |
||
| 16 | private $list = []; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * ParenthesizedList constructor. |
||
| 20 | * @param array $list |
||
| 21 | */ |
||
| 22 | 5 | public function __construct(array $list = []) |
|
| 26 | |||
| 27 | /** |
||
| 28 | * @param string $name |
||
| 29 | * @return ParenthesizedList |
||
| 30 | */ |
||
| 31 | 4 | public function with(string $name): self |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @param string $name |
||
| 40 | * @return ParenthesizedList |
||
| 41 | */ |
||
| 42 | 2 | public function without(string $name): self |
|
| 48 | |||
| 49 | /** |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | 4 | public function __toString(): string |
|
| 63 | |||
| 64 | } |