RawFramePicker::doHandleData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
crap 1
1
<?php
2
/**
3
 * Async sockets
4
 *
5
 * @copyright Copyright (c) 2015-2017, 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 22
    protected function doHandleData($chunk, $remoteAddress, &$buffer)
19
    {
20 22
        $buffer = $chunk;
21 22
        $this->setFinished(true);
22 22
        return '';
23
    }
24
25
    /** {@inheritdoc} */
26 20
    protected function doCreateFrame($buffer, $remoteAddress)
27
    {
28 20
        return new Frame($buffer, $remoteAddress);
29
    }
30
}
31