8000 [VarDumper] Fix ResourceCaster deprecation messages by derrabus · Pull Request #60810 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[VarDumper] Fix ResourceCaster deprecation messages #60810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/Symfony/Component/VarDumper/Caster/ResourceCaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ResourceCaster
*/
public static function castCurl(\CurlHandle $h, array $a, Stub $stub, bool $isNested): array
{
trigger_deprecation('symfony/var-dumper', '7.3', 'The "%s()" method is deprecated without replacement.', __METHOD__, CurlCaster::class);
trigger_deprecation('symfony/var-dumper', '7.3&# 8000 39;, 'The "%s()" method is deprecated without replacement.', __METHOD__);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not even use the extra arguments there but use an explicit \sprintf call instead, which can be optimized by OPCache at compile time on recent PHP versions as we only use %s placeholders (the optimization supports %s and %d).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And as another benefit, static analysis tools are able to detect such issues about mismatch for the number of parameters.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me ignore this concern and merge: the patch is using the API the expected way and the perf topic looks minor to me.


return CurlCaster::castCurl($h, $a, $stub, $isNested);
}
Expand Down Expand Up @@ -75,7 +75,7 @@ public static function castStreamContext($stream, array $a, Stub $stub, bool $is
*/
public static function castGd(\GdImage $gd, array $a, Stub $stub, bool $isNested): array
{
trigger_deprecation('symfony/var-dumper', '7.3', 'The "%s()" method is deprecated without replacement.', __METHOD__, GdCaster::class);
trigger_deprecation('symfony/var-dumper', '7.3', 'The "%s()" method is deprecated without replacement.', __METHOD__);

return GdCaster::castGd($gd, $a, $stub, $isNested);
}
Expand All @@ -85,7 +85,7 @@ public static function castGd(\GdImage $gd, array $a, Stub $stub, bool $isNested
*/
public static function castOpensslX509(\OpenSSLCertificate $h, array $a, Stub $stub, bool $isNested): array
{
trigger_deprecation('symfony/var-dumper', '7.3', 'The "%s()" method is deprecated without replacement.', __METHOD__, OpenSSLCaster::class);
trigger_deprecation('symfony/var-dumper', '7.3', 'The "%s()" method is deprecated without replacement.', __METHOD__);

return OpenSSLCaster::castOpensslX509($h, $a, $stub, $isNested);
}
Expand Down
0