classMetadataWriter
final class MetadataWriter
Writes metadata as nested lists of "**key:** value" entries or plain values.
Scalars are written as JSON, except strings that are not themselves JSON text.
Methods§
public function write(mixed $data, int $indent = 0): stringWrites one level of metadata.
Parameters
$data | mixed | A mapping or a sequence |
$indent | int | The indentation of this level |
Returns
string The Markdown list, or {} or [] when emptyThrows
InvalidInputException When a sequence is not a listJsonException When a scalar cannot be encodedTest cases 5
Called from 2
Calls 10
- function-call
get_object_varsline 34 - static-call Fields::sequence() line 34
- function-call
str_repeatline 40 - static-call Nodes::escape() line 40
- function-call
is_arrayline 41 - method-call MetadataWriter::write() line 45
- function-call
json_encodeline 47 - function-call
is_stringline 48 - function-call
json_decodeline 48 - function-call
json_last_errorline 48
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
Other tests reaching this symbol 3
CardWriterTestcallsFieldWriterTestcallsMarkdownDocumentTestcalls