1 | <?php |
||
12 | class FormatterFactory implements FormatterFactoryInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private static $defaultFormatter = PrintrFormatter::class; |
||
18 | |||
19 | /** |
||
20 | * @param string $defaultFormatter |
||
21 | */ |
||
22 | public static function setDefaultFormatter($defaultFormatter) |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private static $classMap = [ |
||
31 | \SimpleXMLElement::class => SimpleXMLElementFormatter::class, |
||
32 | TransferException::class => Guzzle\GuzzleExceptionFormatter::class, |
||
33 | \GuzzleHttp\Stream\Stream::class => StringFactoryFormatter::class, |
||
34 | ResponseInterface::class => Guzzle\ResponseFormatter::class, |
||
35 | RequestInterface::class => Guzzle\RequestFormatter::class, |
||
36 | \Exception::class => ExceptionFormatter::class, |
||
37 | ]; |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | public function factory($output) |
||
56 | |||
57 | /** |
||
58 | * @param string $className |
||
59 | * @return FormatterInterface |
||
60 | */ |
||
61 | private function setup($className) |
||
66 | } |
||
67 |