Skip to content

Commit a580314

Browse files
committed
Release v3.0.0
1 parent cec799b commit a580314

12 files changed

+107
-37
lines changed

.github/workflows/code-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: true
1616
matrix:
1717
os: [ ubuntu-latest ]
18-
php: [ 8.2 ]
18+
php: [ 8.3, 8.4 ]
1919
dependency-version: [ prefer-stable ]
2020

2121
name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: true
1616
matrix:
1717
os: [ ubuntu-latest ]
18-
php: [ 8.2 ]
18+
php: [ 8.3, 8.4 ]
1919
dependency-version: [ prefer-stable ]
2020

2121
name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

.github/workflows/phpunit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: true
1616
matrix:
1717
os: [ ubuntu-latest ]
18-
php: [ 8.0, 8.1, 8.2 ]
18+
php: [ 8.3, 8.4 ]
1919
dependency-version: [ prefer-lowest, prefer-stable ]
2020

2121
name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ This changelog is initialized in release 1.0.0
99

1010
## [Unreleased]
1111

12+
## [v3.0.0] - 2025-02-26
13+
14+
### Added
15+
* Laravel 12 support
16+
17+
### Changed
18+
* Update minimum required PHP version to 8.3
19+
20+
### Removed
21+
* Laravel 9 and 10 support
22+
1223
## [v2.1.0] - 2024-05-06
1324

1425
### Added

Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM php:8.4-cli-alpine
2+
3+
RUN apk add --no-cache --virtual .build-deps \
4+
$PHPIZE_DEPS \
5+
&& apk add --no-cache \
6+
shadow \
7+
&& pecl install \
8+
pcov \
9+
&& docker-php-ext-enable \
10+
pcov \
11+
&& apk del -f .build-deps \
12+
&& rm -rf /tmp/pear
13+
14+
ARG PUID=1000
15+
ENV PUID=${PUID}
16+
ARG PGID=1000
17+
ENV PGID=${PGID}
18+
19+
RUN groupmod -o -g ${PGID} nobody && \
20+
usermod -o -u ${PUID} -g nobody nobody && \
21+
apk del shadow
22+
23+
RUN curl -s https://getcomposer.org/installer | \
24+
php -- --install-dir=/usr/local/bin/ --filename=composer \
25+
&& mkdir /.composer \
26+
&& chown -R nobody:nobody /.composer
27+
28+
USER nobody
29+
30+
WORKDIR /var/www/html

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
app:
2+
@docker compose run --rm app sh
3+
4+
setup:
5+
@docker compose run --rm app composer install
6+
7+
phpstan:
8+
@docker compose run --rm app php ./vendor/phpstan/phpstan/phpstan analyse --memory-limit 1G
9+
10+
phpunit:
11+
@docker compose run --rm app php ./vendor/phpunit/phpunit/phpunit --no-coverage
12+
13+
coverage:
14+
@docker compose run --rm app php ./vendor/phpunit/phpunit/phpunit

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717
],
1818
"homepage": "https://github.com/wimski/laravel-psr-http",
1919
"require": {
20-
"php": "^8.0",
21-
"illuminate/support": "^9.0 || ^10.0 || ^11.0",
22-
"php-http/discovery": "^1.11",
20+
"php": "^8.3",
21+
"illuminate/support": "^11.0 || ^12.0",
22+
"php-http/discovery": "^1.20",
2323
"psr/http-client": "^1.0",
2424
"psr/http-factory": "^1.0",
2525
"psr/http-message": "^1.1 || ^2.0"
2626
},
2727
"require-dev": {
28-
"nunomaduro/larastan": "^2.0",
29-
"nyholm/psr7": "^1.0",
30-
"orchestra/testbench": "^7.0 || ^8.0",
28+
"larastan/larastan": "^3.0",
29+
"nyholm/psr7": "^1.8",
30+
"orchestra/testbench": "^9.0 || ^10.0",
3131
"php-http/guzzle7-adapter": "^1.0",
32-
"phpstan/phpstan-phpunit": "^1.0",
33-
"phpunit/phpunit": "^9.0"
32+
"phpstan/phpstan-phpunit": "^2.0",
33+
"phpunit/phpunit": "^11.0"
3434
},
3535
"minimum-stability": "stable",
3636
"autoload": {

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
app:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
volumes:
7+
- .:/var/www/html

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
includes:
2-
- vendor/nunomaduro/larastan/extension.neon
2+
- vendor/larastan/larastan/extension.neon
33
- vendor/phpstan/phpstan-phpunit/extension.neon
44
- vendor/phpstan/phpstan-phpunit/rules.neon
55

phpunit.xml.dist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
<directory>./tests</directory>
1010
</testsuite>
1111
</testsuites>
12-
<coverage processUncoveredFiles="true">
12+
<source>
1313
<include>
1414
<directory suffix=".php">./src</directory>
1515
</include>
16+
</source>
17+
<coverage>
1618
<report>
1719
<clover outputFile="build/logs/clover.xml"/>
1820
</report>

src/Providers/PsrHttpServiceProvider.php

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,50 +30,57 @@ public function register(): void
3030

3131
protected function registerClient(): void
3232
{
33-
$this->app->singleton(ClientInterface::class, function (): ClientInterface {
34-
return Psr18ClientDiscovery::find();
35-
});
33+
$this->app->singleton(
34+
ClientInterface::class,
35+
fn (): ClientInterface => Psr18ClientDiscovery::find(),
36+
);
3637
}
3738

3839
protected function registerUriFactory(): void
3940
{
40-
$this->app->singleton(UriFactoryInterface::class, function (): UriFactoryInterface {
41-
return Psr17FactoryDiscovery::findUriFactory();
42-
});
41+
$this->app->singleton(
42+
UriFactoryInterface::class,
43+
fn (): UriFactoryInterface => Psr17FactoryDiscovery::findUriFactory(),
44+
);
4345
}
4446

4547
protected function registerStreamFactory(): void
4648
{
47-
$this->app->singleton(StreamFactoryInterface::class, function (): StreamFactoryInterface {
48-
return Psr17FactoryDiscovery::findStreamFactory();
49-
});
49+
$this->app->singleton(
50+
StreamFactoryInterface::class,
51+
fn (): StreamFactoryInterface => Psr17FactoryDiscovery::findStreamFactory(),
52+
);
5053
}
5154

5255
protected function registerUploadedFileFactory(): void
5356
{
54-
$this->app->singleton(UploadedFileFactoryInterface::class, function (): UploadedFileFactoryInterface {
55-
return Psr17FactoryDiscovery::findUploadedFileFactory();
56-
});
57+
$this->app->singleton(
58+
UploadedFileFactoryInterface::class,
59+
fn (): UploadedFileFactoryInterface => Psr17FactoryDiscovery::findUploadedFileFactory(),
60+
);
5761
}
5862

5963
protected function registerRequestFactory(): void
6064
{
61-
$this->app->singleton(RequestFactoryInterface::class, function (): RequestFactoryInterface {
62-
return Psr17FactoryDiscovery::findRequestFactory();
63-
});
65+
$this->app->singleton(
66+
RequestFactoryInterface::class,
67+
fn (): RequestFactoryInterface => Psr17FactoryDiscovery::findRequestFactory(),
68+
);
6469
}
6570

6671
protected function registerServerRequestFactory(): void
6772
{
68-
$this->app->singleton(ServerRequestFactoryInterface::class, function (): ServerRequestFactoryInterface {
69-
return Psr17FactoryDiscovery::findServerRequestFactory();
70-
});
73+
$this->app->singleton(
74+
ServerRequestFactoryInterface::class,
75+
fn (): ServerRequestFactoryInterface => Psr17FactoryDiscovery::findServerRequestFactory(),
76+
);
7177
}
7278

7379
protected function registerResponseFactory(): void
7480
{
75-
$this->app->singleton(ResponseFactoryInterface::class, function (): ResponseFactoryInterface {
76-
return Psr17FactoryDiscovery::findResponseFactory();
77-
});
81+
$this->app->singleton(
82+
ResponseFactoryInterface::class,
83+
fn (): ResponseFactoryInterface => Psr17FactoryDiscovery::findResponseFactory(),
84+
);
7885
}
7986
}

tests/PsrHttpServiceProviderTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Wimski\LaravelPsrHttp\Tests;
66

77
use Orchestra\Testbench\TestCase;
8+
use PHPUnit\Framework\Attributes\Test;
89
use Psr\Http\Client\ClientInterface;
910
use Psr\Http\Message\RequestFactoryInterface;
1011
use Psr\Http\Message\ResponseFactoryInterface;
@@ -23,9 +24,7 @@ protected function getPackageProviders($app): array
2324
];
2425
}
2526

26-
/**
27-
* @test
28-
*/
27+
#[Test]
2928
public function it_registers_http_psr_services(): void
3029
{
3130
$client = $this->app?->make(ClientInterface::class);

0 commit comments

Comments
 (0)