| Conditions | 3 |
| Paths | 3 |
| Total Lines | 33 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 3.0026 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 2 | public function regenerateClasses(): void |
|
| 31 | { |
||
| 32 | $data = [ |
||
| 33 | 2 | Packages::class, |
|
| 34 | Types::class, |
||
| 35 | Directories::class, |
||
| 36 | Versions::class, |
||
| 37 | Dependencies::class, |
||
| 38 | ]; |
||
| 39 | |||
| 40 | 2 | foreach ($data as $class) { |
|
| 41 | 2 | if (false === \class_exists($class)) { |
|
| 42 | continue; |
||
| 43 | } |
||
| 44 | |||
| 45 | 2 | $reflection = new \ReflectionClass($class); |
|
| 46 | |||
| 47 | 2 | $template = \sprintf( |
|
| 48 | 2 | '%s.twig', |
|
| 49 | 2 | \mb_strtolower($reflection->getShortName()) |
|
| 50 | ); |
||
| 51 | |||
| 52 | 2 | $installPath = \sprintf( |
|
| 53 | 2 | '%s/../build/%s.php', |
|
| 54 | 2 | __DIR__, |
|
| 55 | 2 | $reflection->getShortName() |
|
| 56 | ); |
||
| 57 | |||
| 58 | /** @var ExporterInterface $exporter */ |
||
| 59 | 2 | $exporter = $reflection->newInstance($this->event); |
|
| 60 | |||
| 61 | $exporter |
||
| 62 | 2 | ->exportToFile($template, $installPath); |
|
| 63 | } |
||
| 66 |