Completed
Push — master ( 2994aa...19d116 )
by Patrick
08:28
created

RequestBodyStream::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
namespace Dropbox\Http;
3
4
use Dropbox\DropboxFile;
5
6
/**
7
 * RequestBodyStream
8
 */
9
class RequestBodyStream implements RequestBodyInterface
10
{
11
12
    /**
13
     * File to be sent with the Request
14
     *
15
     * @var \Dropbox\DropboxFile
16
     */
17
    protected $file;
18
19
    /**
20
     * Create a new RequestBodyStream instance
21
     *
22
     * @param \Dropbox\DropboxFile $file
23
     */
24 7
    public function __construct(DropboxFile $file)
25
    {
26 7
        $this->file = $file;
27 7
    }
28
29
    /**
30
     * Get the Body of the Request
31
     *
32
     * @return string
33
     */
34 7
    public function getBody()
35
    {
36 7
        return $this->file->getContents();
37
    }
38
}
39