-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResponseInterface.php
More file actions
112 lines (102 loc) · 2.73 KB
/
ResponseInterface.php
File metadata and controls
112 lines (102 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/**
* File defining Backend\Interfaces\ResponseInterface.
*
* PHP Version 5.3
*
* @category Backend
* @package Interfaces
* @author J Jurgens du Toit <jrgns@backend-php.net>
* @copyright 2011 - 2012 Jade IT (cc)
* @license http://www.opensource.org/licenses/mit-license.php MIT License
* @link http://backend-php.net
*/
namespace Backend\Interfaces;
/**
* The response that will be sent back to the client.
*
* @category Backend
* @package Interfaces
* @author J Jurgens du Toit <jrgns@backend-php.net>
* @license http://www.opensource.org/licenses/mit-license.php MIT License
* @link http://backend-php.net
*/
interface ResponseInterface
{
/**
* The constructor for the Response class
*
* @param string $body The body for the response
* @param int $status The status code for the response
* @param array $headers The headers for the response
*/
public function __construct($body = '', $status = 200, array $headers = array());
/**
* Return the current status code for the Response
*
* @return int The status code
*/
public function getStatusCode();
/**
* Set the status code for the Response
*
* @param int $code The new status code
*
* @return Response The current object
*/
public function setStatusCode($code);
/**
* Return the specified Response header.
*
* @param string $name The name of the header to return.
*
* @return string
*/
public function getHeader($name);
/**
* Set the specified Response header.
*
* If the name is null, the header won't have a name, and will contain only
* the value of the header.
*
* @param string $name The name of the header to set.
* @param string $value The value of the header.
*
* @return \Backend\Interfaces\ResponseInterface
*/
public function setHeader($name, $value);
/**
* Return the Response's headers
*
* @return array An array containing the Response's headers
*/
public function getHeaders();
/**
* Set the headers for the Response
*
* @param array $headers The new headers
*
* @return \Backend\Interfaces\ResponseInterface
*/
public function setHeaders(array $headers);
/**
* Return the Response's body
*
* @return mixed The Response's body
*/
public function getBody();
/**
* Set the body for the Response
*
* @param mixed $body The new body
*
* @return \Backend\Interfaces\ResponseInterface
*/
public function setBody($body);
/**
* Output the response to the client.
*
* @return null
*/
public function output();
}