1 | <?php |
||
26 | class ClientFactory |
||
27 | { |
||
28 | /** |
||
29 | * The cache where tokens are stored. |
||
30 | * |
||
31 | * @var CacheInterface |
||
32 | */ |
||
33 | protected $cache; |
||
34 | |||
35 | /** |
||
36 | * The class to construct a Guzzle client with. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $clientClass; |
||
41 | |||
42 | /** |
||
43 | * Optional logger. |
||
44 | * |
||
45 | * @var LoggerInterface |
||
46 | */ |
||
47 | protected $logger; |
||
48 | |||
49 | /** |
||
50 | * @param CacheInterface $cache |
||
51 | * @param string $class |
||
52 | * @param LoggerInterface $logger |
||
53 | */ |
||
54 | 10 | public function __construct(CacheInterface $cache, $class = null, LoggerInterface $logger = null) |
|
60 | |||
61 | /** |
||
62 | * Creates a Guzzle client for communicating with a Keystone service. |
||
63 | * |
||
64 | * @param Tenant $tenant The keystone tenant to authenticate with |
||
65 | * @param array $config The client configuration |
||
66 | * @param string $class Optionally override the Guzzle client class |
||
67 | * |
||
68 | * @throws RequestException When a new token could not be requested. |
||
69 | * |
||
70 | * @return ClientInterface |
||
71 | */ |
||
72 | 9 | public function createClient(Tenant $tenant, array $config = [], $class = null) |
|
90 | } |
||
91 |