The doc comment array<string, class-stri...ace):EndPointInterface> at position 4 could not be parsed: Unknown type name 'class-string' at position 4 in array<string, class-string<EndPointInterface>|callable(ClientInterface):EndPointInterface>.
The doc comment array<string, class-stri...ace):EndPointInterface> at position 4 could not be parsed: Unknown type name 'class-string' at position 4 in array<string, class-string<EndPointInterface>|callable(ClientInterface):EndPointInterface>.
Loading history...
26
* Map of endpoint class name or factory, indexed by the endpoint name
27
*/
28
196
public function __construct(array $endpoints)
29
{
30
196
$this->endpoints = $endpoints;
31
196
}
32
33
/**
34
* Configure the endpoint on the client
35
*
36
* @param ClientInterface $client
37
*/
38
144
public function configure(ClientInterface $client): void
39
{
40
144
foreach ($this->endpoints as $name => $endpoint) {
41
144
if (!$client->provider()->supportsEndpoint($name)) {
42
4
continue;
43
}
44
45
144
$endpoint = is_callable($endpoint) ? $endpoint($client) : new $endpoint($client);