Skip to content

Commit 62a8540

Browse files
committed
Fix DIC and mark diagnostic classes as internal
1 parent e11730b commit 62a8540

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/Command/ConnectionDiagnosticCommand.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,12 @@
2626
)]
2727
final class ConnectionDiagnosticCommand extends Command
2828
{
29-
// TODO: Inject as service?
30-
private readonly EncryptionDiagnostic $encryptionDiagnostic;
31-
3229
/** @param ServiceProviderInterface<ConnectionDiagnostic> $diagnostics */
33-
public function __construct(private readonly ServiceProviderInterface $diagnostics)
34-
{
30+
public function __construct(
31+
private readonly ServiceProviderInterface $diagnostics,
32+
private readonly EncryptionDiagnostic $encryptionDiagnostic = new EncryptionDiagnostic(),
33+
) {
3534
parent::__construct();
36-
37-
$this->encryptionDiagnostic = new EncryptionDiagnostic();
3835
}
3936

4037
protected function configure(): void

src/DataCollector/ConnectionDiagnostic.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use function iterator_count;
1616
use function version_compare;
1717

18+
/** @internal */
1819
class ConnectionDiagnostic
1920
{
2021
private const CLIENT_ENCRYPTION_OPTION_NAMES = [
@@ -30,8 +31,10 @@ class ConnectionDiagnostic
3031
Server::TYPE_RS_SECONDARY,
3132
];
3233

33-
public function __construct(private Client $client, private array $driverOptions)
34-
{
34+
public function __construct(
35+
private readonly Client $client,
36+
private readonly array $driverOptions,
37+
) {
3538
}
3639

3740
/**

src/DataCollector/EncryptionDiagnostic.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use function sprintf;
2222
use function trim;
2323

24+
/** @internal */
2425
class EncryptionDiagnostic
2526
{
2627
/** @return array{extensionLoaded: bool, extensionVersion: ?string, extensionSupportsLibmongocrypt: bool, libraryVersion: ?string} */

0 commit comments

Comments
 (0)