| Total Complexity | 8 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | final class Deletion |
||
| 7 | { |
||
| 8 | private $name; |
||
| 9 | private $ifUnused = false; |
||
| 10 | private $wait = true; |
||
| 11 | |||
| 12 | 16 | public function __construct(string $name) |
|
| 13 | { |
||
| 14 | 16 | $this->name = $name; |
|
| 15 | 16 | } |
|
| 16 | |||
| 17 | 4 | public function ifUnused(): self |
|
| 18 | { |
||
| 19 | 4 | $self = clone $this; |
|
| 20 | 4 | $self->ifUnused = true; |
|
| 21 | |||
| 22 | 4 | return $self; |
|
| 23 | } |
||
| 24 | |||
| 25 | 2 | public function ifUsed(): self |
|
| 26 | { |
||
| 27 | 2 | $self = clone $this; |
|
| 28 | 2 | $self->ifUnused = false; |
|
| 29 | |||
| 30 | 2 | return $self; |
|
| 31 | } |
||
| 32 | |||
| 33 | 6 | public function dontWait(): self |
|
| 34 | { |
||
| 35 | 6 | $self = clone $this; |
|
| 36 | 6 | $self->wait = false; |
|
| 37 | |||
| 38 | 6 | return $self; |
|
| 39 | } |
||
| 40 | |||
| 41 | 2 | public function wait(): self |
|
| 42 | { |
||
| 43 | 2 | $self = clone $this; |
|
| 44 | 2 | $self->wait = true; |
|
| 45 | |||
| 46 | 2 | return $self; |
|
| 47 | } |
||
| 48 | |||
| 49 | 6 | public function name(): string |
|
| 50 | { |
||
| 51 | 6 | return $this->name; |
|
| 52 | } |
||
| 53 | |||
| 54 | 10 | public function onlyIfUnused(): bool |
|
| 57 | } |
||
| 58 | |||
| 59 | 10 | public function shouldWait(): bool |
|
| 62 | } |
||
| 63 | } |
||
| 64 |