Completed
Push — master ( a7af36...1cb211 )
by Evgenij
02:42
created

PartialFrame::getRemoteAddress()   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 1
Metric Value
c 1
b 0
f 1
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
 * Async sockets
4
 *
5
 * @copyright Copyright (c) 2015, Efimov Evgenij <[email protected]>
6
 *
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
namespace AsyncSockets\Frame;
11
12
/**
13
 * Class PartialFrame. Special object indicates that data inside frame is incomplete
14
 */
15
class PartialFrame implements FrameInterface
16
{
17
    /**
18
     * Original frame
19
     *
20
     * @var FrameInterface
21
     */
22
    private $original;
23
24
    /**
25
     * PartialFrame constructor.
26
     *
27
     * @param FrameInterface $original Original frame
28
     */
29 7
    public function __construct(FrameInterface $original)
30
    {
31 7
        $this->original = $original;
32 7
    }
33
34
    /** {@inheritdoc} */
35 1
    public function getData()
36
    {
37 1
        return $this->original->getData();
38
    }
39
40
    /** {@inheritdoc} */
41 2
    public function __toString()
42
    {
43 2
        return (string) $this->original;
44
    }
45
46
    /** {@inheritdoc} */
47 1
    public function getRemoteAddress()
48
    {
49 1
        return $this->original->getRemoteAddress();
50
    }
51
}
52