1 | <?php |
||
16 | class LoggableGenerator implements GeneratorInterface |
||
17 | { |
||
18 | private $generator; |
||
19 | private $logger; |
||
20 | |||
21 | /** |
||
22 | * Constructor. |
||
23 | * |
||
24 | * @param GeneratorInterface $generator |
||
25 | * @param LoggerInterface $logger |
||
26 | */ |
||
27 | public function __construct(GeneratorInterface $generator, LoggerInterface $logger = null) |
||
32 | |||
33 | /** |
||
34 | * Returns the underlying generator instance. |
||
35 | * |
||
36 | * @return GeneratorInterface |
||
37 | */ |
||
38 | public function getInternalGenerator() |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | public function generate($input, $output, array $options = [], $overwrite = false) |
||
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function generateFromHtml($html, $output, array $options = [], $overwrite = false) |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | public function getOutput($input, array $options = []) |
||
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | public function getOutputFromHtml($html, array $options = []) |
||
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | */ |
||
100 | public function setOption($name, $value) |
||
106 | |||
107 | /** |
||
108 | * Logs the given debug message if the logger is configured or do nothing |
||
109 | * otherwise. |
||
110 | * |
||
111 | * @param string $message |
||
112 | */ |
||
113 | private function logDebug($message) |
||
121 | } |
||
122 |
If you suppress an error, we recommend checking for the error condition explicitly: