@@ -281,11 +281,11 @@ public function load(array $configs, ContainerBuilder $container)
281
281
282
282
// If the slugger is used but the String component is not available, we should throw an error
283
283
if (!ContainerBuilder::willBeAvailable ('symfony/string ' , SluggerInterface::class, ['symfony/framework-bundle ' ])) {
284
- $ container ->register ('slugger ' , ' stdClass ' )
284
+ $ container ->register ('slugger ' , SluggerInterface::class )
285
285
->addError ('You cannot use the "slugger" service since the String component is not installed. Try running "composer require symfony/string". ' );
286
286
} else {
287
287
if (!ContainerBuilder::willBeAvailable ('symfony/translation ' , LocaleAwareInterface::class, ['symfony/framework-bundle ' ])) {
288
- $ container ->register ('slugger ' , ' stdClass ' )
288
+ $ container ->register ('slugger ' , SluggerInterface::class )
289
289
->addError ('You cannot use the "slugger" service since the Translation contracts are not installed. Try running "composer require symfony/translation". ' );
290
290
}
291
291
@@ -379,7 +379,7 @@ public function load(array $configs, ContainerBuilder $container)
379
379
$ container ->getDefinition ('argument_resolver.request_payload ' )
380
380
->setArguments ([])
381
381
->addError ('You can neither use "#[MapRequestPayload]" nor "#[MapQueryString]" since the Serializer component is not '
382
- .(class_exists (Serializer::class) ? 'enabled. Try setting "framework.serializer" to true. ' : 'installed. Try running "composer require symfony/serializer-pack". ' )
382
+ .(class_exists (Serializer::class) ? 'enabled. Try setting "framework.serializer.enabled " to true. ' : 'installed. Try running "composer require symfony/serializer-pack". ' )
383
383
)
384
384
->addTag ('container.error ' )
385
385
->clearTag ('kernel.event_subscriber ' );
@@ -531,6 +531,24 @@ public function load(array $configs, ContainerBuilder $container)
531
531
532
532
if ($ this ->readConfigEnabled ('webhook ' , $ container , $ config ['webhook ' ])) {
533
533
$ this ->registerWebhookConfiguration ($ config ['webhook ' ], $ container , $ loader );
534
+
535
+ // If Webhook is installed but the HttpClient or Serializer components are not available, we should throw an error
536
+ if (!$ this ->readConfigEnabled ('http_client ' , $ container , $ config ['http_client ' ])) {
537
+ $ container ->getDefinition ('webhook.transport ' )
538
+ ->setArguments ([])
539
+ ->addError ('You cannot use the "webhook transport" service since the HttpClient component is not '
540
+ .(class_exists (ScopingHttpClient::class) ? 'enabled. Try setting "framework.http_client.enabled" to true. ' : 'installed. Try running "composer require symfony/http-client". ' )
541
+ )
542
+ ->addTag ('container.error ' );
543
+ }
544
+ if (!$ this ->readConfigEnabled ('serializer ' , $ container , $ config ['serializer ' ])) {
545
+ $ container ->getDefinition ('webhook.body_configurator.json ' )
546
+ ->setArguments ([])
547
+ ->addError ('You cannot use the "webhook transport" service since the Serializer component is not '
548
+ .(class_exists (Serializer::class) ? 'enabled. Try setting "framework.serializer.enabled" to true. ' : 'installed. Try running "composer require symfony/serializer-pack". ' )
549
+ )
550
+ ->addTag ('container.error ' );
551
+ }
534
552
}
535
553
536
554
if ($ this ->readConfigEnabled ('remote-event ' , $ container , $ config ['remote-event ' ])) {
0 commit comments