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

RequestBodyStream   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 30
ccs 5
cts 5
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getBody() 0 4 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