Skip to content

Commit

Permalink
Merge pull request #86 from patriziotomato/issue-85-declaration-toJson
Browse files Browse the repository at this point in the history
Fixing issue 85 - Declaration of WendellAdriel\ValidatedDTO\SimpleDTO…
  • Loading branch information
WendellAdriel authored Sep 20, 2024
2 parents 18e4521 + 355a837 commit cb418e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Concerns/DataTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public function toArray(): array
return $this->buildDataForExport();
}

public function toJson(): string
public function toJson($options = 0): string
{
return json_encode($this->buildDataForExport());
return json_encode($this->buildDataForExport(), $options);
}

public function toPrettyJson(): string
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/BaseDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static function fromCommand(Command $command): static;

public function toArray(): array;

public function toJson(): string;
public function toJson($options = 0): string;

public function toPrettyJson(): string;

Expand Down

0 comments on commit cb418e0

Please sign in to comment.