50db43fc4c
This PR was squashed before being merged into the 4.3 branch.
Discussion
----------
[Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| License | MIT
My first pull request...
The following code:
```
$data = <<<EOD
a,b
c,d
EOD;
$encoder = new CsvEncoder([CsvEncoder::NO_HEADERS_KEY=>true]);
var_dump($encoder->decode($data,'csv'));
```
produces:
```
array(2) {
'a' =>
string(1) "c"
'b' =>
string(1) "d"
}
```
instead of the expected:
```
array(2) {
[0] =>
array(2) {
[0] =>
string(1) "a"
[1] =>
string(1) "b"
}
[1] =>
array(2) {
[0] =>
string(1) "c"
[1] =>
string(1) "d"
}
}
```
Commits
-------
|
||
---|---|---|
.. | ||
Annotation | ||
DependencyInjection | ||
Encoder | ||
Exception | ||
Extractor | ||
Mapping | ||
NameConverter | ||
Normalizer | ||
Tests | ||
.gitignore | ||
CHANGELOG.md | ||
composer.json | ||
LICENSE | ||
phpunit.xml.dist | ||
README.md | ||
Serializer.php | ||
SerializerAwareInterface.php | ||
SerializerAwareTrait.php | ||
SerializerInterface.php |
Serializer Component
With the Serializer component it's possible to handle serializing data structures, including object graphs, into array structures or other formats like XML and JSON. It can also handle deserializing XML and JSON back to object graphs.