Skip to content

Commit 945afed

Browse files
authored
Update variable names/cleanup
* Remove type prefix. e.g., `$s` for string
1 parent 983ea87 commit 945afed

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: src/Http.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Http
8383
*
8484
* @param int $status The "code" for the HTTP status.
8585
*
86-
* @return string|bool $status Returns the "HTTP status code" if found, FALSE otherwise.
86+
* @return string|bool $status The "HTTP status code" if found, FALSE otherwise.
8787
*/
8888
public static function getStatusCode(int $status): string|bool
8989
{
@@ -112,9 +112,9 @@ public static function setHeaders(string|array $headers): void
112112
throw new Exception('Headers were already sent.');
113113
}
114114

115-
// Loop elements and set header
116-
foreach ((array)$headers as $sHeader) {
117-
header((string)$sHeader);
115+
// Loop elements, cast type and set header
116+
foreach ((array)$headers as $header) {
117+
header((string)$header);
118118
}
119119
}
120120

@@ -137,13 +137,13 @@ public static function setHeadersByCode(int $code = StatusCode::OK): void
137137
/**
138138
* Set a HTTP Content Type.
139139
*
140-
* @param string $sType Example: "text/xml".
140+
* @param string $type The content type value. e.g., "text/xml".
141141
*
142142
* @throws Exception
143143
*/
144-
public static function setContentType(string $sType): void
144+
public static function setContentType(string $type): void
145145
{
146-
static::setHeaders('Content-Type: ' . $sType);
146+
static::setHeaders('Content-Type: ' . $type);
147147
}
148148

149149
/**
@@ -175,4 +175,4 @@ private static function isSent(): bool
175175
{
176176
return headers_sent();
177177
}
178-
}
178+
}

0 commit comments

Comments
 (0)