| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 49 | 12 | protected function setValue(string $value): void |
|
| 50 | { |
||
| 51 | 12 | $this->value = trim($value); |
|
| 52 | 12 | $this->toStringFromTag = false; |
|
| 53 | 12 | if (preg_match('/^(?<weak>W\\/)?"(?<etagc>[^"\\x00-\\x20\\x7F]+)"$/', $this->value, $matches) === 1) { |
|
| 54 | 5 | $this->tag = $matches['etagc']; |
|
| 55 | 5 | $this->weak = $matches['weak'] === 'W/'; |
|
| 56 | 5 | $this->error = null; |
|
| 57 | } else { |
||
| 58 | 12 | $this->error = new ParsingException($value, 0, 'Invalid ETag value format', 0, $this->error); |
|
| 59 | } |
||
| 62 |