| 1 | <?php |
||
| 11 | class AdapterFactory |
||
| 12 | { |
||
| 13 | protected $adapters = []; |
||
| 14 | |||
| 15 | 204 | public function __construct() |
|
| 16 | { |
||
| 17 | 204 | $this->register('guzzle5', '\Commercetools\Core\Client\Adapter\Guzzle5Adapter') |
|
| 18 | 204 | ->register('guzzle6', '\Commercetools\Core\Client\Adapter\Guzzle6Adapter'); |
|
| 19 | 204 | } |
|
| 20 | |||
| 21 | /** |
||
| 22 | * @param string $name |
||
| 23 | * @param string $adapterClass |
||
| 24 | * @return $this |
||
| 25 | */ |
||
| 26 | 204 | public function register($name, $adapterClass) |
|
| 32 | |||
| 33 | /** |
||
| 34 | * @param string $name |
||
| 35 | * @return string |
||
| 36 | */ |
||
| 37 | 204 | public function getClass($name = null) |
|
| 52 | } |
||
| 53 |