Completed
Push — master ( e41c6a...6a7f08 )
by Saurabh
03:07
created

DocumentConvert::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 6
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 3
dl 6
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Sausin\Signere;
4
5 View Code Duplication
class DocumentConvert extends BaseClass
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
6
{
7
    /** The URI of the action */
8
    const URI = 'https://api.signere.no/api/DocumentConvert';
9
10
    /**
11
     * Convert format of the document to PDF.
12
     *
13
     * @param  array  $body
14
     * @return object
15
     * @todo fix it for proper setup with file
16
     */
17 1
    public function convert(array $body)
18
    {
19
        // make the URL for this request
20 1
        $url = $this->transformUrl(self::URI);
21
22
        // get the headers for this request
23 1
        $headers = $this->headers->make('POST', $url, $body);
24
25
        // get the response
26 1
        $response = $this->client->post($url, [
27 1
            'headers' => $headers,
28 1
            'json' => $body,
29
        ]);
30
31
        // return the response
32 1
        return $response;
33
    }
34
}
35