Файл: symfony-2.7/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php
Строк: 38
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SymfonyComponentVarDumperCaster;
use SymfonyComponentVarDumperClonerStub;
/**
* Casts Reflector related classes to array representation.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class ReflectionCaster
{
public static function castReflector(Reflector $c, array $a, Stub $stub, $isNested)
{
$a[" ~ reflection"] = $c->__toString();
return $a;
}
public static function castClosure(Closure $c, array $a, Stub $stub, $isNested)
{
$stub->class = 'Closure'; // HHVM generates unique class names for closures
$a = static::castReflector(new ReflectionFunction($c), $a, $stub, $isNested);
unset($a[" + 000"], $a['name'], $a[" + this"], $a[" + parameter"]);
return $a;
}
}