NullParser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A parse() 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\Server\BodyParser;
11
12
use Psr\Http\Message\StreamInterface;
13
use Slick\Http\Message\Server\BodyParserInterface;
14
15
/**
16
 * NullParser
17
 *
18
 * @package Slick\Http\Message\Server\BodyParser
19
*/
20
class NullParser implements BodyParserInterface
21
{
22
    /**
23
     * @var StreamInterface
24
     */
25
    private $stream;
26
27
    /**
28
     * Creates NullParser
29
     * @param StreamInterface $stream
30
     */
31
    public function __construct(StreamInterface $stream)
32
    {
33
        $this->stream = $stream;
34
    }
35
36
    /**
37
     * Returns the body stream as text
38
     *
39
     * @return string
40
     */
41
    public function parse()
42
    {
43
        $this->stream->rewind();
44
        return $this->stream->getContents();
45
    }
46
}
47