Skip to content

Commit b17837a

Browse files
committed
chore: add and use config.factory as a service dependency
1 parent 26d9a1f commit b17837a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

http_webhooks.services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ services:
44
arguments: ['http_webhooks']
55
http_webhooks.outgoing_webhook:
66
class: Drupal\http_webhooks\OutgoingWebhook
7-
arguments: ['@http_client', '@serialization.json']
7+
arguments: ['@http_client', '@serialization.json', '@config.factory']

src/OutgoingWebhook.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Drupal\http_webhooks;
44
use GuzzleHttp\ClientInterface;
55
use Drupal\Component\Serialization\SerializationInterface;
6+
use Drupal\Core\Config\ConfigFactoryInterface;
67

78
/**
89
* Class OutgoingWebhook.
@@ -23,12 +24,23 @@ class OutgoingWebhook {
2324
*/
2425
protected $serializationJson;
2526

27+
/**
28+
* @var \Drupal\Core\Config\ConfigFactoryInterface
29+
*/
30+
protected $configFactory;
31+
2632
/**
2733
* Constructs a new OutgoingWebhook object.
2834
*/
29-
public function __construct(ClientInterface $http_client, SerializationInterface $serialization_json) {
35+
public function __construct(
36+
ClientInterface $http_client,
37+
SerializationInterface $serialization_json,
38+
ConfigFactoryInterface $config_factory
39+
) {
3040
$this->httpClient = $http_client;
3141
$this->serializationJson = $serialization_json;
42+
$this->configFactory = $config_factory;
43+
}
3244
}
3345

3446
}

0 commit comments

Comments
 (0)