Passed
Push — dev ( b45126...5faaf1 )
by 世昌
02:13
created

TemplateWrapper::getContent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
namespace suda\application\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 TemplateWrapper extends AbstractContentWrapper
13
{
14
    /**
15
     * 获取内容
16
     *
17
     * @param Response $response
18
     * @return Stream
19
     */
20
    public function getWrappedContent(Response $response):Stream
21
    {
22
        $content = $this->content;
23
        return new StringStream($content->getRenderedString());
24
    }
25
}
26