8000 bug #49673 [VarDumper] Fixed dumping of CutStub (lyrixx) · symfony/symfony@e1b1b7d · GitHub
[go: up one dir, main page]

Skip to content

Commit e1b1b7d

Browse files
bug #49673 [VarDumper] Fixed dumping of CutStub (lyrixx)
This PR was merged into the 5.4 branch. Discussion ---------- [VarDumper] Fixed dumping of CutStub | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Commits ------- 7675006 [VarDumper] Fixed dumping of CutStub
2 parents dfea1db + 7675006 commit e1b1b7d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Symfony/Component/VarDumper/Dumper/CliDumper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut)
198198
}
199199
if ('' === $str) {
200200
$this->line .= '""';
201+
if ($cut) {
202+
$this->line .= ''.$cut;
203+
}
201204
$this->endValue($cursor);
202205
} else {
203206
$attr += [

src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\VarDumper\Tests\Dumper;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\VarDumper\Caster\CutStub;
1516
use Symfony\Component\VarDumper\Cloner\VarCloner;
1617
use Symfony\Component\VarDumper\Dumper\AbstractDumper;
1718
use Symfony\Component\VarDumper\Dumper\CliDumper;
@@ -37,6 +38,11 @@ public function testGet()
3738
':stream' => function ($res, $a) {
3839
unset($a['uri'], $a['wrapper_data']);
3940

41+
return $a;
42+
},
43+
'Symfony\Component\VarDumper\Tests\Fixture\DumbFoo' => function ($foo, $a) {
44+
$a['foo'] = new CutStub($a['foo']);
45+
4046
return $a;
4147
},
4248
]);
@@ -76,7 +82,7 @@ public function testGet()
7682
%A options: []
7783
}
7884
"obj" => Symfony\Component\VarDumper\Tests\Fixture\DumbFoo {#%d
79-
+foo: "foo"
85+
+foo: ""…3
8086
+"bar": "bar"
8187
}
8288
"closure" => Closure(\$a, PDO &\$b = null) {#%d

0 commit comments

Comments
 (0)
0