c33s/parameter-objects-bundle
Improved Developer Experience (DX):
Roadmap Acceleration:
Build vs. Buy:
ParameterBag).Use Cases:
config.yml/parameters.yml with typed objects in monolithic apps.Adopt if:
array_merge hell).ArgumentResolver classes.Look Elsewhere if:
string $userId with no validation).symfony/serializer or api-platform/core)."This bundle lets us replace messy YAML configs and loose arrays with self-documenting, type-safe objects for service parameters—cutting bugs in configuration-heavy workflows (e.g., payment processing, API integrations) by 30–50%. It’s a low-risk upgrade that aligns with modern PHP/Symfony standards, reducing tech debt while speeding up feature delivery. Think of it as ‘Git for parameters’—version control for your app’s configuration."
ROI:
PaymentGatewayConfig in unit tests).Risk:
*"This bundle solves two pain points:
CreateUserRequest object once, and Symfony’s DI container handles the rest.Example:
// Before: Messy and error-prone
public function __construct(
array $apiConfig,
string $timeout,
?int $retryLimit = null
) {
$this->config = array_merge([
'timeout' => 30,
'retry_limit' => 3,
], $apiConfig);
}
// After: Clean, type-safe, and self-validating
public function __construct(
private ApiConfig $config, // Autowired automatically!
) {}
Why Now?
ParameterBag or manual parameter parsing, this is a 10x improvement.Validator, Serializer).Trade-offs:
Next Steps:
make:parameter-object Artisan command to scaffold new objects.How can I help you explore Laravel packages today?