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 |
||
48 | 12 | protected function setValue(string $value): void |
|
49 | { |
||
50 | 12 | $this->value = trim($value); |
|
51 | 12 | $this->toStringFromTag = false; |
|
52 | 12 | if (preg_match('/^(?<weak>W\\/)?"(?<etagc>[^"\\x00-\\x20\\x7F]+)"$/', $this->value, $matches) === 1) { |
|
53 | 5 | $this->tag = $matches['etagc']; |
|
54 | 5 | $this->weak = $matches['weak'] === 'W/'; |
|
55 | 5 | $this->error = null; |
|
56 | } else { |
||
57 | 12 | $this->error = new ParsingException($value, 0, 'Invalid ETag value format', 0, $this->error); |
|
58 | } |
||
61 |