File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -368,12 +368,17 @@ private function validate()
368
368
throw new ClientException ('port should be an integer ' );
369
369
}
370
370
371
- if (isset ($ this ->_values [self ::OPTION_HOST ]) && !isset ($ this ->_values [self ::OPTION_ENDPOINT ])) {
372
- // upgrade host/port to an endpoint
373
- $ this ->_values [self ::OPTION_ENDPOINT ] = 'tcp:// ' . $ this ->_values [self ::OPTION_HOST ] . ': ' . $ this ->_values [self ::OPTION_PORT ];
371
+ // can use either endpoint or host/port
372
+ if (isset ($ this ->_values [self ::OPTION_HOST ], $ this ->_values [self ::OPTION_ENDPOINT ])) {
373
+ throw new ClientException ('must not specify both host and endpoint ' );
374
+ } else {
375
+ if (isset ($ this ->_values [self ::OPTION_HOST ]) && !isset ($ this ->_values [self ::OPTION_ENDPOINT ])) {
376
+ // upgrade host/port to an endpoint
377
+ $ this ->_values [self ::OPTION_ENDPOINT ] = 'tcp:// ' . $ this ->_values [self ::OPTION_HOST ] . ': ' . $ this ->_values [self ::OPTION_PORT ];
378
+ unset($ this ->_values [self ::OPTION_HOST ]);
379
+ }
374
380
}
375
381
376
-
377
382
// set up a new endpoint, this will also validate it
378
383
$ this ->getEndpoint ();
379
384
You can’t perform that action at this time.
0 commit comments