89dec36af4110194ecb9b9b77706a07e8d68cabc
[yaffs-website] / vendor / symfony / http-kernel / Tests / Fixtures / DataCollector / CloneVarDataCollector.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
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 Symfony\Component\HttpKernel\Tests\Fixtures\DataCollector;
13
14 use Symfony\Component\HttpFoundation\Request;
15 use Symfony\Component\HttpFoundation\Response;
16 use Symfony\Component\HttpKernel\DataCollector\DataCollector;
17
18 class CloneVarDataCollector extends DataCollector
19 {
20     private $varToClone;
21
22     public function __construct($varToClone)
23     {
24         $this->varToClone = $varToClone;
25     }
26
27     public function collect(Request $request, Response $response, \Exception $exception = null)
28     {
29         $this->data = $this->cloneVar($this->varToClone);
30     }
31
32     public function reset()
33     {
34         $this->data = array();
35     }
36
37     public function getData()
38     {
39         return $this->data;
40     }
41
42     public function getName()
43     {
44         return 'clone_var';
45     }
46 }