Total Complexity | 8 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | final class ETag extends BaseHeaderValue |
||
14 | { |
||
15 | public const NAME = 'ETag'; |
||
16 | |||
17 | private string $tag = ''; |
||
18 | private bool $toStringFromTag = false; |
||
19 | private bool $weak = true; |
||
20 | |||
21 | 3 | public function __toString(): string |
|
22 | { |
||
23 | 3 | if ($this->toStringFromTag) { |
|
24 | 1 | return ($this->weak ? 'W/' : '') . '"' . $this->tag . '"'; |
|
25 | } |
||
26 | 2 | return $this->value; |
|
27 | } |
||
28 | |||
29 | 9 | public function getTag(): string |
|
32 | } |
||
33 | |||
34 | 9 | public function isWeak(): bool |
|
35 | { |
||
36 | 9 | return $this->weak; |
|
37 | } |
||
38 | |||
39 | 4 | public function withTag(string $tag, bool $weak = true): self |
|
46 | } |
||
47 | |||
48 | 12 | protected function setValue(string $value): void |
|
58 | } |
||
59 | 12 | } |
|
60 | } |
||
61 |