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 6e5d5b4 commit 0babd33
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
5 changes: 0 additions & 5 deletions src/contracts/Output/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,6 @@ protected function checkEnd($type, $data)
*/
abstract public function serializeBool($boolValue);

/**
* @return array<mixed>
*/
abstract public function toArray(): array;

public function getData(): object
{
throw new \LogicException(sprintf(
Expand Down
2 changes: 0 additions & 2 deletions src/lib/Output/Generator/InMemory/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ public function endDocument(mixed $data): string
{
parent::endDocument($data);

$normalizedData = $this->toArray();

$data = $this->getData();

if (!$data instanceof Json\JsonObject) {
Expand Down
5 changes: 0 additions & 5 deletions src/lib/Output/Generator/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,6 @@ public function serializeBool($boolValue)
return (bool)$boolValue;
}

public function toArray(): array
{
return json_decode(json_encode($this->json, JSON_THROW_ON_ERROR), true, JSON_THROW_ON_ERROR);
}

public function getData(): object
{
return $this->json;
Expand Down

0 comments on commit 0babd33

Please sign in to comment.