Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/*
4
 * This file is part of Psy Shell.
5
 *
200 lars 6
 * (c) 2012-2023 Justin Hileman
148 lars 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 Psy\VarDumper;
13
 
14
use Symfony\Component\VarDumper\Caster\Caster;
15
use Symfony\Component\VarDumper\Cloner\Data;
16
use Symfony\Component\VarDumper\Cloner\Stub;
17
use Symfony\Component\VarDumper\Cloner\VarCloner;
18
 
19
/**
20
 * A PsySH-specialized VarCloner.
21
 */
22
class Cloner extends VarCloner
23
{
24
    private $filter = 0;
25
 
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function cloneVar($var, $filter = 0): Data
30
    {
31
        $this->filter = $filter;
32
 
33
        return parent::cloneVar($var, $filter);
34
    }
35
 
36
    /**
37
     * {@inheritdoc}
38
     */
39
    protected function castResource(Stub $stub, $isNested): array
40
    {
41
        return Caster::EXCLUDE_VERBOSE & $this->filter ? [] : parent::castResource($stub, $isNested);
42
    }
43
}