diff --git a/src/Generator/TypeGenerator.php b/src/Generator/TypeGenerator.php index 3734a62c..3bbc7d3c 100644 --- a/src/Generator/TypeGenerator.php +++ b/src/Generator/TypeGenerator.php @@ -10,7 +10,6 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -use function array_merge; use function file_exists; use function file_put_contents; use function str_replace; @@ -59,7 +58,7 @@ public function compile(int $mode): array $config['config']['name'] ??= $name; $config['config']['class_name'] = $config['class_name']; $classMap = $this->generateClass($config, $cacheDir, $mode); - $classes = array_merge($classes, $classMap); + $classes[$classMap[0]] = $classMap[1]; } // Create class map file @@ -97,7 +96,7 @@ public function generateClass(array $config, ?string $outputDirectory, int $mode $namespace = $this->options->namespace; - return ["$namespace\\$className" => $path]; + return ["$namespace\\$className", $path]; } public function loadClasses(bool $forceReload = false): void