String   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A read() 0 4 1
1
<?php
2
3
namespace Zerg\Field;
4
5
use Zerg\Stream\AbstractStream;
6
7
/**
8
 * String represents string type data.
9
 *
10
 * Data, parsed by this type of field returns as it is in binary file.
11
 *
12
 * @since 0.1
13
 * @package Zerg\Field
14
 */
15
class String extends Scalar
16
{
17
    /**
18
     * Read string from stream as it is.
19
     *
20
     * @param AbstractStream $stream Stream from which read.
21
     * @return string Returned string.
22
     */
23 8
    public function read(AbstractStream $stream)
24
    {
25 8
        return $stream->getBuffer()->read($this->getSize(), $this->getEndian());
26
    }
27
}