Completed
Pull Request — master (#97)
by
unknown
03:44
created

RequestBodyStream::getBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace Kunnu\Dropbox\Http;
3
4
use Kunnu\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 \Kunnu\Dropbox\DropboxFile
16
     */
17
    protected $file;
18
19
    /**
20
     * Create a new RequestBodyStream instance
21
     *
22
     * @param \Kunnu\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