1 | <?php |
||
18 | class Outputter |
||
19 | { |
||
20 | /** @var OperationHandler[] */ |
||
21 | private $operationHandlers; |
||
22 | |||
23 | /** @var UrlGenerator[] */ |
||
24 | private $urlGenerators; |
||
25 | |||
26 | /** @var OperationInterface[] */ |
||
27 | private $operations; |
||
28 | |||
29 | /** |
||
30 | * @param OperationHandler[] $operationHandlers |
||
31 | * @param UrlGenerator[] $urlGenerators |
||
32 | */ |
||
33 | 24 | public function __construct(array $operationHandlers, array $urlGenerators) |
|
39 | |||
40 | /** |
||
41 | * @param OperationInterface $operation |
||
42 | */ |
||
43 | 18 | public function addOperation(OperationInterface $operation) |
|
47 | |||
48 | /** |
||
49 | * @return bool |
||
50 | */ |
||
51 | 18 | public function isEmpty() |
|
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | 18 | public function getOutput() |
|
77 | |||
78 | /** |
||
79 | * @param array $output |
||
80 | * @param OperationInterface $operation |
||
81 | * |
||
82 | * @return array|void |
||
83 | */ |
||
84 | 16 | private function createOperationOutput(array &$output, OperationInterface $operation) |
|
103 | |||
104 | /** |
||
105 | * @param OperationInterface $operation |
||
106 | * |
||
107 | * @return OperationHandler|null |
||
108 | */ |
||
109 | 16 | private function getOperationHandler(OperationInterface $operation) |
|
119 | |||
120 | /** |
||
121 | * @param string $sourceUrl |
||
122 | * |
||
123 | * @return UrlGenerator|null |
||
124 | */ |
||
125 | 14 | private function getUrlGenerator($sourceUrl) |
|
135 | } |
||
136 |