| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | 3 | private static function createMessages(string $message): array |
|
| 47 | { |
||
| 48 | 3 | $messages = []; |
|
| 49 | |||
| 50 | 3 | foreach (json_decode($message, true) as $property => $attributeMessages) { |
|
| 51 | 3 | if(in_array($property, static::$attributeHides)) { |
|
| 52 | continue; |
||
| 53 | } |
||
| 54 | |||
| 55 | // Rename an attribute according the mapping, if not listed, use the same |
||
| 56 | 3 | $property = Arr::get(static::$attributeMap, $property, $property); |
|
| 57 | |||
| 58 | 3 | $messages[$property] = static::formatMessages($attributeMessages); |
|
| 59 | } |
||
| 60 | |||
| 61 | 3 | return $messages; |
|
| 62 | } |
||
| 81 | } |