Completed
Pull Request — master (#122)
by
unknown
02:58
created

DropboxResponseToFile::getSteamOrFilePath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
namespace Kunnu\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
    public function __construct(DropboxRequest $request, DropboxFile $file, $httpStatusCode = null, array $headers = [])
20
    {
21
        parent::__construct($request, null, $httpStatusCode, $headers);
22
        $this->file = $file;
23
    }
24
25
    public function getBody()
26
    {
27
        return $this->file->getContents();
28
    }
29
30
    public function getFilePath()
31
    {
32
        return $this->file->getFilePath();
33
    }
34
35
    public function getSteamOrFilePath()
36
    {
37
        return $this->file->getStreamOrFilePath();
38
    }
39
}
40