Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(php): add support for PHP 8.4 #230

Open
wants to merge 14 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .github/workflows/latest.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/workflows/test-php8.2.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: "Tests"

# Triggers the workflow on push or pull request events
on:
push:
branches:
- stable
- develop
pull_request:
workflow_dispatch:

jobs:
test:
name: PHPUnit Tests
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version: [8.2, 8.3, 8.4]
laravel-version:
[
"9.*", # Test Laravel 9
"10.*", # Test Laravel 10
"11.*", # Test Laravel 11
]
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.laravel-version }}-${{matrix.php-version}}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-${{ matrix.laravel-version }}-${{matrix.php-version}}-composer-

- name: Lock laravel/framework version
env:
LARAVEL_VERSION: ${{ matrix.laravel-version }}
run: composer require laravel/framework:${{ matrix.laravel-version }} --no-update

- name: Vendor update
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer update --prefer-source --no-interaction

- name: Run test suites
run: composer run-script test

- name: Coveralls
if: matrix.laravel-version != '9.*'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: php vendor/bin/php-coveralls -v --coverage_clover=build/logs/clover.xml
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ demo/cache
.coveralls.yml export-ignore
phpstan.neon export-ignore
phpunit.xml export-ignore
composer.lock
build/
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
Easy to use package to identify the visitor's browser details and device type.
Magic is **not** involved the results are generated by multiple well tested and developed packages.

Supports **every Laravel** version between **4.0 » 10.x**;
Also tested on **every PHP** version between **5.6 » 8.2**.
Supports **every Laravel** version between **4.0 » 11.x**;
Also tested on **every PHP** version between **5.6 » 8.4**.

### How to install

Expand Down Expand Up @@ -92,14 +92,15 @@ Easy peasy, ain't it?
The following matrix has been continuously tested by the great and awesome **GitHub Actions**!

| ----- | Browser Detect 1.x | Browser Detect 2.x | Browser Detect 3.x | Browser Detect 4.x | Browser Detect 5.x |
| :----------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |
|:------------:| :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |
| Laravel 4.x | ✓ | ✓ | - | - | - |
| Laravel 5.x | - | ✓ | ✓ | - | - |
| Laravel 6.x | - | - | - | ✓ | - |
| Laravel 7.x | - | - | - | ✓ | - |
| Laravel 8.x | - | - | - | 4.4+ | - |
| Laravel 9.x | - | - | - | 4.4+ | ✓ |
| Laravel 10.x | - | - | - | - | ✓ |
| Laravel 11.x | - | - | - | - | ✓ |
| Standalone | - | - | - | 4.2+ | ✓ |

Since 2013 the package runs tests on every possible PHP / Laravel version matrix.
Expand Down
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@
"require": {
"php": "^8.1",
"ua-parser/uap-php": "~3.9",
"league/pipeline": "^1.0",
"mobiledetect/mobiledetectlib": "~4.0",
"jaybizzle/crawler-detect": "~1.2",
"mobiledetect/mobiledetectlib": "^4.0",
"jaybizzle/crawler-detect": "^1.2",
"matomo/device-detector": "^6.0"
},
"require-dev": {
"phpunit/phpunit": "~9.0 || ~10.0",
"orchestra/testbench": "~7.0 || ~8.0",
"php-coveralls/php-coveralls": "~2.0"
"phpunit/phpunit": "^9.0 || ^10.0 || ^11.0",
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0",
"php-coveralls/php-coveralls": "^2.0"
},
"autoload": {
"psr-4": {
Expand All @@ -56,6 +55,6 @@
},
"scripts": {
"test-dev": "phpunit",
"test": "phpunit --coverage-clover ./tests/logs/clover.xml"
"test": "phpunit --coverage-clover ./build/logs/clover.xml"
}
}
}
Loading