Completed
Branch master (1d1574)
by Evgenij
18:38
created

RawFramePicker   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A doHandleData() 0 6 1
A doCreateFrame() 0 4 1
1
<?php
2
/**
3
 * Async sockets
4
 *
5
 * @copyright Copyright (c) 2015-2016, 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 RawFramePicker. This FramePicker allows to get chunks from network as it was read by fread
14
 */
15
class RawFramePicker extends AbstractFramePicker
16
{
17
    /** {@inheritdoc} */
18 16
    protected function doHandleData($chunk, $remoteAddress, &$buffer)
19
    {
20 16
        $buffer = $chunk;
21 16
        $this->setFinished(true);
22 16
        return '';
23
    }
24
25
    /** {@inheritdoc} */
26 16
    protected function doCreateFrame($buffer, $remoteAddress)
27
    {
28 16
        return new Frame($buffer, $remoteAddress);
29
    }
30
}
31