From 5d9d24d92a41eebde4688fb52c55ee69d4c3d1ff Mon Sep 17 00:00:00 2001 From: Sebastian Almberg <83243306+Sebbeben@users.noreply.github.com> Date: Wed, 18 Feb 2026 10:37:50 +0100 Subject: [PATCH] Fix duplicate loadMappingFile method causing PHP fatal error --- src/Command/PopulateKicadCommand.php | 33 ---------------------------- 1 file changed, 33 deletions(-) diff --git a/src/Command/PopulateKicadCommand.php b/src/Command/PopulateKicadCommand.php index 0bc03392..ec7b8c94 100644 --- a/src/Command/PopulateKicadCommand.php +++ b/src/Command/PopulateKicadCommand.php @@ -603,37 +603,4 @@ class PopulateKicadCommand extends Command 'Photo' => 'Device:LED', // Photodiode/phototransistor ]; } - - /** - * Load a custom mapping file (JSON format). - * - * Expected format: - * { - * "footprints": { "SOT-23": "Package_TO_SOT_SMD:SOT-23", ... }, - * "categories": { "Resistor": "Device:R", ... } - * } - * - * @return array|null The parsed mappings, or null on error - */ - private function loadMappingFile(string $path, SymfonyStyle $io): ?array - { - if (!file_exists($path)) { - $io->error(sprintf('Mapping file not found: %s', $path)); - return null; - } - - $content = file_get_contents($path); - if ($content === false) { - $io->error(sprintf('Could not read mapping file: %s', $path)); - return null; - } - - $data = json_decode($content, true); - if (!is_array($data)) { - $io->error(sprintf('Invalid JSON in mapping file: %s', json_last_error_msg())); - return null; - } - - return $data; - } }