Skip to content

Commit

Permalink
Expand compatability with newer psr/log and psr/http-message versions (
Browse files Browse the repository at this point in the history
…#4)

Co-authored-by: Craig McMahon <[email protected]>
  • Loading branch information
craig-mcmahon and Craig McMahon authored Sep 2, 2024
1 parent 5bd88c4 commit ca97881
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ on: [push]

jobs:
build:
name: ${{matrix.operating-system}}, PHP ${{ matrix.php }}
name: PHP ${{ matrix.php }}, Mode ${{ matrix.mode }}

runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
operating-system: [ ubuntu-latest ]
php: ['8.1' ]
php: ['8.0', '8.3' ]
mode: ['stable', 'lowest']
exclude:
- php: '8.3'
mode: 'lowest'

steps:
- uses: actions/checkout@master
Expand All @@ -21,8 +25,13 @@ jobs:
with:
php-version: ${{ matrix.php }}

- name: Install dependencies
run: composer install
- name: Install dependencies in stable mode
if: matrix.mode == 'stable'
run: composer update --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install lowest supported dependencies in lowest mode
if: matrix.mode == 'lowest'
run: composer update --prefer-lowest --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run psalm
run: php vendor/bin/psalm
23 changes: 18 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ on: [push]

jobs:
build:
name: ${{matrix.operating-system}}, PHP ${{ matrix.php }}
name: PHP ${{ matrix.php }}, Mode ${{ matrix.mode }}

runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
operating-system: [ ubuntu-latest, ubuntu-20.04 ]
php: [ '8.0', '8.1' ]
operating-system: [ ubuntu-latest ]
php: [ '8.0', '8.1', '8.2', '8.3' ]
mode: ['stable', 'lowest']
exclude:
- php: '8.1'
mode: 'lowest'
- php: '8.2'
mode: 'lowest'
- php: '8.3'
mode: 'lowest'

steps:
- uses: actions/checkout@master
Expand All @@ -21,8 +29,13 @@ jobs:
with:
php-version: ${{ matrix.php }}

- name: Install dependencies
run: composer install
- name: Install dependencies in stable mode
if: matrix.mode == 'stable'
run: composer update --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install lowest supported dependencies in lowest mode
if: matrix.mode == 'lowest'
run: composer update --prefer-lowest --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests
run: php vendor/bin/codecept run
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"require": {
"php": ">=8.0",
"ext-json": "*",
"psr/http-message": "^1.0",
"psr/log": "^1.0"
"psr/http-message": "^1 | ^2",
"psr/log": "^1 | ^2 | ^3"
},
"require-dev": {
"nyholm/psr7": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/BreadcrumbLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct(
/**
* @inheritdoc
*/
public function log($level, $message, array $context = [])
public function log($level, $message, array $context = []): void
{
$this->breadcrumbs[] = new Breadcrumb(
$this->createTimestamp(),
Expand Down

0 comments on commit ca97881

Please sign in to comment.