TsvFormatter
class TsvFormatter extends CsvFormatter (View source)
Tab-separated value formatters
Display the provided structured data in a tab-separated list. Output escaping is much lighter, since there is no allowance for altering the delimiter.
Traits
Provides a default implementation of isValidDataType.
Methods
Return the list of data types acceptable to this formatter
Return the list of data types acceptable to this formatter
Throw an IncompatibleDataException if the provided data cannot be processed by this formatter. Return the source data if it is valid. The data may be encapsulated or converted if necessary.
Return default values for formatter options
Writes a single a single line of formatted CSV data to the output stream.
Generates a CSV-escaped string from an array of field data.
No description
Details
abstract ReflectionClass[]
validDataTypes()
Return the list of data types acceptable to this formatter
isValidDataType(ReflectionClass $dataType)
Return the list of data types acceptable to this formatter
renderData($originalData, $restructuredData, FormatterOptions $options)
No description
protected
renderEachCell($originalData, $restructuredData, FormatterOptions $options)
No description
mixed
validate(mixed $structuredData)
Throw an IncompatibleDataException if the provided data cannot be processed by this formatter. Return the source data if it is valid. The data may be encapsulated or converted if necessary.
protected array
getDefaultFormatterOptions()
Return default values for formatter options
write(OutputInterface $output, mixed $data, FormatterOptions $options)
No description
protected
writeOneLine(OutputInterface $output, array $data, FormatterOptions $options)
Writes a single a single line of formatted CSV data to the output stream.
protected string|bool
csvEscape(array $data, string $delimiter = ',', string $enclosure = '"', string $escapeChar = "\\")
Generates a CSV-escaped string from an array of field data.
protected
tsvEscape($data)
No description