| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 49 | private static function getExifMapper() |
||
| 50 | { |
||
| 51 | $exifMapper = new ExifMapper(); |
||
| 52 | |||
| 53 | // find all classes |
||
| 54 | $reflClass = new \ReflectionClass(ExifMapper::class); |
||
| 55 | $namespace = $reflClass->getNamespaceName(); |
||
| 56 | $namespace .= '\\Exif'; |
||
| 57 | |||
| 58 | $path = realpath(__DIR__ . '/Mapper/Exif'); |
||
| 59 | |||
| 60 | foreach (glob($path . '/*Mapper.php') as $classPath) { |
||
| 61 | $className = str_replace('.php', '', array_reverse( |
||
| 62 | explode(DIRECTORY_SEPARATOR, $classPath) |
||
| 63 | )[0]); |
||
| 64 | $fqcn = $namespace . '\\' . $className; |
||
| 65 | |||
| 66 | $fieldMapper = new $fqcn(); |
||
| 67 | |||
| 68 | $exifMapper->registerFieldMapper($fieldMapper); |
||
| 69 | } |
||
| 70 | |||
| 71 | return $exifMapper; |
||
| 72 | } |
||
| 73 | } |
||
| 74 |