File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -118,13 +118,15 @@ public function getQueryLog(): Collection
118118
119119 public static function fromConfig (array $ config ): static
120120 {
121- $ client = (new ClientBuilder ())
121+ $ builder = (new ClientBuilder ())
122122 ->setHosts ($ config ['hosts ' ])
123- ->setBasicAuthentication ($ config ['username ' ] ?? '' , $ config ['password ' ] ?? '' )
124123 ->setRetries ($ config ['retries ' ] ?? 1 )
125- ->setSSLVerification ($ config ['ssl_verification ' ] ?? false )
126- ->build ();
124+ ->setSSLVerification ($ config ['ssl_verification ' ] ?? false );
127125
128- return new static ($ client );
126+ if (filled ($ config ['username ' ] ?? null )) {
127+ $ builder ->setBasicAuthentication ($ config ['username ' ], $ config ['password ' ] ?? '' );
128+ }
129+
130+ return new static ($ builder ->build ());
129131 }
130132}
You can’t perform that action at this time.
0 commit comments