Total Complexity | 6 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | abstract class AbstractStep implements StepInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var Request |
||
14 | */ |
||
15 | protected $request; |
||
16 | |||
17 | /** |
||
18 | * @var ResponseInterface |
||
19 | */ |
||
20 | protected $response; |
||
21 | |||
22 | /** |
||
23 | * @param array $data |
||
24 | * @param bool $isHttpReady |
||
25 | * @param int $status |
||
26 | * |
||
27 | * @return ProcessorResponse |
||
28 | */ |
||
29 | protected function createResponse(array $data, $isHttpReady = false, $status = 200) |
||
30 | { |
||
31 | return new ProcessorResponse( |
||
32 | $this->request, |
||
33 | array_merge($this->response->getData(), $data), |
||
34 | $isHttpReady, |
||
35 | $status |
||
36 | ); |
||
37 | } |
||
38 | |||
39 | protected function getFromResponse($key) |
||
40 | { |
||
41 | return array_key_exists($key, $this->response->getData()) ? $this->response->getData()[$key] : null; |
||
42 | } |
||
43 | |||
44 | public function setPreviousResponse(ResponseInterface $response) |
||
45 | { |
||
46 | $this->response = $response; |
||
47 | |||
48 | return $this; |
||
49 | } |
||
50 | |||
51 | public function setRequest(Request $request) |
||
54 | } |
||
55 | |||
56 | public function getName() |
||
59 | } |
||
60 | } |