Skip to content

Commit 6193670

Browse files
committed
feat: inject client dependency into GithubService
1 parent d51b384 commit 6193670

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Services/GithubService.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
class GithubService
99
{
10+
protected Client $client;
11+
12+
public function __construct(?Client $client = null)
13+
{
14+
$this->client = $client ?? new Client;
15+
}
16+
1017
/**
1118
* @param string $contentNodeId
1219
* @param string $message
@@ -35,9 +42,7 @@ public function commentOnNode(string $contentNodeId, string $message): array
3542
],
3643
];
3744

38-
$client = new Client;
39-
40-
return $client->graphql()->execute($query, $variables);
45+
return $this->client->graphql()->execute($query, $variables);
4146
}
4247

4348
/**

0 commit comments

Comments
 (0)