| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 53 | protected function normalizeValue(): void |
|
| 30 | { |
||
| 31 | 53 | $this->field->value = Cast::toString($this->field->value); |
|
| 32 | 53 | if (!empty($this->field->value)) { |
|
| 33 | 3 | return; |
|
| 34 | } |
||
| 35 | 53 | if ('review' !== $this->field->location()) { |
|
| 36 | 36 | return; |
|
| 37 | } |
||
| 38 | 17 | if (!in_array($this->field->original_name, glsr_get_option('forms.autofill', [], 'array'))) { |
|
| 39 | 17 | return; |
|
| 40 | } |
||
| 41 | 12 | $this->field->value = glsr(Sanitizer::class)->sanitizeUserName('', 'current_user'); |
|
| 42 | } |
||
| 44 |