Completed
Push — master ( 6b8416...c520c0 )
by Filipe
02:12
created

TextStream   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

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