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

ProfilingJsonResponse   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setProfile() 0 3 1
A createFromPrevious() 0 5 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);
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
}