Skip to content

Commit e24fa39

Browse files
committed
Merge branch 'main' of github.com:pH-7/php-http-header-response
2 parents 8df9bac + d43ca9e commit e24fa39

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PHP HTTP Response
1+
# PHP HTTP Response Headers
22

33
**Simple PHP package to easily send the right HTTP header responses to the browser 🐘**
44

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ph-7/php-http-response-header",
3-
"description": "A simple package to send HTTP header responses from your PHP application",
3+
"description": "A simple package to send HTTP response headers from your PHP application",
44
"keywords": [
55
"HTTP status code",
66
"status code",

phpunit.xml.dist

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" cacheDirectory=".phpunit.cache">
3-
<coverage/>
4-
<testsuites>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/|version|/phpunit.xsd"
5+
bootstrap="vendor/autoload.php"
6+
colors="true"
7+
cacheDirectory=".phpunit.cache">
8+
<testsuites>
59
<testsuite name="Unit Tests">
610
<directory>tests</directory>
711
</testsuite>

src/Http.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ public static function getHeadersList(): array
108108
*/
109109
public static function setHeaders(string|array $headers): void
110110
{
111-
// Header already sent
112-
if (static::isSent()) {
111+
if (static::areHeadersSent()) {
113112
throw new Exception('Headers were already sent.');
114113
}
115114

@@ -172,7 +171,7 @@ public static function getProtocol(): ?string
172171
*
173172
* @return bool TRUE if the headers were sent, FALSE if not.
174173
*/
175-
private static function isSent(): bool
174+
private static function areHeadersSent(): bool
176175
{
177176
return headers_sent();
178177
}

0 commit comments

Comments
 (0)