| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function visit(Attribute $attribute, ContentType $contentType): AttributeValue |
||
| 26 | { |
||
| 27 | $email = $attribute->getValue()->getDataText(); |
||
| 28 | |||
| 29 | $split = str_split($email); |
||
| 30 | |||
| 31 | $email = []; |
||
| 32 | foreach ($split as $character) { |
||
| 33 | if (!in_array($character, $this->allowedCharacters)) { |
||
| 34 | $email[] = 'X'; |
||
| 35 | } else { |
||
| 36 | $email[] = $character; |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | return new AttributeValue(0, 0, implode($email, '')); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |