Total Complexity | 3 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class SerializeResponseDataStep extends AbstractStep |
||
10 | { |
||
11 | /** |
||
12 | * @var Serializer |
||
13 | */ |
||
14 | private $serializer; |
||
15 | |||
16 | public function __construct(Serializer $serializer) |
||
17 | { |
||
18 | $this->serializer = $serializer; |
||
19 | } |
||
20 | |||
21 | public function execute() |
||
22 | { |
||
23 | $serialized = $this->serializer->serialize( |
||
24 | $this->getFromResponse('response_data'), |
||
25 | $this->request->attributes->get('_format') |
||
26 | ); |
||
27 | return $this->createResponse(['response_data'=> $serialized], true); |
||
28 | |||
29 | |||
30 | } |
||
31 | |||
32 | public function requiresBefore() |
||
35 | } |
||
36 | } |