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

JsonContent   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A send() 0 4 1
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