TextStream   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
c 1
b 0
f 0
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 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