Copied!

Encodes CSV data.

Cloneable Instantiable
Constants
public Symfony\Component\Serializer\Encoder\CsvEncoder ::AS_COLLECTION_KEY = 'as_collection'
public Symfony\Component\Serializer\Encoder\CsvEncoder ::DELIMITER_KEY = 'csv_delimiter'
public Symfony\Component\Serializer\Encoder\CsvEncoder ::ENCLOSURE_KEY = 'csv_enclosure'
public Symfony\Component\Serializer\Encoder\CsvEncoder ::END_OF_LINE = 'csv_end_of_line'
public Symfony\Component\Serializer\Encoder\CsvEncoder ::ESCAPE_CHAR_KEY = 'csv_escape_char'
public Symfony\Component\Serializer\Encoder\CsvEncoder ::ESCAPE_FORMULAS_KEY = 'csv_escape_formulas'
public Symfony\Component\Serializer\Encoder\CsvEncoder ::FORMAT = 'csv'
public Symfony\Component\Serializer\Encoder\CsvEncoder ::HEADERS_KEY = 'csv_headers'
public Symfony\Component\Serializer\Encoder\CsvEncoder ::KEY_SEPARATOR_KEY = 'csv_key_separator'
public Symfony\Component\Serializer\Encoder\CsvEncoder ::NO_HEADERS_KEY = 'no_headers'
public Symfony\Component\Serializer\Encoder\CsvEncoder ::OUTPUT_UTF8_BOM_KEY = 'output_utf8_bom'
Methods
public __construct ( array $defaultContext = [ ] )
public decode ( string $data , string $format , array $context = [ ] ) : ? mixed
 
public encode ( ? mixed $data , string $format , array $context = [ ] ) : string
 
public supportsDecoding ( string $format ) : bool
 
public supportsEncoding ( string $format ) : bool
 
Constants
private Symfony\Component\Serializer\Encoder\CsvEncoder ::FORMULAS_START_CHARACTERS = [ '=' , '-' , '+' , '@' , ' ' , ' ' ]
private Symfony\Component\Serializer\Encoder\CsvEncoder ::UTF8_BOM = ''
Properties
private $defaultContext
Methods
private extractHeaders ( iterable $data ) : array
 
  • return string []
private flatten ( iterable $array , array $result , string $keySeparator , string $parentKey = '' , bool $escapeFormulas = false )
 

Flattens an array and generates keys including the path.

private getCsvOptions ( array $context ) : array
© 2022 Bruce Wells
Search Namespaces \ Classes
Configuration