TextStream::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of slick/http
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Http\Message\Stream;
11
12
use Psr\Http\Message\StreamInterface;
13
14
/**
15
 * TextStream
16
 *
17
 * @package Slick\Http\Message\Stream
18
*/
19
class TextStream extends AbstractStream implements StreamInterface
20
{
21
    /**
22
     * Creates a Text Stream
23
     *
24
     * @param string $content
25
     */
26
    public function __construct($content)
27
    {
28
        $this->stream = fopen('php://memory', 'rw+');
29
        fputs($this->stream, $content);
30
    }
31
}
32