Skip to content

Commit b04d765

Browse files
committed
#24 - updates preparing for 7.x support drop
1 parent d7f3128 commit b04d765

File tree

54 files changed

+1566
-1054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1566
-1054
lines changed

.github/workflows/php.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: PHP Tests
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "**" ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php-version: ['8.4', '8.3', '8.2', '8.1', '8.0']
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php-version }}
24+
extensions: mbstring, xml, json, xdebug, curl
25+
coverage: none
26+
tools: composer:v2
27+
28+
- name: Validate composer.json
29+
run: composer validate --strict
30+
31+
- name: Cache Composer packages
32+
id: composer-cache
33+
uses: actions/cache@v3
34+
with:
35+
path: vendor
36+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-php-${{ matrix.php-version }}-
39+
40+
- name: Install dependencies
41+
run: composer install --prefer-dist --no-progress
42+
43+
- name: Run test suite
44+
run: composer run-script test

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require_once 'vendor/autoload.php';
2424

2525
use MaciejSz\Nbp\Service\CurrencyAverageRatesService;
2626

27-
$currencyAverages = CurrencyAverageRatesService::new();
27+
$currencyAverages = CurrencyAverageRatesService::create();
2828
$rate = $currencyAverages->fromDay('2023-01-02')->fromTable('A')->getRate('USD');
2929

3030
printf('%s rate is %d', $rate->getCurrencyCode(), $rate->getValue());

composer.json

+19-7
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,29 @@
2828
}
2929
},
3030
"require": {
31-
"php": ">=7.2||>=8.0",
31+
"php": ">=8.0",
3232
"ext-json": "*"
3333
},
3434
"require-dev": {
35-
"guzzlehttp/guzzle": "^6.3",
35+
"guzzlehttp/guzzle": "^7.9",
3636
"phpunit/phpunit": "^9.6",
37-
"qossmic/deptrac-shim": "^1.0",
37+
"qossmic/deptrac": "^2.0",
3838
"friendsofphp/php-cs-fixer": "^3.16",
3939
"phpstan/phpstan": "^1.10",
40-
"symfony/http-client": "^6.2",
4140
"donatj/mock-webserver": "^2.6",
42-
"symfony/cache": "^6.2",
43-
"cache/integration-tests": "dev-master"
41+
"symfony/http-client": "^7.0",
42+
"symfony/cache": "^7.0"
4443
},
4544
"suggest": {
4645
"psr/cache": "Allows local cache",
47-
"symfony/http-foundation": "Symfony HTTP Transport layer"
46+
"symfony/http-client": "Symfony HTTP Transport layer"
47+
},
48+
"extra": {
49+
"symfony/cache-7": {
50+
"require": {
51+
"symfony/cache": "^7.0"
52+
}
53+
}
4854
},
4955
"scripts": {
5056
"test": "vendor/bin/phpunit -vv --testsuite unit,functional,integration",
@@ -59,6 +65,12 @@
5965
"pre-commit-checks": [
6066
"@analyse",
6167
"@test-all"
68+
],
69+
"post-install-cmd": [
70+
"@php php-version-deps-adjust.php"
71+
],
72+
"post-update-cmd": [
73+
"@php php-version-deps-adjust.php"
6274
]
6375
}
6476
}

0 commit comments

Comments
 (0)