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();