| 1 | <?php |
||
| 15 | final class PluginClientBuilder |
||
| 16 | { |
||
| 17 | /** @var Plugin[][] List of plugins ordered by priority [priority => Plugin[]]). */ |
||
| 18 | private $plugins = []; |
||
| 19 | |||
| 20 | /** @var array Array of options to give to the plugin client */ |
||
| 21 | private $options = []; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param int $priority Priority of the plugin. The higher comes first. |
||
| 25 | */ |
||
| 26 | public function addPlugin(Plugin $plugin, int $priority = 0): self |
||
| 32 | |||
| 33 | public function setOption(string $name, $value): self |
||
| 39 | |||
| 40 | public function removeOption(string $name): self |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param ClientInterface | HttpAsyncClient $client |
||
| 49 | */ |
||
| 50 | public function createClient($client): PluginClient |
||
| 71 | } |
||
| 72 |