Skip to content

Commit

Permalink
feat: support Laravel 11
Browse files Browse the repository at this point in the history
* Bump dependencies for Laravel 11

* Update GitHub Actions for Laravel 11

* Test on PHP 8.3

* Bump allowed PHP CS Fixer config version

* fix broken tests

* drop laravel 9 support

* update cs-fixer

* migrate phpunit config

* use php 8.3 in cs fixer action

---------

Co-authored-by: Steve Bauman <[email protected]>
Co-authored-by: Kai Sassnowski <[email protected]>
  • Loading branch information
3 people authored Mar 25, 2024
1 parent 73cdd0f commit 410c0e1
Show file tree
Hide file tree
Showing 43 changed files with 4,224 additions and 2,412 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fix-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.3

- name: Install dependencies
run: composer install
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
name: run-tests

on: [push, pull_request]
on:
- push
- pull_request

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
php: [8.1, 8.2]
laravel: [9.*, 10.*]
php: [8.1, 8.2, 8.3]
laravel: [10.*, 11.*]
stability: [prefer-stable]
os: [ubuntu-latest]
include:
- laravel: 9.*
testbench: ^7.0
- laravel: 10.*
testbench: ^8.0
- laravel: 11.*
testbench: ^9.0
exclude:
- laravel: 11.*
php: 8.1

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

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vendor/
.phpunit.result.cache
.build/
.phpunit.cache/
45 changes: 25 additions & 20 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,32 @@
@see https://github.com/ksassnowski/venture
EOF;

$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php81($header), [
'php_unit_test_class_requires_covers' => false,
'php_unit_internal_class' => false,
'phpdoc_to_property_type' => false,
'error_suppression' => [
'noise_remaining_usages' => false,
],
'final_class' => false,
'final_public_method_for_abstract_class' => false,
'protected_to_private' => false,
'strict_comparison' => false,
'static_lambda' => false,
'class_attributes_separation' => [
'elements' => [
'const' => 'only_if_meta',
'method' => 'one',
'property' => 'one',
'trait_import' => 'none',
$ruleSet = Config\RuleSet\Php81::create()
->withRules(
Config\Rules::fromArray([
'php_unit_test_class_requires_covers' => false,
'php_unit_internal_class' => false,
'phpdoc_to_property_type' => false,
'error_suppression' => [
'noise_remaining_usages' => false,
],
],
]);
'final_class' => false,
'final_public_method_for_abstract_class' => false,
'protected_to_private' => false,
'strict_comparison' => false,
'static_lambda' => false,
'class_attributes_separation' => [
'elements' => [
'const' => 'only_if_meta',
'method' => 'one',
'property' => 'one',
'trait_import' => 'none',
],
],
]))
->withHeader($header);

$config = Config\Factory::fromRuleSet($ruleSet);

$config->getFinder()
->in([__DIR__.'/src', __DIR__.'/tests']);
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@
"require": {
"php": "^8.1",
"ext-json": "*",
"illuminate/bus": "^9.0 || ^10.0",
"illuminate/container": "^9.0 || ^10.0",
"illuminate/events": "^9.0 || ^10.0",
"illuminate/queue": "^9.0 || ^10.0",
"illuminate/support": "^9.0 || ^10.0",
"illuminate/bus": "^10.0 || ^11.0",
"illuminate/container": "^10.0 || ^11.0",
"illuminate/events": "^10.0 || ^11.0",
"illuminate/queue": "^10.0 || ^11.0",
"illuminate/support": "^10.0 || ^11.0",
"laravel/serializable-closure": "^1.2",
"ramsey/uuid": "^4.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.29",
"ergebnis/php-cs-fixer-config": "^5.2",
"ergebnis/php-cs-fixer-config": "^5.2 || ^6.0",
"lorisleiva/laravel-actions": "^2.5.1",
"mockery/mockery": "^1.5.1",
"nunomaduro/larastan": "^2.4",
"orchestra/testbench": "^7.0 || ^8.0",
"pestphp/pest": "^1.20",
"pestphp/pest-plugin-laravel": "^1.0",
"phpunit/phpunit": "^9.5.8",
"orchestra/testbench": "^8.0 || ^9.0",
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-laravel": "^2.3",
"phpunit/phpunit": "^10.5",
"roave/security-advisories": "dev-latest",
"spatie/laravel-ignition": "^1.6 || ^2.0"
"spatie/laravel-ignition": "^2.0"
},
"suggest": {
"lorisleiva/laravel-actions": "To use Laravel Actions as workflow jobs"
Expand Down
Loading

0 comments on commit 410c0e1

Please sign in to comment.