1 | <?php |
||
12 | class LoggableGenerator implements GeneratorInterface |
||
13 | { |
||
14 | private $generator; |
||
15 | private $logger; |
||
16 | |||
17 | /** |
||
18 | * Constructor. |
||
19 | * |
||
20 | * @param GeneratorInterface $generator |
||
21 | * @param LoggerInterface $logger |
||
|
|||
22 | */ |
||
23 | public function __construct(GeneratorInterface $generator, LoggerInterface $logger = null) |
||
28 | |||
29 | /** |
||
30 | * Returns the underlying generator instance. |
||
31 | * |
||
32 | * @return GeneratorInterface |
||
33 | */ |
||
34 | public function getInternalGenerator() |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | public function generate($input, $output, array $options = [], $overwrite = false) |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public function generateFromHtml($html, $output, array $options = [], $overwrite = false) |
||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function getOutput($input, array $options = []) |
||
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | */ |
||
84 | public function getOutputFromHtml($html, array $options = []) |
||
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | */ |
||
96 | public function setOption($name, $value) |
||
102 | |||
103 | /** |
||
104 | * Logs the given debug message if the logger is configured or do nothing |
||
105 | * otherwise. |
||
106 | * |
||
107 | * @param string $message |
||
108 | */ |
||
109 | private function logDebug($message) |
||
117 | } |
||
118 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.