4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\VarDumper\Caster;
15 * Represents a cut array.
17 * @author Nicolas Grekas <p@tchwork.com>
19 class CutArrayStub extends CutStub
21 public $preservedSubset;
23 public function __construct(array $value, array $preservedKeys)
25 parent::__construct($value);
27 $this->preservedSubset = array_intersect_key($value, array_flip($preservedKeys));
28 $this->cut -= count($this->preservedSubset);