| Conditions | 3 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function mapField($field, array $input, &$output) |
||
| 43 | { |
||
| 44 | $this->guardInvalidArguments($field, $input, $output); |
||
| 45 | |||
| 46 | $validKeys = [ |
||
| 47 | 'system:filemodifydate', |
||
| 48 | 'composite:subsecdatetimeoriginal', |
||
| 49 | 'composite:subsecmodifydate', |
||
| 50 | 'exififd:datetimeoriginal', |
||
| 51 | 'exififd:createdate', |
||
| 52 | 'ifd0:modifydate', |
||
| 53 | ]; |
||
| 54 | |||
| 55 | while ($key = array_shift($validKeys)) { |
||
| 56 | if (!array_key_exists($key, $input)) { |
||
| 57 | continue; |
||
| 58 | } |
||
| 59 | |||
| 60 | $datetimeOriginal = new DateTimeImmutable($input[$key]); |
||
| 61 | $output = $output->withCreationDate($datetimeOriginal); |
||
| 62 | break; |
||
| 63 | } |
||
| 64 | } |
||
| 65 | } |
||
| 66 |