1 | <?php |
||
19 | class StringFormatter implements FormatterInterface, ValidationInterface, OverrideOptionsInterface |
||
20 | 1 | { |
|
21 | /** |
||
22 | 1 | * @inheritdoc |
|
23 | 1 | */ |
|
24 | 1 | public function write(OutputInterface $output, $data, FormatterOptions $options) |
|
31 | |||
32 | /** |
||
33 | * @inheritdoc |
||
34 | */ |
||
35 | public function overrideOptions($structuredOutput, FormatterOptions $options) |
||
45 | |||
46 | /** |
||
47 | * If the data provided to a 'string' formatter is a table, then try |
||
48 | * to emit it as a TSV value. |
||
49 | * |
||
50 | * @param OutputInterface $output |
||
51 | * @param mixed $data |
||
52 | * @param FormatterOptions $options |
||
53 | */ |
||
54 | protected function reduceToSigleFieldAndWrite(OutputInterface $output, $data, FormatterOptions $options) |
||
63 | |||
64 | /** |
||
65 | * Do not return any valid data types -- this formatter will never show up |
||
66 | * in a list of valid formats. |
||
67 | */ |
||
68 | public function validDataTypes() |
||
72 | |||
73 | /** |
||
74 | * Always validate any data, though. This format will never |
||
75 | * cause an error if it is selected for an incompatible data type; at |
||
76 | * worse, it simply does not print any data. |
||
77 | */ |
||
78 | public function validate($structuredData) |
||
82 | } |
||
83 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: