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

Skip to content

Commit 8a416d2

Browse files
[VarDumper] show proxified class on hover
1 parent 83232f8 commit 8a416d2

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\VarDumper\Caster;
13+
14+
use ProxyManager\Proxy\ProxyInterface;
15+
use Symfony\Component\VarDumper\Cloner\Stub;
16+
17+
/**
18+
* @author Nicolas Grekas <[email protected]>
19+
*/
20+
class ProxyManagerCaster
21+
{
22+
public static function castProxy(ProxyInterface $c, array $a, Stub $stub, $isNested)
23+
{
24+
if ($parent = \get_parent_class($c)) {
25+
$stub->class .= ' - '.$parent.'@proxy';
26+
}
27+
28+
return $a;
29+
}
30+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ abstract class AbstractCloner implements ClonerInterface
8181
'Symfony\Component\VarDumper\Caster\FrameStub' => array('Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFrameStub'),
8282
'Symfony\Component\Debug\Exception\SilencedErrorContext' => array('Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castSilencedErrorContext'),
8383

84+
'ProxyManager\Proxy\ProxyInterface' => array('Symfony\Component\VarDumper\Caster\ProxyManagerCaster', 'castProxy'),
8485
'PHPUnit_Framework_MockObject_MockObject' => array('Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'),
8586
'Prophecy\Prophecy\ProphecySubjectInterface' => array('Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'),
8687
'Mockery\MockInterface' => array('Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'),

0 commit comments

Comments
 (0)