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

Skip to content

Commit 51be18d

Browse files
minor #60812 [VarDumper] Remove deprecated resource casters (derrabus)
This PR was squashed before being merged into the 8.0 branch. Discussion ---------- [VarDumper] Remove deprecated resource casters | Q | A | ------------- | --- | Branch? | 8.0 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | Follows #59035, needs #60810 + #60811 | License | MIT Commits ------- f6fb66f [VarDumper] Remove deprecated resource casters
2 parents 9ab8b94 + f6fb66f commit 51be18d

File tree

3 files changed

+2
-62
lines changed

3 files changed

+2
-62
lines changed

src/Symfony/Component/VarDumper/Caster/ResourceCaster.php

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,10 @@
2020
*
2121
* @final
2222
*
23-
* @internal since Symfony 7.3
23+
* @internal
2424
*/
2525
class ResourceCaster
2626
{
27-
/**
28-
* @deprecated since Symfony 7.3
29-
*/
30-
public static function castCurl(\CurlHandle $h, array $a, Stub $stub, bool $isNested): array
31-
{
32-
trigger_deprecation('symfony/var-dumper', '7.3', 'The "%s()" method is deprecated without replacement.', __METHOD__, CurlCaster::class);
33-
34-
return CurlCaster::castCurl($h, $a, $stub, $isNested);
35-
}
36-
3727
public static function castDba(\Dba\Connection $dba, array $a, Stub $stub, bool $isNested): array
3828
{
3929
if (\PHP_VERSION_ID < 80402) {
@@ -66,24 +56,4 @@ public static function castStreamContext($stream, array $a, Stub $stub, bool $is
6656
{
6757
return @stream_context_get_params($stream) ?: $a;
6858
}
69-
70-
/**
71-
* @deprecated since Symfony 7.3
72-
*/
73-
public static function castGd(\GdImage $gd, array $a, Stub $stub, bool $isNested): array
74-
{
75-
trigger_deprecation('symfony/var-dumper', '7.3', 'The "%s()" method is deprecated without replacement.', __METHOD__, GdCaster::class);
76-
77-
return GdCaster::castGd($gd, $a, $stub, $isNested);
78-
}
79-
80-
/**
81-
* @deprecated since Symfony 7.3
82-
*/
83-
public static function castOpensslX509(\OpenSSLCertificate $h, array $a, Stub $stub, bool $isNested): array
84-
{
85-
trigger_deprecation('symfony/var-dumper', '7.3', 'The "%s()" method is deprecated without replacement.', __METHOD__, OpenSSLCaster::class);
86-
87-
return OpenSSLCaster::castOpensslX509($h, $a, $stub, $isNested);
88-
}
8959
}

src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ abstract class AbstractCloner implements ClonerInterface
181181

182182
'Dba\Connection' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'],
183183

184-
'GdImage' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castGd'],
184+
'GdImage' => ['Symfony\Component\VarDumper\Caster\GdCaster', 'castGd'],
185185

186186
'SQLite3Result' => ['Symfony\Component\VarDumper\Caster\SqliteCaster', 'castSqlite3Result'],
187187

src/Symfony/Component/VarDumper/Tests/Caster/ResourceCasterTest.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,6 @@ class ResourceCasterTest extends TestCase
2222
use ExpectUserDeprecationMessageTrait;
2323
use VarDumperTestTrait;
2424

25-
/**
26-
* @group legacy
27-
*
28-
* @requires extension curl
29-
*/
30-
public function testCastCurlIsDeprecated()
31-
{
32-
$ch = curl_init('http://example.com');
33-
curl_setopt($ch, \CURLOPT_RETURNTRANSFER, true);
34-
curl_exec($ch);
35-
36-
$this->expectUserDeprecationMessage('Since symfony/var-dumper 7.3: The "Symfony\Component\VarDumper\Caster\ResourceCaster::castCurl()" method is deprecated without replacement.');
37-
38-
ResourceCaster::castCurl($ch, [], new Stub(), false);
39-
}
40-
41-
/**
42-
* @group legacy
43-
*
44-
* @requires extension gd
45-
*/
46-
public function testCastGdIsDeprecated()
47-
{
48-
$gd = imagecreate(1, 1);
49-
50-
$this->expectUserDeprecationMessage('Since symfony/var-dumper 7.3: The "Symfony\Component\VarDumper\Caster\ResourceCaster::castGd()" method is deprecated without replacement.');
51-
52-
ResourceCaster::castGd($gd, [], new Stub(), false);
53-
}
54-
5525
/**
5626
* @requires extension dba
5727
*/

0 commit comments

Comments
 (0)