| Total Complexity | 6 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | class HttpBuilderPrepare implements Stringable |
||
| 24 | { |
||
| 25 | use Makeable; |
||
| 26 | |||
| 27 | protected $of; |
||
| 28 | |||
| 29 | protected $prefix = ''; |
||
| 30 | |||
| 31 | protected $suffix = ''; |
||
| 32 | |||
| 33 | protected $default = ''; |
||
| 34 | |||
| 35 | 21 | public function __toString() |
|
| 36 | { |
||
| 37 | 21 | if (! empty($this->of)) { |
|
| 38 | 18 | return $this->prefixed(); |
|
| 39 | } |
||
| 40 | |||
| 41 | 16 | return $this->default; |
|
| 42 | } |
||
| 43 | |||
| 44 | 21 | public function of(?string $value): self |
|
| 49 | } |
||
| 50 | |||
| 51 | 21 | public function prefix(string $value): self |
|
| 52 | { |
||
| 53 | 21 | $this->prefix = $value; |
|
| 54 | |||
| 55 | 21 | return $this; |
|
| 56 | } |
||
| 57 | |||
| 58 | 21 | public function suffix(string $value): self |
|
| 63 | } |
||
| 64 | |||
| 65 | 18 | protected function prefixed(): ?string |
|
| 71 | } |
||
| 72 | } |
||
| 73 |