Skip to content

Commit e269bad

Browse files
committed
Modernize for PHP 8.2
- Bump minimum PHP version to 8.2 - Update CI workflows for PHP 8.2-8.4 - Update PHPStan target to PHP 8.2 - Update CodeSniffer ruleset to 8.2 - Fix code style issues - Update documentation
1 parent 7397579 commit e269bad

File tree

11 files changed

+30
-28
lines changed

11 files changed

+30
-28
lines changed

.docs/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This package is based on great [guzzle/psr7](https://github.com/guzzle/psr7) imp
99
- [Setup](#setup)
1010
- [Psr7Request](#psr7request)
1111
- [Psr7Response](#psr7response)
12+
- [Bridge](#bridge)
1213

1314
## Setup
1415

@@ -113,6 +114,18 @@ Additional methods (against PSR7 interface):
113114
- sendHeaders(): void
114115
- sendBody(): void
115116

117+
## Bridge
118+
119+
### `Psr7Response`
120+
121+
Nette Application response that wraps a PSR-7 `ResponseInterface`. Allows sending PSR-7 responses directly from Nette presenters.
122+
123+
```php
124+
use Contributte\Psr7\Bridge\Psr7Response;
125+
126+
$this->sendResponse(new Psr7Response($psr7));
127+
```
128+
116129
## API
117130

118131
**MessageInterface**

.github/workflows/codesniffer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
name: "Codesniffer"
1616
uses: contributte/.github/.github/workflows/codesniffer.yml@master
1717
with:
18-
php: "8.2"
18+
php: "8.3"

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
name: "Nette Tester"
1616
uses: contributte/.github/.github/workflows/nette-tester-coverage-v2.yml@master
1717
with:
18-
php: "8.2"
18+
php: "8.3"

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
name: "Phpstan"
1616
uses: contributte/.github/.github/workflows/phpstan.yml@master
1717
with:
18-
php: "8.2"
18+
php: "8.3"

.github/workflows/tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,33 @@ on:
55
workflow_dispatch:
66

77
push:
8-
branches: [ "*" ]
8+
branches: ["*"]
99

1010
schedule:
1111
- cron: "0 8 * * 1"
1212

1313
jobs:
14-
test83:
14+
test84:
1515
name: "Nette Tester"
1616
uses: contributte/.github/.github/workflows/nette-tester.yml@master
1717
with:
18-
php: "8.3"
18+
php: "8.4"
1919

20-
test82:
20+
test83:
2121
name: "Nette Tester"
2222
uses: contributte/.github/.github/workflows/nette-tester.yml@master
2323
with:
24-
php: "8.2"
24+
php: "8.3"
2525

26-
test81:
26+
test82:
2727
name: "Nette Tester"
2828
uses: contributte/.github/.github/workflows/nette-tester.yml@master
2929
with:
30-
php: "8.1"
30+
php: "8.2"
3131

3232
testlower:
3333
name: "Nette Tester"
3434
uses: contributte/.github/.github/workflows/nette-tester.yml@master
3535
with:
36-
php: "8.1"
36+
php: "8.2"
3737
composer: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable --prefer-lowest"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ For details on how to use this package, check out our [documentation](.docs).
3434

3535
| State | Version | Branch | Nette | PHP |
3636
|-------------|---------|----------|-------|---------|
37-
| dev | `^0.10` | `master` | 3.2+ | `>=8.1` |
38-
| stable | `^0.9` | `master` | 3.2+ | `>=8.1` |
37+
| dev | `^0.10` | `master` | 3.2+ | `>=8.2` |
38+
| stable | `^0.9` | `master` | 3.2+ | `>=8.2` |
3939

4040
## Development
4141

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
}
2020
],
2121
"require": {
22-
"php": ">=8.1",
22+
"php": ">=8.2",
2323
"guzzlehttp/psr7": "^2.6.1",
2424
"nette/utils": "^v4.0.2"
2525
},

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ includes:
33

44
parameters:
55
level: 9
6-
phpVersion: 80100
6+
phpVersion: 80200
77

88
scanDirectories:
99
- src

ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ruleset name="Contributte" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
33
<!-- Rulesets -->
4-
<rule ref="./vendor/contributte/qa/ruleset-8.0.xml"/>
4+
<rule ref="./vendor/contributte/qa/ruleset-8.2.xml"/>
55

66
<!-- Rules -->
77
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">

src/Extra/ExtraResponseTrait.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ public function getContents(bool $rewind = true): string
6464
return $this->getBody()->getContents();
6565
}
6666

67-
/*
68-
* HEADERS ****************************************************************
69-
*/
70-
7167
/**
7268
* @param string[]|string[][] $headers
7369
*/
@@ -81,10 +77,6 @@ public function withHeaders(array $headers): static
8177
return $new;
8278
}
8379

84-
/*
85-
* REDIRECT ***************************************************************
86-
*/
87-
8880
public function withRedirect(string $url, int $statusCode = 302): static
8981
{
9082
return $this

0 commit comments

Comments
 (0)