Test Failed
Push — master ( 1b7368...050678 )
by Fran
25:16 queued 22:49
created

ProfilingJsonResponse   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 16
ccs 0
cts 6
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setProfile() 0 2 1
A createFromPrevious() 0 4 1
1
<?php
2
namespace PSFS\base\dto;
3
4
class ProfilingJsonResponse extends JsonResponse {
5
    public $profiling = [];
6
7
    public function setProfile(array $profiling) {
8
        $this->profiling = $profiling;
9
    }
10
11
    /**
12
     * @param JsonResponse $jsonResponse
13
     * @param array $data
14
     * @return array|ProfilingJsonResponse
15
     */
16
    public static function createFromPrevious(JsonResponse $jsonResponse, array $data) {
17
        $profiling = new ProfilingJsonResponse($jsonResponse->data, $jsonResponse->success, $jsonResponse->total, $jsonResponse->pages, $jsonResponse->message);
18
        $profiling->setProfile($data);
19
        return $profiling;
20
    }
21
}