Skip to content

Commit

Permalink
Introduced normalizers for Generator state
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveb-p committed Oct 8, 2024
1 parent 7c5c50a commit 81e18ea
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/Output/Generator/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function startObjectElement($name, $mediaTypeName = null)

$object = new Json\JsonObject($this->json);

if ($this->json instanceof Json\ArrayObject) {
if ($this->json instanceof Json\ArrayObject || $this->json instanceof Data\ArrayList) {
$this->json->append($object);
$this->json = $object;
} else {
Expand Down
2 changes: 0 additions & 2 deletions src/lib/Output/Normalizer/ArrayObjectNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public function normalize($object, ?string $format = null, array $context = []):
{
$data = get_object_vars($object);

unset($data['_ref_parent']);

foreach ($data as $key => $value) {
$data[$key] = $this->normalize($value, $format, $context);
}
Expand Down
2 changes: 0 additions & 2 deletions src/lib/Output/Normalizer/JsonObjectNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public function normalize($object, ?string $format = null, array $context = []):
{
$vars = get_object_vars($object);

unset($vars['_ref_parent']);

foreach ($vars as $name => $value) {
$vars[$name] = $this->normalizer->normalize($value, $format, $context);
}
Expand Down

0 comments on commit 81e18ea

Please sign in to comment.