Skip to content

Commit 344c187

Browse files
authored
Merge pull request #23 from swagindustries/feature/update-deps
Update Symfony minimum version
2 parents 714f278 + 85f843b commit 344c187

File tree

5 files changed

+29
-27
lines changed

5 files changed

+29
-27
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [3.1.0] - 2024-08-06
10+
11+
### Added
12+
13+
- Compatibility with Symfony 7.0+
14+
15+
### Removed
16+
17+
- Compatibility with Symfony 5.x
18+
919
## [3.0.0] - 2024-08-01
1020

1121
### Added

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Versions
117117
|---------|--------------|---------------|-----------------|-------------|---------------------------------|
118118
| 1.x | Unmaintained | [v1][v1-doc] | >= 3.3 && <5 | >= 7.1 | |
119119
| 2.x | Maintained | [v2][v2-doc] | >= 4.3 | >= 7.4 | |
120-
| 3.x | Latest | [v3][v3-doc] | >= 5.4 | >= 8.1 | See [UPGRADE](v3-upgrade) guide |
120+
| 3.x | Latest | [v3][v3-doc] | >= 6.4 | >= 8.1 | See [UPGRADE](v3-upgrade) guide |
121121

122122
[v1-doc]: https://github.com/swagindustries/doctrine-domain-events/tree/v1.5.2/docs
123123
[v2-doc]: https://github.com/swagindustries/doctrine-domain-events/tree/v2.3.3/docs

Tests/Symfony/Serializer/DomainDenormalizerTest.php

+5-9
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@
88
use PHPUnit\Framework\TestCase;
99
use Prophecy\Argument;
1010
use Prophecy\PhpUnit\ProphecyTrait;
11+
use Prophecy\Prophecy\ObjectProphecy;
1112
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
1213
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
14+
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
1315
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
1416

1517
class DomainDenormalizerTest extends TestCase
1618
{
1719
use ProphecyTrait;
1820

1921
/**
20-
* @var ObjectNormalizer
22+
* @var ObjectNormalizer|ObjectProphecy
2123
*/
2224
private $decorated;
2325

@@ -28,7 +30,8 @@ class DomainDenormalizerTest extends TestCase
2830

2931
public function setUp(): void
3032
{
31-
$this->decorated = $this->prophesize(ObjectNormalizer::class);
33+
$this->decorated = $this->prophesize(NormalizerInterface::class);
34+
$this->decorated->willImplement(DenormalizerInterface::class);
3235
$this->dispatcher = new DomainEventDispatcher();
3336
}
3437

@@ -66,11 +69,4 @@ public function testDenormalize()
6669
$denormalizer = new DomainDenormalizer($this->decorated->reveal(), $this->dispatcher);
6770
$denormalizer->denormalize([], FakeModel::class, null, []);
6871
}
69-
70-
public function testItIsAnInstanceOfCacheableSupportsMethodInterface()
71-
{
72-
$denormalizer = new DomainDenormalizer($this->decorated->reveal(), $this->dispatcher);
73-
$this->assertInstanceOf(CacheableSupportsMethodInterface::class, $denormalizer);
74-
$this->assertTrue($denormalizer->hasCacheableSupportsMethod());
75-
}
7672
}

composer.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"require": {
66
"php": ">=8.1",
7-
"symfony/event-dispatcher": "^5.4|^6.0|^7.0",
7+
"symfony/event-dispatcher": "^6.4|^7.0",
88
"doctrine/doctrine-bundle": "^1.8|^2.0",
99
"doctrine/orm": "^2.18.3|^3.0"
1010
},
@@ -18,16 +18,16 @@
1818
"phpunit/phpunit": "^9.5 || ^10",
1919
"doctrine/orm": "^2.18.3",
2020
"friendsofphp/php-cs-fixer": "^3.49.0",
21-
"symfony/framework-bundle": "^5.0 || ^6.0",
21+
"symfony/framework-bundle": "^6.4 || ^7.0",
2222
"phpspec/prophecy-phpunit": "^2.0.1",
2323
"monolog/monolog": "^2.8.0 || ^3.2.0",
24-
"symfony/var-dumper": "^5.0 || ^6.0",
25-
"symfony/serializer": "^5.0 || ^6.0",
26-
"symfony/asset": "^5.0 || ^6.0",
27-
"symfony/form": "^5.0 || ^6.0",
28-
"symfony/property-access": "^5.0 || ^6.0",
24+
"symfony/var-dumper": "^6.4 || ^7.0",
25+
"symfony/serializer": "^6.4 || ^7.0",
26+
"symfony/asset": "^6.4 || ^7.0",
27+
"symfony/form": "^6.4 || ^7.0",
28+
"symfony/property-access": "^6.4 || ^7.0",
2929
"symfony/debug-pack": "^1.0",
30-
"symfony/yaml": "^5.0 || ^6.0"
30+
"symfony/yaml": "^6.4 || ^7.0"
3131
},
3232
"conflict": {
3333
"doctrine/orm": "<2.6.3"

src/Integration/Symfony/Serializer/DomainDenormalizer.php

+5-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Biig\Component\Domain\Event\DomainEventDispatcherInterface;
66
use Biig\Component\Domain\Model\ModelInterface;
7-
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
87
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
98
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
109
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
@@ -14,7 +13,7 @@
1413
/**
1514
* Class DomainDenormalizer.
1615
*/
17-
final class DomainDenormalizer implements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface, CacheableSupportsMethodInterface
16+
final class DomainDenormalizer implements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface
1817
{
1918
/**
2019
* @var ObjectNormalizer
@@ -32,7 +31,7 @@ public function __construct(NormalizerInterface $decorated, DomainEventDispatche
3231
$this->dispatcher = $dispatcher;
3332
}
3433

35-
public function denormalize($data, $class, $format = null, array $context = [])
34+
public function denormalize($data, $class, $format = null, array $context = []): mixed
3635
{
3736
$domain = $this->decorated->denormalize($data, $class, $format, $context);
3837

@@ -48,10 +47,7 @@ public function supportsDenormalization($data, $type, $format = null, array $con
4847
return $this->decorated->supportsDenormalization($data, $type, $format, $context);
4948
}
5049

51-
/**
52-
* @return array|string|int|float|bool|\ArrayObject|null
53-
*/
54-
public function normalize($object, $format = null, array $context = [])
50+
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
5551
{
5652
return $this->decorated->normalize($object, $format, $context);
5753
}
@@ -68,8 +64,8 @@ public function setSerializer(SerializerInterface $serializer): void
6864
}
6965
}
7066

71-
public function hasCacheableSupportsMethod(): bool
67+
public function getSupportedTypes(?string $format): array
7268
{
73-
return true;
69+
return $this->decorated->getSupportedTypes($format);
7470
}
7571
}

0 commit comments

Comments
 (0)