Skip to content

Commit b5e9685

Browse files
committed
add symfony serializer benchmark
1 parent 767c766 commit b5e9685

File tree

5 files changed

+782
-248
lines changed

5 files changed

+782
-248
lines changed

baseline.xml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="6.12.0@cf420941d061a57050b6c468ef2c778faf40aee2">
2+
<files psalm-version="6.13.1@1e3b7f0a8ab32b23197b91107adc0a7ed8a05b51">
33
<file src="src/Attribute/PersonalData.php">
44
<MixedPropertyTypeCoercion>
55
<code><![CDATA[$fallbackCallable]]></code>
@@ -54,6 +54,13 @@
5454
<InvalidOperand>
5555
<code><![CDATA[$guessers]]></code>
5656
</InvalidOperand>
57+
<MixedReturnStatement>
58+
<code><![CDATA[(new ReflectionClass($class))->newLazyProxy(
59+
function () use ($metadata, $data): object {
60+
return $this->doHydrate($metadata, $data);
61+
},
62+
)]]></code>
63+
</MixedReturnStatement>
5764
<PossiblyInvalidArgument>
5865
<code><![CDATA[[
5966
...$guessers,
@@ -89,22 +96,10 @@
8996
<code><![CDATA[$value]]></code>
9097
</MixedArgumentTypeCoercion>
9198
</file>
92-
<file src="tests/Benchmark/tideways.php">
93-
<ClassMustBeFinal>
94-
<code><![CDATA[CompiledMetadataHydrator]]></code>
95-
</ClassMustBeFinal>
96-
<MixedMethodCall>
97-
<code><![CDATA[normalize]]></code>
98-
<code><![CDATA[normalize]]></code>
99-
</MixedMethodCall>
100-
<MixedReturnTypeCoercion>
101-
<code><![CDATA[array]]></code>
102-
<code><![CDATA[match (true) {
103-
$object instanceof ProfileCreated => $this->extractProfileCreated($object),
104-
$object instanceof Skill => $this->extractSkill($object),
105-
default => throw new InvalidArgumentException('Unknown object type'),
106-
}]]></code>
107-
</MixedReturnTypeCoercion>
99+
<file src="tests/Benchmark/SymfonySerializerBench.php">
100+
<MixedAssignment>
101+
<code><![CDATA[$object]]></code>
102+
</MixedAssignment>
108103
</file>
109104
<file src="tests/Unit/Cryptography/Cipher/OpensslCipherTest.php">
110105
<MixedAssignment>

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
"phpunit/phpunit": "^11.5.17",
3535
"psalm/plugin-phpunit": "^0.19.2",
3636
"roave/infection-static-analysis-plugin": "^1.36.0",
37+
"symfony/property-access": "^7.3",
38+
"symfony/serializer": "^7.0.0",
3739
"symfony/var-dumper": "^5.4.29 || ^6.4.0 || ^7.0.0",
3840
"vimeo/psalm": "^6.0.0"
3941
},

0 commit comments

Comments
 (0)