@@ -75,13 +75,13 @@ class Http
75
75
/**
76
76
* Give the HTTP status code name (e.g. "204 No Content").
77
77
*
78
- * @param int $iStatus The "code" for the HTTP status.
78
+ * @param int $status The "code" for the HTTP status.
79
79
*
80
- * @return string|bool $iStatus Returns the "HTTP status code" if found, FALSE otherwise.
80
+ * @return string|bool $status Returns the "HTTP status code" if found, FALSE otherwise.
81
81
*/
82
- public static function getStatusCode (int $ iStatus ): string |bool
82
+ public static function getStatusCode (int $ status ): string |bool
83
83
{
84
- return !empty (static ::STATUS_CODE [$ iStatus ]) ? static ::STATUS_CODE [$ iStatus ] : false ;
84
+ return !empty (static ::STATUS_CODE [$ status ]) ? static ::STATUS_CODE [$ status ] : false ;
85
85
}
86
86
87
87
/**
@@ -95,37 +95,37 @@ public static function getHeadersList(): array
95
95
/**
96
96
* Set one or multiple headers.
97
97
*
98
- * @param string|array $mHeaders Headers to send.
98
+ * @param string|array $headers Headers to send.
99
99
*
100
100
* @throws Exception
101
101
*/
102
- public static function setHeaders (string |array $ mHeaders ): void
102
+ public static function setHeaders (string |array $ headers ): void
103
103
{
104
104
// Header already sent
105
105
if (static ::isSent ()) {
106
106
throw new Exception ('Headers were already sent. ' );
107
107
}
108
108
109
109
// Loop elements and set header
110
- foreach ((array )$ mHeaders as $ sHeader ) {
110
+ foreach ((array )$ headers as $ sHeader ) {
111
111
header ((string )$ sHeader );
112
112
}
113
113
}
114
114
115
115
/**
116
116
* Parse headers for a given status code.
117
117
*
118
- * @param int $iCode The code to use, possible values are: 200, 301, 302, 304, 307, 400, 401, 403, 404, 410, 500, 501, ...
118
+ * @param int $code The code to use, possible values are: 200, 301, 302, 304, 307, 400, 401, 403, 404, 410, 500, 501, ...
119
119
*
120
120
* @throws Exception
121
121
*/
122
- public static function setHeadersByCode (int $ iCode = StatusCode::OK ): void
122
+ public static function setHeadersByCode (int $ code = StatusCode::OK ): void
123
123
{
124
- if (!static ::getStatusCode ($ iCode )) {
125
- $ iCode = StatusCode::OK ;
124
+ if (!static ::getStatusCode ($ code )) {
125
+ $ code = StatusCode::OK ;
126
126
}
127
127
128
- static ::setHeaders (static ::getProtocol () . ' ' . static ::getStatusCode ($ iCode ));
128
+ static ::setHeaders (static ::getProtocol () . ' ' . static ::getStatusCode ($ code ));
129
129
}
130
130
131
131
/**
@@ -143,12 +143,12 @@ public static function setContentType(string $sType): void
143
143
/**
144
144
* Set the HTTP status code for the maintenance page.
145
145
*
146
- * @param int $iMaintenanceTime Time site will be down for (in seconds).
146
+ * @param int $maintenanceTimeSeconds Time site will be down for (in seconds).
147
147
*/
148
- public static function setMaintenanceCode (int $ iMaintenanceTime ): void
148
+ public static function setMaintenanceCode (int $ maintenanceTimeSeconds ): void
149
149
{
150
150
header (static ::getProtocol () . ' 503 Service Temporarily Unavailable ' );
151
- header ('Retry-After: ' . $ iMaintenanceTime );
151
+ header ('Retry-After: ' . $ maintenanceTimeSeconds );
152
152
}
153
153
154
154
0 commit comments