Skip to content

Commit

Permalink
Merge pull request #6 from oqq/improvements
Browse files Browse the repository at this point in the history
- Remove json handling
- Add accessors
  • Loading branch information
oqq committed Jan 13, 2021
2 parents 2ac1db3 + 105c2a9 commit 9f63eab
Show file tree
Hide file tree
Showing 16 changed files with 136 additions and 110 deletions.
114 changes: 57 additions & 57 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/Definition/Body.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

final class Body
{
private string $content;
private array $content;
private MatchingRules $matchingRules;

public static function fromArray(array $payload): self
{
Assert::keyExists($payload, 'content');
Assert::string($payload['content']);
Assert::isArray($payload['content']);

Assert::keyExists($payload, 'matching_rules');
Assert::isArray($payload['matching_rules']);
Expand All @@ -32,7 +32,7 @@ public function toArray(): array
];
}

public function content(): string
public function content(): array
{
return $this->content;
}
Expand All @@ -42,7 +42,7 @@ public function matchingRules(): MatchingRules
return $this->matchingRules;
}

private function __construct(string $content, MatchingRules $matchingRules)
private function __construct(array $content, MatchingRules $matchingRules)
{
$this->content = $content;
$this->matchingRules = $matchingRules;
Expand Down

0 comments on commit 9f63eab

Please sign in to comment.