symplify/package-builder
Helper utilities for building Symfony/PHP packages: lightweight DI and service configuration, parameter resolution, class and file helpers, and tooling-friendly conventions. Designed to reduce boilerplate when composing reusable packages and developer tools.
Start by reviewing the archived README and source code—this package offers minimal setup but requires understanding its core utilities: ConfigBuilder, ParameterBuilder, and ServiceConfigurator. Install via Composer (composer require symplify/package-builder) only if maintaining legacy code. Your first practical use case is bootstrapping DI for multiple packages with shared configuration—e.g., a monorepo of Symfony console apps or Nette services where services.yaml duplication must be avoided.
ConfigBuilder to generate YAML config files (e.g., config/services.yaml) from PHP, eliminating manual YAML replication across packages.ParameterBuilder to define required parameters (e.g., project_dir, cache_dir) with sensible defaults and validation—fail fast on missing values.ServiceConfigurator to define services, tags, and method calls type-hinted and IDE-friendly (e.g., $services->load(App\ *, 'App\\')→tag('console.command')).PackageConfigurator so new console commands auto-register in the app without manual service wiring.PackageConfigurator-implementing class per package to decouple config logic from the kernel/container—ideal for library authors publishing multiple symfony/console ornette packages.ConfigBuilder resolves config paths relative to __DIR__ inside your builder class; move config files accordingly or override getConfigPath().ParameterBuilder throws on redefinition—always chain skipIfExists() before add() when integrating into larger DI setups.ServiceConfigurator with Nette, you must order compiler passes manually (e.g., ->after(ContainerBuilder::class))—failure causes silent misconfiguration.dump($configBuilder->build()) or var_export($parameters) to verify generated config before writing to disk—no runtime logging occurs.ConfigurablePackageInterface to inject custom bootstrapping (e.g., inject services from third-party bundles) without touching container internals.ContainerBuilder, Laravel’s service container, or symfony/console + symfony/config directly.How can I help you explore Laravel packages today?