1 <?php
2
3 namespace Docolight\Http;
4
5 use Docolight\Support\Factory;
6
7 8 9 10 11
12 class ResponseFactory extends Factory
13 {
14 15 16
17 public function getDefaultProduct()
18 {
19 return 'base';
20 }
21
22 23 24
25 protected function getMethod($product)
26 {
27 return 'create'.ucfirst($product).'Response';
28 }
29
30 31 32 33 34
35 protected function createBaseResponse()
36 {
37 return new Response(new Headers(array('Content-Type' => 'text/html')));
38 }
39
40 41 42 43 44
45 protected function createJsonResponse()
46 {
47 return $this->container->make('Docolight\Http\JsonResponse');
48 }
49 }
50