StringStream::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Zerg\Stream;
4
5
use PhpBio\BitBuffer;
6
7
/**
8
 * FileStream wraps string and allow fields to read data from it.
9
 *
10
 * @since 0.1
11
 * @package Zerg\Stream
12
 */
13
class StringStream extends AbstractStream
14
{
15
    /**
16
     * Return new string stream that will read data form given string.
17
     *
18
     * @param string $string
19
     */
20 27
    public function __construct($string)
21
    {
22 27
        $this->buffer = new BitBuffer($string);
23 27
    }
24
25
}