Skip to content

Commit 0e529b0

Browse files
Merge branch '4.3' into 4.4
* 4.3: [Intl] Update the ICU data to 65.1 (4.3 branch) Replace deprecated calls in tests [Intl] Update the ICU data to 65.1 Delete 5_Security_issue.md [DI] Whitelist validator.auto_mapper in UnusedTagsPass [HttpClient] Fixed #33832 NO_PROXY option ignored in NativeHttpClient::request() method [Cache] give 100ms before starting the expiration countdown [Cache] fix logger usage in CacheTrait::doGet() [VarDumper] fix dumping uninitialized SplFileInfo Added missing translations. Fixed invalid changelog 4.0.0 for VarDumper Fixed invalid VarDumper upgrade doc. [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array Don't let falsey usernames slip through
2 parents dfb9df5 + bde8957 commit 0e529b0

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ CHANGELOG
3333
* support for passing `\ReflectionClass` instances to the `Caster::castObject()`
3434
method has been dropped, pass class names as strings instead
3535
* the `Data::getRawData()` method has been removed
36-
* the `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$context = null`
36+
* the `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$filter = 0`
3737
argument and moves `$message = ''` argument at 4th position.
38-
* the `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$context = null`
38+
* the `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$filter = 0`
3939
argument and moves `$message = ''` argument at 4th position.
4040

4141
3.4.0

Caster/SplCaster.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, $isNe
9090

9191
$prefix = Caster::PREFIX_VIRTUAL;
9292

93+
if (false === $c->getPathname()) {
94+
$a[$prefix.''] = 'The parent constructor was not called: the object is in an invalid state';
95+
96+
return $a;
97+
}
98+
9399
foreach ($map as $key => $accessor) {
94100
try {
95101
$a[$prefix.$key] = $c->$accessor();

Tests/Caster/SplCasterTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,18 @@ public function testArrayIterator()
196196
0 => 234
197197
]
198198
}
199+
EOTXT;
200+
$this->assertDumpEquals($expected, $var);
201+
}
202+
203+
public function testBadSplFileInfo()
204+
{
205+
$var = new BadSplFileInfo();
206+
207+
$expected = <<<EOTXT
208+
Symfony\Component\VarDumper\Tests\Caster\BadSplFileInfo {
209+
⚠: "The parent constructor was not called: the object is in an invalid state"
210+
}
199211
EOTXT;
200212
$this->assertDumpEquals($expected, $var);
201213
}
@@ -205,3 +217,10 @@ class MyArrayIterator extends \ArrayIterator
205217
{
206218
private $foo = 123;
207219
}
220+
221+
class BadSplFileInfo extends \SplFileInfo
222+
{
223+
public function __construct()
224+
{
225+
}
226+
}

0 commit comments

Comments
 (0)