From 0fb98d8e6864ee2204e21f011196ae7ab1741244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Tue, 14 Apr 2026 23:47:14 +0200 Subject: [PATCH] Added comments --- src/Form/Settings/KicadListEditorType.php | 3 +++ src/Services/EDA/KicadListFileManager.php | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/Form/Settings/KicadListEditorType.php b/src/Form/Settings/KicadListEditorType.php index 5cbb8df4..cefdbdbc 100644 --- a/src/Form/Settings/KicadListEditorType.php +++ b/src/Form/Settings/KicadListEditorType.php @@ -29,6 +29,9 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; +/** + * Form type for editing the custom KiCad footprints and symbols lists. + */ final class KicadListEditorType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void diff --git a/src/Services/EDA/KicadListFileManager.php b/src/Services/EDA/KicadListFileManager.php index f2b1f0d5..3d405026 100644 --- a/src/Services/EDA/KicadListFileManager.php +++ b/src/Services/EDA/KicadListFileManager.php @@ -26,6 +26,9 @@ use RuntimeException; use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; +/** + * Manages the KiCad footprints and symbols list files, including reading, writing and ensuring their existence. + */ final class KicadListFileManager implements CacheWarmerInterface { private const FOOTPRINTS_PATH = '/public/kicad/footprints.txt'; @@ -143,6 +146,10 @@ final class KicadListFileManager implements CacheWarmerInterface return false; } + /** + * Ensure that the custom footprints and symbols files exist and generate them on cache warmup, so that the frontend + * can always display them without error, even if the user has not yet visited the settings page. + */ public function warmUp(string $cacheDir, ?string $buildDir = null): array { $this->createCustomFilesIfNotExist();