Passed
Push — master ( ddf6f5...2e933f )
by Nicolas
03:42 queued 28s
created

Binary::isChunked()   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 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Puzzle\AMQP\Messages\Bodies;
4
5
use Puzzle\AMQP\Messages\Body;
6
use Puzzle\AMQP\Messages\ContentType;
7
8
class Binary implements Body
9
{
10
    private
11
        $content;
12
13 12
    public function __construct($content)
14
    {
15 12
        $this->changeContent($content);
16 12
    }
17
18 5
    public function inOriginalFormat()
19
    {
20 5
        return $this->content;
21
    }
22
23 8
    public function asTransported()
24
    {
25 8
        return $this->content;
26
    }
27
28 9
    public function getContentType()
29
    {
30 9
        return ContentType::BINARY;
31
    }
32
33 1
    public function __toString()
34
    {
35 1
        return sprintf(
36 1
            '<binary stream of %d bytes>',
37 1
            strlen($this->content)
38 1
        );
39
    }
40
41 12
    public function changeContent($content)
42
    {
43 12
        $this->content = $content;
44 12
    }
45
46 1
    public function isChunked()
47
    {
48 1
        return false;
49
    }
50
}
51