DropboxResponseToFile::getFilePath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
namespace Dropbox;
3
4
class DropboxResponseToFile extends DropboxResponse
5
{
6
    /**
7
     * @var DropboxFile
8
     */
9
    protected $file;
10
11
    /**
12
     * Create a new DropboxResponse instance
13
     *
14
     * @param DropboxRequest $request
15
     * @param DropboxFile $file
16
     * @param int|null    $httpStatusCode
17
     * @param array       $headers
18
     */
19 1
    public function __construct(DropboxRequest $request, DropboxFile $file, $httpStatusCode = null, array $headers = [])
20
    {
21 1
        parent::__construct($request, null, $httpStatusCode, $headers);
22 1
        $this->file = $file;
23 1
    }
24
25
    public function getBody()
26
    {
27
        return $this->file->getContents();
28
    }
29
30 1
    public function getFilePath()
31
    {
32 1
        return $this->file->getFilePath();
33
    }
34
}
35