Skip to content

Commit 92bac2f

Browse files
committed
php85
1 parent 5d2e859 commit 92bac2f

File tree

6 files changed

+28
-32
lines changed

6 files changed

+28
-32
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@ on:
66
- cron: "0 0 * * *"
77

88
jobs:
9-
php82:
10-
name: PHP 8.2
9+
php83:
10+
name: PHP 8.3
1111
runs-on: ubuntu-24.04
1212
steps:
1313
- name: checkout
1414
uses: actions/checkout@v4
1515
- name: composer test
16-
uses: docker://ghcr.io/chubbyphp/ci-php82:latest
16+
uses: docker://ghcr.io/chubbyphp/ci-php83:latest
1717
env:
1818
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1919
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
20-
php83:
21-
name: PHP 8.3
20+
php84:
21+
name: PHP 8.4
2222
runs-on: ubuntu-24.04
2323
steps:
2424
- name: checkout
2525
uses: actions/checkout@v4
2626
- name: composer test
27-
uses: docker://ghcr.io/chubbyphp/ci-php83:latest
27+
uses: docker://ghcr.io/chubbyphp/ci-php84:latest
2828
env:
2929
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
31-
php84:
32-
name: PHP 8.4
31+
php85:
32+
name: PHP 8.5
3333
runs-on: ubuntu-24.04
3434
steps:
3535
- name: checkout
3636
uses: actions/checkout@v4
3737
- name: composer test
38-
uses: docker://ghcr.io/chubbyphp/ci-php84:latest
38+
uses: docker://ghcr.io/chubbyphp/ci-php85:latest
3939
env:
4040
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4141
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
$config = require __DIR__ . '/vendor/chubbyphp/chubbyphp-dev-helper/phpcs.php';
1414

1515
return (new PhpCsFixer\Config)
16+
->setUnsupportedPhpVersionAllowed(true)
1617
->setIndent($config['indent'])
1718
->setLineEnding($config['lineEnding'])
1819
->setRules($config['rules'])

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ A minimal static file middleware for PSR 15.
2626

2727
## Requirements
2828

29-
* php: ^8.2
30-
* [psr/http-factory][2]: ^1.0.2
29+
* php: ^8.3
30+
* [psr/http-factory][2]: ^1.1
3131
* [psr/http-message][3]: ^1.1|^2.0
3232
* [psr/http-server-handler][4]: ^1.0.2
3333
* [psr/http-server-middleware][5]: ^1.0.2
@@ -37,7 +37,7 @@ A minimal static file middleware for PSR 15.
3737
Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-static-file][1].
3838

3939
```sh
40-
composer require chubbyphp/chubbyphp-static-file "^1.4"
40+
composer require chubbyphp/chubbyphp-static-file "^1.5"
4141
```
4242

4343
## Usage

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
}
1515
],
1616
"require": {
17-
"php": "^8.2",
17+
"php": "^8.3",
1818
"psr/http-factory": "^1.1",
1919
"psr/http-message": "^1.1|^2.0",
2020
"psr/http-server-handler": "^1.0.2",
2121
"psr/http-server-middleware": "^1.0.2"
2222
},
2323
"require-dev": {
2424
"chubbyphp/chubbyphp-dev-helper": "dev-master",
25-
"chubbyphp/chubbyphp-mock": "^2.0",
26-
"infection/infection": "^0.29.12",
27-
"php-coveralls/php-coveralls": "^2.7.0",
25+
"chubbyphp/chubbyphp-mock": "^2.0.1",
26+
"infection/infection": "^0.31.9",
27+
"php-coveralls/php-coveralls": "^2.9",
2828
"phpstan/extension-installer": "^1.4.3",
29-
"phpstan/phpstan": "^2.1.6",
30-
"phpunit/phpunit": "^11.5.9"
29+
"phpstan/phpstan": "^2.1.32",
30+
"phpunit/phpunit": "^12.4.5"
3131
},
3232
"autoload": {
3333
"psr-4": { "Chubbyphp\\StaticFile\\": "src/" }
@@ -44,11 +44,11 @@
4444
},
4545
"extra": {
4646
"branch-alias": {
47-
"dev-master": "1.4-dev"
47+
"dev-master": "1.5-dev"
4848
}
4949
},
5050
"scripts": {
51-
"fix:cs": "mkdir -p build && PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --cache-file=build/phpcs.cache",
51+
"fix:cs": "mkdir -p build && vendor/bin/php-cs-fixer fix --cache-file=build/phpcs.cache",
5252
"test": [
5353
"@test:lint",
5454
"@test:unit",
@@ -57,7 +57,7 @@
5757
"@test:static-analysis",
5858
"@test:cs"
5959
],
60-
"test:cs": "mkdir -p build && PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --cache-file=build/phpcs.cache",
60+
"test:cs": "mkdir -p build && vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --cache-file=build/phpcs.cache",
6161
"test:infection": "vendor/bin/infection --threads=$(nproc) --min-msi=90 --verbose --coverage=build/phpunit",
6262
"test:integration": "vendor/bin/phpunit --testsuite=Integration --cache-directory=build/phpunit",
6363
"test:lint": "mkdir -p build && find src tests -name '*.php' -print0 | xargs -0 -n1 -P$(nproc) php -l | tee build/phplint.log",

src/StaticFileMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434
throw new \LogicException(\sprintf('Invalid or not supported hash algorithm: "%s"', $hashAlgorithm));
3535
}
3636
$this->hashAlgorithm = $hashAlgorithm;
37-
$this->mimetypes = $mimetypes ?? (array) require __DIR__.'/mimetypes.php';
37+
$this->mimetypes = $mimetypes ?? require __DIR__.'/mimetypes.php';
3838
}
3939

4040
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface

tests/Unit/StaticFileMiddlewareTest.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Chubbyphp\Mock\MockMethod\WithReturnSelf;
99
use Chubbyphp\Mock\MockObjectBuilder;
1010
use Chubbyphp\StaticFile\StaticFileMiddleware;
11+
use PHPUnit\Framework\Attributes\DataProvider;
1112
use PHPUnit\Framework\TestCase;
1213
use Psr\Http\Message\ResponseFactoryInterface;
1314
use Psr\Http\Message\ResponseInterface;
@@ -54,7 +55,7 @@ public function testIsNotReadable(): void
5455
self::assertSame($response, $middleware->process($request, $handler));
5556
}
5657

57-
public function testInvalidHashAlgorythm(): void
58+
public function testInvalidHashAlgorithm(): void
5859
{
5960
$this->expectException(\LogicException::class);
6061
$this->expectExceptionMessage('Invalid or not supported hash algorithm: "unknown"');
@@ -73,9 +74,7 @@ public function testInvalidHashAlgorythm(): void
7374
new StaticFileMiddleware($responseFactory, $streamFactory, $publicDirectory, $hashAlgorithm);
7475
}
7576

76-
/**
77-
* @dataProvider provideFiles
78-
*/
77+
#[DataProvider('provideFiles')]
7978
public function testIfMatch(string $body, string $contentLength, ?string $contentType, string $extension): void
8079
{
8180
$publicDirectory = sys_get_temp_dir();
@@ -126,9 +125,7 @@ public function testIfMatch(string $body, string $contentLength, ?string $conten
126125
self::assertSame($response, $middleware->process($request, $handler));
127126
}
128127

129-
/**
130-
* @dataProvider provideFiles
131-
*/
128+
#[DataProvider('provideFiles')]
132129
public function testIfMatchWithDefaultHashAlgorithm(
133130
string $body,
134131
string $contentLength,
@@ -182,9 +179,7 @@ public function testIfMatchWithDefaultHashAlgorithm(
182179
self::assertSame($response, $middleware->process($request, $handler));
183180
}
184181

185-
/**
186-
* @dataProvider provideFiles
187-
*/
182+
#[DataProvider('provideFiles')]
188183
public function testIfNoneMatch(string $body, string $contentLength, ?string $contentType, string $extension): void
189184
{
190185
$publicDirectory = sys_get_temp_dir();

0 commit comments

Comments
 (0)