Skip to content

Commit 6d32a4c

Browse files
author
Greg Bowler
authored
feature: expose headers as public readonly property (#176)
1 parent ec7a74d commit 6d32a4c

File tree

5 files changed

+44
-36
lines changed

5 files changed

+44
-36
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,24 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1111

1212
- name: Cache Composer dependencies
13-
uses: actions/cache@v2
13+
uses: actions/cache@v3
1414
with:
1515
path: /tmp/composer-cache
1616
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
1717

18-
- uses: php-actions/composer@v5
18+
- name: Composer
19+
uses: php-actions/composer@v6
20+
with:
21+
php_version: '8.1'
1922

2023
- name: Archive build
2124
run: mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
2225

2326
- name: Upload build archive for test runners
24-
uses: actions/upload-artifact@v2
27+
uses: actions/upload-artifact@v3
2528
with:
2629
name: build-artifact
2730
path: /tmp/github-actions
@@ -31,7 +34,7 @@ jobs:
3134
needs: [composer]
3235

3336
steps:
34-
- uses: actions/download-artifact@v2
37+
- uses: actions/download-artifact@v3
3538
with:
3639
name: build-artifact
3740
path: /tmp/github-actions
@@ -42,7 +45,7 @@ jobs:
4245
- name: PHP Unit tests
4346
uses: php-actions/phpunit@v3
4447
with:
45-
php_version: 8.0
48+
php_version: '8.1'
4649
php_extensions: xdebug
4750
memory_limit: 256M
4851
configuration: test/phpunit/phpunit.xml
@@ -53,7 +56,7 @@ jobs:
5356
needs: [composer]
5457

5558
steps:
56-
- uses: actions/download-artifact@v2
59+
- uses: actions/download-artifact@v3
5760
with:
5861
name: build-artifact
5962
path: /tmp/github-actions
@@ -64,5 +67,6 @@ jobs:
6467
- name: PHP Static Analysis
6568
uses: php-actions/phpstan@v3
6669
with:
70+
php_version: '8.1'
6771
path: src/
6872
level: 6

.scrutinizer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
build:
22
environment:
3-
php: 8.0.0
3+
php: 8.1.0
44

55
nodes:
66
analysis:
@@ -29,4 +29,4 @@ checks:
2929
filter:
3030
excluded_paths:
3131
- test/*
32-
- vendor/*
32+
- vendor/*

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55

66
"require": {
7-
"php": ">=8.0",
7+
"php": ">=8.1",
88
"phpgt/input": "^v1",
99
"psr/http-message": "^v1.0.1",
1010
"willdurand/negotiation": "v3.1.0"

composer.lock

Lines changed: 27 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Message.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Psr\Http\Message\StreamInterface;
66

77
trait Message {
8-
protected Headers $headers;
8+
public readonly Headers $headers;
99
protected string $protocol;
1010
protected StreamInterface $stream;
1111

@@ -17,7 +17,7 @@ trait Message {
1717
* @return string HTTP protocol version.
1818
*/
1919
public function getProtocolVersion():string {
20-
if(strstr($this->protocol, "/")) {
20+
if(str_contains($this->protocol, "/")) {
2121
return substr(
2222
$this->protocol,
2323
strpos($this->protocol, "/") + 1
@@ -41,7 +41,7 @@ public function getProtocolVersion():string {
4141
* @return static
4242
* @throws InvalidProtocolHttpException
4343
*/
44-
public function withProtocolVersion($version) {
44+
public function withProtocolVersion($version):self {
4545
if(!is_numeric($version)) {
4646
throw new InvalidProtocolHttpException($version);
4747
}

0 commit comments

Comments
 (0)