Skip to content

Commit

Permalink
Fix coding style errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland Kovacsics committed Jan 10, 2022
1 parent 85ba8cf commit 2f5661e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Types/JsonType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
use function json_encode;
use function stream_get_contents;

use const JSON_THROW_ON_ERROR;
use const JSON_PRESERVE_ZERO_FRACTION;
use const JSON_THROW_ON_ERROR;

/**
* Type generating json objects values
Expand Down
8 changes: 6 additions & 2 deletions tests/Types/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use function fopen;
use function json_encode;

use const JSON_PRESERVE_ZERO_FRACTION;
use const JSON_THROW_ON_ERROR;

class JsonTest extends TestCase
Expand Down Expand Up @@ -87,7 +88,10 @@ public function testJsonResourceConvertsToPHPValue(): void
{
$value = ['foo' => 'bar', 'bar' => 'foo'];
$databaseValue = fopen(
'data://text/plain;base64,' . base64_encode(json_encode($value, JSON_THROW_ON_ERROR | JSON_PRESERVE_ZERO_FRACTION)),
'data://text/plain;base64,' . base64_encode(json_encode(
$value,
JSON_THROW_ON_ERROR | JSON_PRESERVE_ZERO_FRACTION
)),
'r'
);
$phpValue = $this->type->convertToPHPValue($databaseValue, $this->platform);
Expand All @@ -107,7 +111,7 @@ public function testPHPNullValueConvertsToJsonNull(): void

public function testPHPValueConvertsToJsonString(): void
{
$source = ['foo' => 'bar', 'bar' => 'foo'];
$source = ['foo' => 'bar', 'bar' => 'foo'];
$databaseValue = $this->type->convertToDatabaseValue($source, $this->platform);

self::assertSame('{"foo":"bar","bar":"foo"}', $databaseValue);
Expand Down

0 comments on commit 2f5661e

Please sign in to comment.