Conditions | 4 |
Paths | 5 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
47 | private function runImport(Request $request): string |
||
48 | { |
||
49 | if ($this->token) { |
||
50 | if ($this->token !== $request->get('token')) { |
||
51 | throw new InvalidArgumentException('Token validation failed'); |
||
52 | } |
||
53 | } |
||
54 | |||
55 | $data = json_decode($request->getBody(), true); |
||
56 | if (!is_array($data)) { |
||
57 | throw new InvalidArgumentException('Failed to decode payload'); |
||
58 | } |
||
59 | |||
60 | return $this->saver->save($data); |
||
61 | } |
||
62 | } |
||
63 |