Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
verfriemelt-dot-org committed Aug 12, 2024
1 parent c6c3aa8 commit 2786377
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
11 changes: 0 additions & 11 deletions Dockerfile

This file was deleted.

14 changes: 5 additions & 9 deletions _/DataModel/Type/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,18 @@
use verfriemelt\wrapped\_\DataModel\PropertyObjectInterface;
use Override;

use function json_encode;

use const JSON_PRETTY_PRINT;
use const JSON_THROW_ON_ERROR;

class Json implements PropertyObjectInterface
{
public string|stdClass $data;

final public function __construct(string $data = '{}')
{
$this->data = json_decode($data, null, 512, JSON_THROW_ON_ERROR);
$this->data = json_decode($data, null, 512, \JSON_THROW_ON_ERROR);
}

public function toSqlFormat(): string
{
return json_encode($this->data, JSON_THROW_ON_ERROR);
return \json_encode($this->data, \JSON_THROW_ON_ERROR);
}

#[Override]
Expand All @@ -48,7 +43,8 @@ public function toString(): string
return $this->toSqlFormat();
}

public function pretty(): string {
return json_encode($this->data, JSON_THROW_ON_ERROR ^ JSON_PRETTY_PRINT);
public function pretty(): string
{
return \json_encode($this->data, \JSON_THROW_ON_ERROR ^ \JSON_PRETTY_PRINT);
}
}

0 comments on commit 2786377

Please sign in to comment.