1 | <?php |
||
22 | class ResponseFactory |
||
23 | { |
||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $exceptedHeaders = [ |
||
28 | 'X-Kickbox-Balance', |
||
29 | 'X-Kickbox-Response-Time', |
||
30 | ]; |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $expectedParameters = [ |
||
36 | 'result', |
||
37 | 'reason', |
||
38 | 'role', |
||
39 | 'free', |
||
40 | 'disposable', |
||
41 | 'accept_all', |
||
42 | 'did_you_mean', |
||
43 | 'sendex', |
||
44 | 'email', |
||
45 | 'user', |
||
46 | 'domain', |
||
47 | 'success', |
||
48 | ]; |
||
49 | |||
50 | /** |
||
51 | * Create a KickBox Response according to an api call. |
||
52 | * |
||
53 | * @param array $headers HTTP Headers of the call. |
||
54 | * @param array $parameters Json Parameters of the call. |
||
55 | * |
||
56 | * @return Response A Kickbox response instance. |
||
57 | */ |
||
58 | 4 | public function createResponse(array $headers, array $parameters) |
|
90 | |||
91 | /** |
||
92 | * Check if the expected values are in the array. |
||
93 | * |
||
94 | * @param $expectedValues |
||
95 | * @param $array |
||
96 | * |
||
97 | * @return bool |
||
98 | */ |
||
99 | 4 | protected function checkExpectedValues($expectedValues, $array) |
|
105 | } |
||
106 |