Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
45 | 1 | public function transformText($text) |
|
46 | { |
||
47 | $requestArray = array( |
||
48 | 1 | 'text' => $text, |
|
49 | 1 | 'mode' => $this->options->getMarkdownMode(), |
|
50 | ); |
||
51 | |||
52 | 1 | $this->request->setUri($this->options->getMarkdownApiUri()); |
|
53 | 1 | $this->request->setMethod(Request::METHOD_POST); |
|
54 | 1 | $this->request->setContent(json_encode($requestArray)); |
|
55 | 1 | if ($this->options->getAccessToken()) { |
|
56 | 1 | $this->request->getHeaders() |
|
57 | 1 | ->addHeaderLine('Authorization', 'token ' . $this->options->getAccessToken()); |
|
58 | } |
||
59 | |||
60 | 1 | $response = $this->httpClient->send($this->request); |
|
61 | |||
62 | 1 | return $response->getBody(); |
|
63 | } |
||
64 | } |
||
65 |