Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
39 | public function save(Request $request): Response |
||
40 | { |
||
41 | $json = $request->getContent(); |
||
42 | /** @var Company $company */ |
||
43 | $company = $this->companySerializer->deserialize($json, Company::class, 'json'); |
||
44 | |||
45 | $this->companyRepository->save($company); |
||
46 | |||
47 | $response = new Response('{"id":"'.$company->getId()->toString().'"}'); |
||
48 | $response->headers->set('Content-Type', 'application/json'); |
||
49 | |||
50 | return $response; |
||
51 | } |
||
53 |