Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
53 | 1 | public function saveNewTask(Task $task) |
|
54 | { |
||
55 | 1 | $data = $this->serializer->serialize($task, 'json'); |
|
56 | |||
57 | 1 | $res = $this->client->request('POST', self::VERSION . '/tasks', [ |
|
58 | 1 | 'body' => $data, |
|
59 | 'headers' => [ |
||
60 | 1 | 'Content-Type' => 'application/json', |
|
61 | 1 | 'X-Ninja-Token' => $this->api_token, |
|
62 | 1 | 'X-Requested-With' => 'XMLHttpRequest', |
|
63 | ] |
||
64 | ]); |
||
65 | |||
66 | 1 | return $this->serializer->deserialize($res->getBody(), Task::class, 'json'); |
|
67 | } |
||
68 | } |
||
69 |