Skip to content

Commit

Permalink
Laravel 12.x Compatibility (#5)
Browse files Browse the repository at this point in the history
* Bump dependencies for Laravel 12

* Update GitHub Actions for Laravel 12

* Fix PR + remove support Laravel 9/10

---------

Co-authored-by: Tjardo <info@tjardo.com>
  • Loading branch information
laravel-shift and tjardoo authored Feb 19, 2025
1 parent 6baf69b commit d8eed40
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none

- name: Install composer dependencies
Expand Down
94 changes: 46 additions & 48 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,52 @@ name: Run tests

on:
push:
branches: [ master ]
branches:
- master
pull_request:
branches: [ master ]
branches:
- master

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.1, 8.2]
laravel: [9.*, 10.*, 11.*]
dependency-version: [prefer-stable]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 11.*
php: 8.1

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install 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
- name: Execute tests
run: vendor/bin/phpunit
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.2]
laravel: ['11.*', '12.*']
dependency-version: [prefer-stable]
include:
- laravel: 11.*
testbench: 9.*
- laravel: 12.*
testbench: 10.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install 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
- name: Execute tests
run: vendor/bin/phpunit
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ With ``laravel-hours-helper`` you can create an ``Illuminate\Support\Collection`

| Version | Release |
|---------|---------|
| 11.x | ^1.3 |
| 10.x | ^1.3 |
| 9.x | ^1.3 |
| 12.x | ^1.4 |
| 11.x | ^1.4 |

## Installation

Expand Down
48 changes: 24 additions & 24 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,40 @@
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Label84",
"email": "info@label84.com"
}
{
"name": "Label84",
"email": "info@label84.com"
}
],
"require": {
"php": "^8.0",
"illuminate/support": "^9.0|^10.0|^11.0"
"php": "^8.1",
"illuminate/support": "^11.0|^12.0"
},
"autoload": {
"psr-4": {
"Label84\\HoursHelper\\": "src"
}
"psr-4": {
"Label84\\HoursHelper\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Label84\\HoursHelper\\Tests\\": "tests"
}
"psr-4": {
"Label84\\HoursHelper\\Tests\\": "tests"
}
},
"extra": {
"laravel": {
"providers": [
"Label84\\HoursHelper\\HoursHelperServiceProvider"
],
"aliases": {
"HoursHelper": "Label84\\HoursHelper\\Facades\\HoursHelper"
}
}
"laravel": {
"providers": [
"Label84\\HoursHelper\\HoursHelperServiceProvider"
],
"aliases": {
"HoursHelper": "Label84\\HoursHelper\\Facades\\HoursHelper"
}
}
},
"require-dev": {
"orchestra/testbench": "^7.0|^8.0|^9.0",
"larastan/larastan": "^2.0",
"phpunit/phpunit": "^9.5|^10.5",
"laravel/pint": "^1.14"
"orchestra/testbench": "^9.0|^10.0",
"larastan/larastan": "^3.0",
"phpunit/phpunit": "^11.5",
"laravel/pint": "^1.21"
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
7 changes: 2 additions & 5 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ parameters:
level: 8

ignoreErrors:

excludes_analyse:

checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
- identifier: missingType.iterableValue
- identifier: missingType.generics

0 comments on commit d8eed40

Please sign in to comment.