Skip to content

Commit 19eb788

Browse files
authored
Upgrade http-message (#99)
* Upgrade http-message * Run composer install with different strategies * Fix composer cache in CI * Use composer flag to cache items * new latest checkout action * Run rector and code style check on min php version only
1 parent 8e26a7f commit 19eb788

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

.github/workflows/test.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,46 @@ on:
99
pull_request:
1010
branches:
1111
- master
12-
12+
env:
13+
PHP_MIN: 8.1
1314
jobs:
1415
run:
1516
runs-on: ubuntu-latest
1617
strategy:
1718
matrix:
18-
php-versions: ['8.1', '8.2', '8.3']
19-
name: PHP ${{ matrix.php-versions }}
19+
php-version: ['8.1', '8.2', '8.3']
20+
composer-flag: ['--prefer-lowest', '']
21+
name: PHP ${{ matrix.php-version }} ${{ matrix.composer-flag }}
2022
steps:
2123
- name: Checkout
22-
uses: actions/checkout@v2
24+
uses: actions/checkout@v4
2325

2426
- name: Setup PHP
2527
uses: shivammathur/setup-php@v2
2628
with:
27-
php-version: ${{ matrix.php-versions }}
29+
php-version: ${{ matrix.php-version }}
2830

2931
- name: Get Composer Cache Directory
3032
id: composer-cache
3133
run: |
32-
echo "::set-output name=dir::$(composer config cache-files-dir)"
33-
- uses: actions/cache@v2
34+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
35+
- uses: actions/cache@v3
3436
with:
3537
path: ${{ steps.composer-cache.outputs.dir }}
36-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
38+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.composer-flag }}
3739
restore-keys: |
3840
${{ runner.os }}-composer-
3941
40-
- name: Install dependencies
41-
run: composer install --prefer-dist --dev
42+
- name: Install dependencies ${{ matrix.composer-flag }}
43+
run: composer update --prefer-install=dist ${{ matrix.composer-flag }} --dev
4244

4345
- name: Run tests
4446
run: ./vendor/bin/phpunit
4547

4648
- name: Run rector
49+
if: matrix.php-version == env.PHP_MIN && matrix.composer-flag == ''
4750
run: ./vendor/bin/rector --dry-run
4851

4952
- name: Run code style check
53+
if: matrix.php-version == env.PHP_MIN && matrix.composer-flag == ''
5054
run: ./vendor/bin/ecs

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"ext-mbstring": "*",
2323
"guzzlehttp/guzzle": "^6.3 || ^7.3",
2424
"guzzlehttp/psr7": "^2.4.5",
25-
"psr/http-message": "^1.0",
25+
"psr/http-message": "^1.0 || ^2.0",
2626
"xparse/element-finder": "^2.0"
2727
},
2828
"require-dev": {

src/Helper/ToUtfConverter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ private function getSupportedEncodings(): array
4444
$this->supportedEncodings[] = $encoding;
4545
if ($findAliases) {
4646
foreach (mb_encoding_aliases($encoding) as $encodingAlias) {
47-
$encodingAlias = mb_strtolower($encodingAlias);
48-
$this->supportedEncodings[] = $encodingAlias;
47+
$this->supportedEncodings[] = mb_strtolower($encodingAlias);
4948
}
5049
}
5150
}

0 commit comments

Comments
 (0)