| Conditions | 4 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | function symfony_rdm_composer_hook(ClassLoader $classLoader, KernelInterface $kernel): void |
||
| 21 | { |
||
| 22 | AddiksRDMBundle::registerClassLoader($classLoader); |
||
| 23 | |||
| 24 | $cacheDir = $kernel->getCacheDir(); |
||
| 25 | |||
| 26 | $classmapFilePath = $cacheDir . '/symfony_rdm_entities/classmap'; |
||
| 27 | |||
| 28 | if (file_exists($classmapFilePath)) { |
||
| 29 | $classMap = array(); |
||
| 30 | |||
| 31 | foreach (explode("\n", file_get_contents($classmapFilePath)) as $classmapLine) { |
||
| 32 | if (empty($classmapLine)) { |
||
| 33 | continue; |
||
| 34 | } |
||
| 35 | |||
| 36 | [$className, $filePath] = explode(":", $classmapLine); |
||
| 37 | |||
| 38 | $classMap[$className] = $filePath; |
||
| 39 | } |
||
| 40 | |||
| 41 | $classLoader->addClassMap($classMap); |
||
| 42 | } |
||
| 44 |