Skip to content

Commit

Permalink
IBX-8190: Allow integers as object names
Browse files Browse the repository at this point in the history
  • Loading branch information
barw4 committed Jan 8, 2025
1 parent 5219ed2 commit bc4cc96
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/contracts/Output/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ protected function checkEndDocument(mixed $data): void
/**
* Start object element.
*/
public function startObjectElement(string $name, ?string $mediaTypeName = null): void
public function startObjectElement(string|int $name, ?string $mediaTypeName = null): void
{
$name = (string)$name;

$this->checkStartObjectElement($name);

$this->isEmpty = false;
Expand All @@ -140,8 +142,10 @@ public function startObjectElement(string $name, ?string $mediaTypeName = null):
$this->attribute('media-type', $this->getMediaType($mediaTypeName));
}

public function endObjectElement(string $name): void
public function endObjectElement(string|int $name): void
{
$name = (string)$name;

$this->checkEndObjectElement($name);

if ($this->json->getParent() === null) {
Expand Down

0 comments on commit bc4cc96

Please sign in to comment.