Passed
Push — main ( 1e821c...d0f83f )
by Roberto
02:00
created

JSONResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Lepton\Http\Response;
4
5
 class JSONResponse extends SuccessResponse
6
{
7
8
    public function __construct(
9
        public $array,
10
        )
11
    {
12
        parent::__construct(headers: ["Content-Type" => "application/json"]);
13
    }
14
15
    public function sendBody(){
16
        echo json_encode($this->array);
17
    }
18
19
20
}
21