Padding::read()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Zerg\Field;
4
5
use Zerg\Stream\AbstractStream;
6
7
/**
8
 * Padding field helps to skip some data not reading it.
9
 *
10
 * Field not designed to return some value and save it.
11
 * So in parsed DataSet there will not this field.
12
 * But given amount of data will be skipped.
13
 *
14
 * @since 0.1
15
 * @package Zerg\Field
16
 */
17
class Padding extends Scalar
18
{
19
    /**
20
     * Tells current Stream to skip given amount of bits.
21
     *
22
     * @param AbstractStream $stream Stream which which should skip data.
23
     * @return null To detect that no value has been read.
24
     */
25 5
    public function read(AbstractStream $stream)
26
    {
27 5
        $stream->skip($this->getSize());
28 5
        return null;
29
    }
30
}