Passed
Push — master ( b45126...8af3f1 )
by 世昌
03:18
created

NullContentWrapper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getWrappedContent() 0 3 1
1
<?php
2
namespace suda\framework\response\wrapper;
3
4
use suda\framework\Response;
5
use suda\framework\http\Stream;
6
use suda\framework\http\stream\StringStream;
7
use suda\framework\response\AbstractContentWrapper;
8
9
/**
10
 * 响应包装器
11
 */
12
class NullContentWrapper extends AbstractContentWrapper
13
{
14
    public function __construct()
15
    {
16
        parent::__construct(null, 'null');
17
    }
18
    
19
    /**
20
     * 获取内容
21
     *
22
     * @param Response $response
23
     * @return Stream
24
     */
25
    public function getWrappedContent(Response $response): Stream
26
    {
27
        return new StringStream('');
28
    }
29
}
30