Skip to content

Commit 1cd99b9

Browse files
norkunasdunglas
authored andcommitted
Support DBAL v4 and ORM v3
1 parent 2c0be0e commit 1cd99b9

File tree

2 files changed

+9
-29
lines changed

2 files changed

+9
-29
lines changed

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
],
1515
"require": {
1616
"php": ">=8.1",
17-
"doctrine/orm": "^2.6.3",
17+
"doctrine/orm": "^2.6.3 || ^3.0.0",
1818
"symfony/property-access": "^5.4 || ^6.0 || ^7.0",
1919
"symfony/property-info": "^5.4 || ^6.0 || ^7.0",
2020
"symfony/serializer": "^5.4 || ^6.0 || ^7.0"
2121
},
2222
"require-dev": {
23-
"doctrine/annotations": "^1.0",
23+
"doctrine/annotations": "^1.0 || ^2.0.0",
2424
"doctrine/doctrine-bundle": "^1.12.13 || ^2.2",
25-
"doctrine/dbal": "^2.7 || ^3.3",
25+
"doctrine/dbal": "^2.7 || ^3.3 || ^4.0.0",
2626
"symfony/finder": "^5.4 || ^6.0 || ^7.0",
2727
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
2828
"symfony/phpunit-bridge": "^6.0 || ^7.0",

src/Type/JsonDocumentType.php

+6-26
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,13 @@ final class JsonDocumentType extends JsonType
2222
{
2323
public const NAME = 'json_document';
2424

25-
/**
26-
* @var SerializerInterface
27-
*/
28-
private $serializer;
25+
private SerializerInterface $serializer;
2926

30-
/**
31-
* @var string
32-
*/
33-
private $format = 'json';
27+
private string $format = 'json';
3428

35-
/**
36-
* @var array
37-
*/
38-
private $serializationContext = [];
29+
private array $serializationContext = [];
3930

40-
/**
41-
* @var array
42-
*/
43-
private $deserializationContext = [];
31+
private array $deserializationContext = [];
4432

4533
/**
4634
* Sets the serializer to use.
@@ -88,10 +76,7 @@ public function setDeserializationContext(array $deserializationContext): void
8876
$this->deserializationContext = $deserializationContext;
8977
}
9078

91-
/**
92-
* @param mixed $value
93-
*/
94-
public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
79+
public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string
9580
{
9681
if (null === $value) {
9782
return null;
@@ -100,12 +85,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
10085
return $this->getSerializer()->serialize($value, $this->format, $this->serializationContext);
10186
}
10287

103-
/**
104-
* @param mixed $value
105-
*
106-
* @return mixed
107-
*/
108-
public function convertToPHPValue($value, AbstractPlatform $platform)
88+
public function convertToPHPValue(mixed $value, AbstractPlatform $platform): mixed
10989
{
11090
if (null === $value || $value === '') {
11191
return null;

0 commit comments

Comments
 (0)