Skip to content

Commit

Permalink
Merge pull request #49 from openfoodfacts/0.4.x
Browse files Browse the repository at this point in the history
feat: Laravel 10.x & 11.x Compatibility
  • Loading branch information
epalmans authored May 1, 2024
2 parents 4acae0f + 88dc656 commit 5faacc0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.0, 8.1]
laravel: [9.*]
dependency-version: [prefer-lowest, prefer-stable]
php: [8.1, 8.2]
laravel: [11.*, 10.*, 9.*]
dependency-version: [prefer-stable]
include:
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
exclude:
- laravel: 11.*
php: 8.1
name: Tests - PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }}
steps:
- name: Checkout code
Expand All @@ -40,9 +47,9 @@ jobs:
- name: Install Composer dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit --verbose --coverage-clover ./build/coverage.clover
run: vendor/bin/phpunit --coverage-clover ./build/coverage.clover
- name: Uploading code coverage to scrutinize
uses: sudo-bot/action-scrutinizer@latest
with:
Expand Down
3 changes: 2 additions & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ checks:
fix_doc_comments: true

build:
image: default-bionic
environment:
php: 8.0.15
php: 8.1.2
nodes:
analysis:
tests:
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ This package provides a convenient wrapper to the [Open Food Facts API](https://

## Requirements

- PHP 8.0+
- Laravel 9.x

*Legacy support (PHP 7.2+ and Laravel 5.7-8.x) at [v0.2.x](https://github.com/openfoodfacts/openfoodfacts-laravel/tree/v0.2.2).*
- PHP 8.1+
- Laravel 9.x, 10.x, 11.x

## Installation

Expand All @@ -27,6 +25,12 @@ You can install the package via composer:
composer require openfoodfacts/openfoodfacts-laravel
```

#### Legacy support

- PHP 8.0 (Laravel <=9.x): `composer require "openfoodfacts/openfoodfacts-laravel:^0.3"`
- PHP 7.2-7.4.x (Laravel 5.7-8.x): `composer require "openfoodfacts/openfoodfacts-laravel:^0.2"`


## Usage

#### Find product details by barcode
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
}
],
"require": {
"php": "^8.0.2",
"guzzlehttp/guzzle": "^7.2",
"illuminate/support": "^9.0",
"openfoodfacts/openfoodfacts-php": "^0.2.4"
"php": "^8.1",
"guzzlehttp/guzzle": "^7.4",
"illuminate/support": "^9.0|^10.0|^11.0",
"openfoodfacts/openfoodfacts-php": "^0.3.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.6",
"orchestra/testbench": "^7.0",
"phpunit/phpunit": "^9.5.8"
"friendsofphp/php-cs-fixer": "^3.9.5",
"orchestra/testbench": "^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.5.21|^10.5"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 5faacc0

Please sign in to comment.