CoreFiles by mySites.guru
ContextualizedDumper.php43 lines, 1,174 bytes, from Joomla_4.3.1-Stable-Full_Package.zip
Raw History Compare with 4.3.0
md5
3413d91d18b19faa2c51d98f54122427
sha1
13c2060db83896dd8a982de368026d2a769cc1fa
sha256
c6eee4483cec8e0d01a7b77834de1090935acee26d30521f15bb893cf304768a
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\VarDumper\Dumper;

use Symfony\Component\VarDumper\Cloner\Data;
use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;

/**
 * @author Kévin Thérage <[email protected]>
 */
class ContextualizedDumper implements DataDumperInterface
{
    private $wrappedDumper;
    private $contextProviders;

    /**
     * @param ContextProviderInterface[] $contextProviders
     */
    public function __construct(DataDumperInterface $wrappedDumper, array $contextProviders)
    {
        $this->wrappedDumper = $wrappedDumper;
        $this->contextProviders = $contextProviders;
    }

    public function dump(Data $data)
    {
        $context = [];
        foreach ($this->contextProviders as $contextProvider) {
            $context[\get_class($contextProvider)] = $contextProvider->getContext();
        }

        $this->wrappedDumper->dump($data->withContext($context));
    }
}

The same content is in 131 releases, Joomla 4.0.0-beta to 4.4.14. See them all, or every version of this file.