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

Skip to content

Commit ec8e34f

Browse files
minor #34050 [VarDumper] improve displaying cut closures (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- [VarDumper] improve displaying cut closures | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Minor but still an improvement so 4.4: this change makes closures replaced by `CutStub` be displayed with their signature instead of just the `Closure` label. Commits ------- 2b0a11d [VarDumper] improve displaying cut closures
2 parents ebca10e + 2b0a11d commit ec8e34f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ public function __construct($value)
2828
case 'object':
2929
$this->type = self::TYPE_OBJECT;
3030
$this->class = \get_class($value);
31+
32+
if ($value instanceof \Closure) {
33+
ReflectionCaster::castClosure($value, [], $this, true, Caster::EXCLUDE_VERBOSE);
34+
}
35+
3136
$this->cut = -1;
3237
break;
3338

0 commit comments

Comments
 (0)