| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 48 | public static function map($patient, $obj) |
||
| 49 | { |
||
| 50 | foreach (get_object_vars($obj) as $key => $value) { |
||
| 51 | if ($value instanceof \stdClass && property_exists($value, 'date')) { |
||
| 52 | $value = new \DateTime($value->date); |
||
| 53 | } |
||
| 54 | call_user_func(array( |
||
| 55 | $patient, |
||
| 56 | 'set' . ucwords($key) |
||
| 57 | ), $value); |
||
| 58 | } |
||
| 59 | return $patient; |
||
| 60 | } |
||
| 61 | |||
| 62 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.