| Conditions | 5 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) |
||
| 39 | { |
||
| 40 | $xml->registerXPathNamespace('audiomd', 'http://www.loc.gov/audioMD/'); |
||
| 41 | $xml->registerXPathNamespace('videomd', 'http://www.loc.gov/videoMD/'); |
||
| 42 | |||
| 43 | if (!empty($audioDuration = (string) $xml->xpath('./audiomd:audioInfo/audiomd:duration')[0])) { |
||
| 44 | $metadata['audio_duration'] = [$audioDuration]; |
||
| 45 | } |
||
| 46 | |||
| 47 | if (!empty($videoDuration = (string) $xml->xpath('./videomd:videoInfo/videomd:duration')[0])) { |
||
| 48 | $metadata['video_duration'] = [$videoDuration]; |
||
| 49 | } |
||
| 50 | |||
| 51 | $metadata['duration'] = $metadata['video_duration'] ?: $metadata['audio_duration'] ?: []; |
||
| 52 | } |
||
| 54 |