| Conditions | 5 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function map($field, $context = null) |
||
| 22 | { |
||
| 23 | $title = 'Please add title'; |
||
| 24 | |||
| 25 | if (array_key_exists('title', $field) && !empty($field['title'])) { |
||
| 26 | $title = $field['title']; |
||
| 27 | } elseif (array_key_exists('fieldName', $field) && !empty($field['fieldName'])) { |
||
| 28 | // Field can be metadata.action.0.command, so .0 is and Array |
||
| 29 | $value = str_replace('.0', '.array', $field['fieldName']); |
||
| 30 | // Field could have metadata.mime So upercase it |
||
| 31 | $value = ucwords(strtolower($value), '\'.'); |
||
| 32 | $value = str_replace('.', '', $value); |
||
| 33 | $title = preg_replace('/(?!^)[A-Z]{2,}(?=[A-Z][a-z])|[A-Z][a-z]/', ' $0', $value); |
||
| 34 | } |
||
| 35 | $field['title'] = trim($title); |
||
| 36 | return $field; |
||
| 37 | } |
||
| 38 | } |
||
| 39 |
This check looks for the generic type
arrayas a return type and suggests a more specific type. This type is inferred from the actual code.