ResponseFactory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 43
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A make() 0 7 1
A makeResponseInfo() 0 4 1
A makeResponse() 0 4 1
1
<?php namespace CodeZero\Curl;
2
3
class ResponseFactory
4
{
5
    /**
6
     * Make a response
7
     *
8
     * @param $responseBody
9
     * @param array $responseInfo
10
     *
11
     * @return Response
12
     */
13
    public function make($responseBody, array $responseInfo)
14
    {
15
        $info = $this->makeResponseInfo($responseInfo);
16
        $response = $this->makeResponse($responseBody, $info);
17
18
        return $response;
19
    }
20
21
    /**
22
     * Make a ResponseInfo instance
23
     *
24
     * @param array $responseInfo
25
     *
26
     * @return ResponseInfo
27
     */
28
    private function makeResponseInfo(array $responseInfo)
29
    {
30
        return new ResponseInfo($responseInfo);
31
    }
32
33
    /**
34
     * Make a Response instance
35
     *
36
     * @param $responseBody
37
     * @param ResponseInfo $responseInfo
38
     *
39
     * @return Response
40
     */
41
    private function makeResponse($responseBody, ResponseInfo $responseInfo)
42
    {
43
        return new Response($responseBody, $responseInfo);
44
    }
45
}
46