Test Failed
Push — master ( 0d14a6...e876c1 )
by Fran
09:15
created

ProfilingJsonResponse::createFromPrevious()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
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);
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 160 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
18
        $profiling->setProfile($data);
19
        return $profiling;
20
    }
21
}