Passed
Push — master ( ae009e...1bc377 )
by 世昌
02:06
created

JsonContent::send()   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 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
namespace nebula\application\response\provider\type;
3
4
use nebula\application\response\Response;
5
/**
6
 * 响应接口
7
 */
8
class JsonContent implements TypeContentInterface
9
{
10
    public static function send($content, string $type)
11
    {
12
        Response::instance()->setType('json');
0 ignored issues
show
Bug introduced by
'json' of type string is incompatible with the type integer expected by parameter $extension of nebula\application\response\Response::setType(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

12
        Response::instance()->setType(/** @scrutinizer ignore-type */ 'json');
Loading history...
13
        Response::instance()->send(\json_encode($content));
14
    }
15
}
16