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