Skip to content

Commit ac2ae37

Browse files
committed
PHPStan
1 parent 6baf1a1 commit ac2ae37

File tree

7 files changed

+35
-4
lines changed

7 files changed

+35
-4
lines changed

.github/workflows/phpstan.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: PHPStan
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
phpstan:
7+
name: PHP ${{ matrix.php-versions }} Tests
8+
runs-on: ${{ matrix.operating-system }}
9+
strategy:
10+
matrix:
11+
operating-system: ['ubuntu-latest']
12+
php-versions: ['8.3']
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: php-actions/composer@v6 # or alternative dependency management
17+
- uses: php-actions/phpstan@v3
18+
with:
19+
path: src/

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
phpstan:
3+
image: ghcr.io/phpstan/phpstan:1-php8.3
4+
volumes:
5+
- .:/app

phpstan.neon.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
level: 9
3+
paths:
4+
- src
5+
excludePaths:
6+
- vendor
7+
- test

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function (CurlHandle $curl, string $header): int {
139139
}
140140
$headerName = strtolower(trim($headerArray[0]));
141141
if (!str_contains($headerArray[1], ',')) {
142-
$this->responseHeaders[$headerName] = trim($headerArray[1]);
142+
$this->responseHeaders[$headerName] = [trim($headerArray[1])];
143143
return $len;
144144
}
145145
$this->responseHeaders[$headerName] = array_map(

src/Handler/RequestMutationHandlerCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class RequestMutationHandlerCollection implements Iterator
2424
private int $position = 0;
2525

2626
/**
27-
* @param Countable&Iterator<RequestMutationHandlerInterface>|array<RequestMutationHandlerInterface> $handlers
27+
* @param (Countable&Iterator<RequestMutationHandlerInterface>)|array<RequestMutationHandlerInterface> $handlers
2828
*/
2929
public function __construct((Countable&Iterator)|array $handlers)
3030
{

src/Handler/ResponseMutationHandlerCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ResponseMutationHandlerCollection implements Iterator
2424
private int $position = 0;
2525

2626
/**
27-
* @param Countable&Iterator<ResponseMutationHandlerInterface>|array<ResponseMutationHandlerInterface> $handlers
27+
* @param (Countable&Iterator<ResponseMutationHandlerInterface>)|array<ResponseMutationHandlerInterface> $handlers
2828
*/
2929
public function __construct((Countable&Iterator)|array $handlers)
3030
{

src/Handler/TransferHandlerCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TransferHandlerCollection implements Iterator
2424
private int $position = 0;
2525

2626
/**
27-
* @param Countable&Iterator<TransferHandlerInterface>|array<TransferHandlerInterface> $handlers
27+
* @param (Countable&Iterator<TransferHandlerInterface>)|array<TransferHandlerInterface> $handlers
2828
*/
2929
public function __construct((Countable&Iterator)|array $handlers)
3030
{

0 commit comments

Comments
 (0)