1 | <?php |
||
16 | final class PluginClientFactory |
||
17 | { |
||
18 | /** |
||
19 | * @var callable|null |
||
20 | */ |
||
21 | private static $factory; |
||
22 | |||
23 | /** |
||
24 | * Set the factory to use. |
||
25 | * The callable to provide must have the same arguments and return type as PluginClientFactory::createClient. |
||
26 | * This is used by the HTTPlugBundle to provide a better Symfony integration. |
||
27 | * Unlike the createClient method, this one is static to allow zero configuration profiling by hooking into early |
||
28 | * application execution. |
||
29 | * |
||
30 | * @internal |
||
31 | */ |
||
32 | public static function setFactory(callable $factory) |
||
36 | |||
37 | /** |
||
38 | * @param ClientInterface|HttpAsyncClient $client |
||
39 | * @param Plugin[] $plugins |
||
40 | * @param array $options { |
||
41 | * |
||
42 | * @var string $client_name to give client a name which may be used when displaying client information like in |
||
43 | * the HTTPlugBundle profiler. |
||
44 | * } |
||
45 | * |
||
46 | * @see PluginClient constructor for PluginClient specific $options. |
||
47 | */ |
||
48 | 2 | public function createClient($client, array $plugins = [], array $options = []): PluginClient |
|
66 | } |
||
67 |
Late static binding only has effect in subclasses. A
final
class cannot be extended anymore so late static binding cannot occurr. Consider replacingstatic::
withself::
.To learn more about late static binding, please refer to the PHP core documentation.