Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: perf regression with Symfony 6.3
  • Loading branch information
dunglas committed Aug 4, 2023
commit 7737066dd79652ba27d0ab384c23aac8087d0eb0
5 changes: 4 additions & 1 deletion src/Serializer/AbstractItemNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ public function supportsNormalization(mixed $data, string $format = null, array

public function getSupportedTypes(?string $format): array
{
return ['*' => true];
return [
'object' => true,
'native-array' => true,
];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Hal/Serializer/ItemNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function testSupportsNormalization(): void
$this->assertFalse($normalizer->supportsNormalization($dummy, 'xml'));
$this->assertFalse($normalizer->supportsNormalization($std, $normalizer::FORMAT));
$this->assertEmpty($normalizer->getSupportedTypes('xml'));
$this->assertSame(['*' => true], $normalizer->getSupportedTypes($normalizer::FORMAT));
$this->assertSame(['object' => true, 'native-array' => true], $normalizer->getSupportedTypes($normalizer::FORMAT));

if (!method_exists(Serializer::class, 'getSupportedTypes')) {
$this->assertTrue($normalizer->hasCacheableSupportsMethod());
Expand Down
2 changes: 1 addition & 1 deletion tests/Serializer/AbstractItemNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function testSupportNormalizationAndSupportDenormalization(): void
$this->assertTrue($normalizer->supportsDenormalization($dummy, Dummy::class));
$this->assertFalse($normalizer->supportsDenormalization($std, \stdClass::class));
$this->assertFalse($normalizer->supportsNormalization([]));
$this->assertSame(['*' => true], $normalizer->getSupportedTypes('any'));
$this->assertSame(['object' => true, 'native-array' => true], $normalizer->getSupportedTypes('any'));

if (!method_exists(Serializer::class, 'getSupportedTypes')) {
$this->assertTrue($normalizer->hasCacheableSupportsMethod());
Expand Down
2 changes: 1 addition & 1 deletion tests/Serializer/ItemNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testSupportNormalization(): void
$this->assertTrue($normalizer->supportsDenormalization($dummy, Dummy::class));
$this->assertTrue($normalizer->supportsDenormalization($dummy, Dummy::class));
$this->assertFalse($normalizer->supportsDenormalization($std, \stdClass::class));
$this->assertSame(['*' => true], $normalizer->getSupportedTypes('any'));
$this->assertSame(['object' => true, 'native-array' => true], $normalizer->getSupportedTypes('any'));

if (!method_exists(Serializer::class, 'getSupportedTypes')) {
$this->assertTrue($normalizer->hasCacheableSupportsMethod());
Expand Down