1818use FiveLab \Component \Diagnostic \Result \Result ;
1919use FiveLab \Component \Diagnostic \Result \Success ;
2020use FiveLab \Component \Diagnostic \Util \ArrayUtils ;
21+ use FiveLab \Component \Diagnostic \Util \Dsn ;
2122use FiveLab \Component \Diagnostic \Util \Http \HttpAdapter ;
2223use FiveLab \Component \Diagnostic \Util \Http \HttpAdapterInterface ;
2324
@@ -40,25 +41,25 @@ class ElasticsearchTemplateCheck implements CheckInterface
4041 /**
4142 * Constructor.
4243 *
43- * @param ElasticsearchConnectionParameters $connectionParameters
44- * @param string $name
45- * @param array<string> $expectedPatterns
46- * @param array<string, mixed> $expectedSettings
47- * @param HttpAdapterInterface|null $http
44+ * @param Dsn $dsn
45+ * @param string $name
46+ * @param array<string> $expectedPatterns
47+ * @param array<string, mixed> $expectedSettings
48+ * @param HttpAdapterInterface|null $http
4849 */
4950 public function __construct (
50- private readonly ElasticsearchConnectionParameters $ connectionParameters ,
51- private readonly string $ name ,
52- private array $ expectedPatterns = [],
53- private readonly array $ expectedSettings = [],
54- ?HttpAdapterInterface $ http = null
51+ private readonly Dsn $ dsn ,
52+ private readonly string $ name ,
53+ private array $ expectedPatterns = [],
54+ private readonly array $ expectedSettings = [],
55+ ?HttpAdapterInterface $ http = null
5556 ) {
5657 $ this ->http = $ http ?? new HttpAdapter ();
5758 }
5859
5960 public function check (): Result
6061 {
61- $ result = $ this ->sendRequest ($ this ->http , $ this ->connectionParameters , '_template/ ' .$ this ->name );
62+ $ result = $ this ->sendRequest ($ this ->http , $ this ->dsn , '_template/ ' .$ this ->name );
6263
6364 if ($ result instanceof Result) {
6465 return $ result ;
@@ -105,7 +106,7 @@ public function check(): Result
105106 public function getExtraParameters (): array
106107 {
107108 $ parameters = [
108- 'dsn ' => $ this ->connectionParameters ->getDsn (true ),
109+ 'dsn ' => $ this ->dsn ->getDsn (maskedPassword: true ),
109110 ];
110111
111112 return \array_merge ($ parameters , [
0 commit comments