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

PartialFrame   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

4 Methods

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