src/Visitor/Csv/CsvSerializationVisitor.php 1 location
|
@@ 69-76 (lines=8) @@
|
| 66 |
|
/** |
| 67 |
|
* {@inheritdoc} |
| 68 |
|
*/ |
| 69 |
|
public function visitArray($data, TypeMetadataInterface $type, ContextInterface $context) |
| 70 |
|
{ |
| 71 |
|
if ($data === []) { |
| 72 |
|
return $this->visitData('[]', $type, $context); |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
return parent::visitArray($data, $type, $context); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
/** |
| 79 |
|
* {@inheritdoc} |
src/Visitor/Json/JsonSerializationVisitor.php 1 location
|
@@ 48-55 (lines=8) @@
|
| 45 |
|
/** |
| 46 |
|
* {@inheritdoc} |
| 47 |
|
*/ |
| 48 |
|
public function visitData($data, TypeMetadataInterface $type, ContextInterface $context) |
| 49 |
|
{ |
| 50 |
|
if ($data === [] && class_exists($type->getName())) { |
| 51 |
|
$data = (object) $data; |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
return parent::visitData($data, $type, $context); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
/** |
| 58 |
|
* {@inheritdoc} |