| Total Complexity | 4 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class RedirectBucket extends DataBucket |
||
| 10 | { |
||
| 11 | protected ?string $location = null; |
||
| 12 | |||
| 13 | protected const IS_CONVERTABLE = false; |
||
| 14 | |||
| 15 | public function __construct(string $location, int $code = 302) |
||
| 16 | { |
||
| 17 | parent::__construct(''); |
||
| 18 | $this->setLocation($location); |
||
| 19 | $this->setStatus($code); |
||
| 20 | } |
||
| 21 | public function getLocation(): ?string |
||
| 22 | { |
||
| 23 | return $this->location; |
||
| 24 | } |
||
| 25 | public function withLocation(?string $location): self |
||
| 26 | { |
||
| 27 | $clone = clone $this; |
||
| 28 | $clone->setLocation($location); |
||
| 29 | return $clone; |
||
| 30 | } |
||
| 31 | |||
| 32 | protected function setLocation(?string $location): void |
||
| 36 | } |
||
| 37 | } |
||
| 38 |