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

JSONResponse   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A sendBody() 0 2 1
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