File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 26
26
"symfony/finder" : " ~4.0" ,
27
27
"nyholm/psr7" : " ^1.5" ,
28
28
"php-http/mock-client" : " ^1.5" ,
29
- "symfony/http-client" : " ^5.0|^6.0"
29
+ "symfony/http-client" : " ^5.0|^6.0" ,
30
+ "php-http/message-factory" : " ^1.1"
30
31
},
31
32
"autoload" : {
32
33
"psr-4" : {
Original file line number Diff line number Diff line change 21
21
use Elastic \Elasticsearch \Transport \Adapter \AdapterInterface ;
22
22
use Elastic \Elasticsearch \Transport \Adapter \AdapterOptions ;
23
23
use Elastic \Elasticsearch \Transport \RequestOptions ;
24
+ use Elastic \Transport \Exception \NoAsyncClientException ;
24
25
use Elastic \Transport \NodePool \NodePoolInterface ;
25
26
use Elastic \Transport \Transport ;
26
27
use Elastic \Transport \TransportBuilder ;
@@ -411,8 +412,12 @@ protected function isSymfonyHttpClient(Transport $transport): bool
411
412
if (false !== strpos (get_class ($ transport ->getClient ()), 'Symfony\Component\HttpClient ' )) {
412
413
return true ;
413
414
}
414
- if (false !== strpos (get_class ($ transport ->getAsyncClient ()), 'Symfony\Component\HttpClient ' )) {
415
- return true ;
415
+ try {
416
+ if (false !== strpos (get_class ($ transport ->getAsyncClient ()), 'Symfony\Component\HttpClient ' )) {
417
+ return true ;
418
+ }
419
+ } catch (NoAsyncClientException $ e ) {
420
+ return false ;
416
421
}
417
422
return false ;
418
423
}
You can’t perform that action at this time.
0 commit comments