This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/VarDumper/Caster/StubCaster.php

47 lines
984 B
PHP
Raw Normal View History

<?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 Symfony\Component\VarDumper\Caster;
use Symfony\Component\VarDumper\Cloner\Stub;
/**
2014-10-19 16:37:57 +01:00
* Casts a caster's Stub.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class StubCaster
{
2014-10-19 16:37:57 +01:00
public static function castStub(Stub $c, array $a, Stub $stub, $isNested)
{
if ($isNested) {
$stub->type = $c->type;
$stub->class = $c->class;
$stub->value = $c->value;
2014-10-10 16:31:59 +01:00
$stub->handle = $c->handle;
$stub->cut = $c->cut;
return array();
}
}
2014-10-19 16:37:57 +01:00
public static function cutInternals($obj, array $a, Stub $stub, $isNested)
{
if ($isNested) {
$stub->cut += count($a);
return array();
}
return $a;
}
}