1<?php
2
3declare(strict_types=1);
4
5namespace JMS\Serializer\EventDispatcher;
6
7use JMS\Serializer\DeserializationContext;
8
9class PreDeserializeEvent extends Event
10{
11    /**
12     * @var mixed
13     */
14    private $data;
15
16    /**
17     * @param mixed $data
18     * @param array $type
19     */
20    public function __construct(DeserializationContext $context, $data, array $type)
21    {
22        parent::__construct($context, $type);
23
24        $this->data = $data;
25    }
26
27    public function setType(string $name, array $params = []): void
28    {
29        $this->type = ['name' => $name, 'params' => $params];
30    }
31
32    /**
33     * @return mixed
34     */
35    public function getData()
36    {
37        return $this->data;
38    }
39
40    /**
41     * @param mixed $data
42     */
43    public function setData($data): void
44    {
45        $this->data = $data;
46    }
47}
48