Skip to content

Commit b0587bd

Browse files
authored
Upgrade Laravel 12 (#23)
1 parent 4de1068 commit b0587bd

9 files changed

+83
-34
lines changed

.github/ISSUE_TEMPLATE/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ contact_links:
88
about: Share ideas for new features
99
- name: Report a bug
1010
url: https://github.com/leMaur/eloquent-publishing/issues/new
11-
about: Report a reproducable bug
11+
about: Report a reproducible bug

.github/workflows/phpstan.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
name: PHPStan
22

3-
on:
4-
push:
5-
paths:
6-
- '**.php'
7-
- 'phpstan.neon.dist'
3+
on: [push]
84

95
jobs:
106
phpstan:
11-
name: phpstan
127
runs-on: ubuntu-latest
8+
139
steps:
14-
- uses: actions/checkout@v4
10+
- name: Checkout code
11+
uses: actions/checkout@v4
1512

1613
- name: Setup PHP
1714
uses: shivammathur/setup-php@v2
1815
with:
19-
php-version: '8.1'
16+
php-version: '8.4'
17+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
2018
coverage: none
2119

2220
- name: Install composer dependencies
2321
uses: ramsey/composer-install@v3
2422

2523
- name: Run PHPStan
26-
run: ./vendor/bin/phpstan --error-format=github
24+
run: vendor/bin/phpstan --error-format=github

.github/workflows/fix-php-code-style-issues.yml .github/workflows/pint.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
name: Fix PHP code style issues
1+
name: Check & Fix code style
22

3-
on:
4-
push:
5-
paths:
6-
- '**.php'
3+
on: [push]
74

85
permissions:
96
contents: write
@@ -18,7 +15,7 @@ jobs:
1815
with:
1916
ref: ${{ github.head_ref }}
2017

21-
- name: Fix PHP code style issues
18+
- name: Fix code styling issues
2219
uses: aglipanci/laravel-pint-action@2.5
2320

2421
- name: Commit changes

.github/workflows/run-tests.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
php: [8.1, 8.2, 8.3]
13-
laravel: [10.*, 11.*]
12+
php: [8.1, 8.2, 8.3, 8.4]
13+
laravel: [10.*, 11.*, 12.*]
1414
stability: [prefer-lowest, prefer-stable]
1515
os: [ubuntu-latest]
1616
include:
1717
- laravel: 10.*
1818
testbench: 8.*
1919
- laravel: 11.*
2020
testbench: 9.*
21+
- laravel: 12.*
22+
testbench: 10.*
2123
exclude:
2224
- laravel: 11.*
2325
php: 8.1
26+
- laravel: 12.*
27+
php: 8.1
2428

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

@@ -32,9 +36,8 @@ jobs:
3236
uses: shivammathur/setup-php@v2
3337
with:
3438
php-version: ${{ matrix.php }}
35-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
36-
coverage: pcov
37-
tools: composer:v2
39+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
40+
coverage: none
3841

3942
- name: Get composer cache directory
4043
id: composer-cache
@@ -50,7 +53,7 @@ jobs:
5053
- name: Install dependencies
5154
run: |
5255
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
53-
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
56+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
5457
5558
- name: Execute tests
5659
run: vendor/bin/phpunit

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.idea
22
.php_cs
33
.php_cs.cache
4+
.phpunit.cache
45
.phpunit.result.cache
56
build
67
composer.lock

composer.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919
],
2020
"require": {
2121
"php": "^8.1",
22-
"illuminate/support": "^10.0 | ^11.0"
22+
"illuminate/support": "^10.0|^11.0|^12.0"
2323
},
2424
"require-dev": {
2525
"driftingly/rector-laravel": "^1.2",
2626
"laravel/pint": "^1.0",
27-
"nunomaduro/larastan": "^2.0.1",
28-
"orchestra/testbench": "^8.0 | ^9.0",
29-
"phpunit/phpunit": "^10.5.0",
27+
"orchestra/testbench": "^8.0|^9.0",
28+
"phpstan/phpstan-deprecation-rules": "^1.1.1|^2.0",
29+
"phpstan/phpstan-phpunit": "^1.3.3|^2.0",
30+
"phpunit/phpunit": "^10.5.0|^11.0|^12.0",
3031
"rector/rector": "^1.2",
3132
"roave/security-advisories": "dev-latest"
3233
},

phpstan-baseline.neon

+55
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,58 @@ parameters:
1919
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:getQualifiedPublishedAtColumn\\(\\)\\.$#"
2020
count: 9
2121
path: src/Database/Eloquent/PublishingScope.php
22+
23+
-
24+
message: "#^Method Lemaur\\\\Publishing\\\\Database\\\\Eloquent\\\\PublishingScope\\:\\:addLatestPlanned\\(\\) has parameter \\$builder with generic class Illuminate\\\\Database\\\\Eloquent\\\\Builder but does not specify its types\\: TModel$#"
25+
count: 1
26+
path: src/Database/Eloquent/PublishingScope.php
27+
28+
-
29+
message: "#^Method Lemaur\\\\Publishing\\\\Database\\\\Eloquent\\\\PublishingScope\\:\\:addLatestPublished\\(\\) has parameter \\$builder with generic class Illuminate\\\\Database\\\\Eloquent\\\\Builder but does not specify its types\\: TModel$#"
30+
count: 1
31+
path: src/Database/Eloquent/PublishingScope.php
32+
33+
-
34+
message: "#^Method Lemaur\\\\Publishing\\\\Database\\\\Eloquent\\\\PublishingScope\\:\\:addOldestPlanned\\(\\) has parameter \\$builder with generic class Illuminate\\\\Database\\\\Eloquent\\\\Builder but does not specify its types\\: TModel$#"
35+
count: 1
36+
path: src/Database/Eloquent/PublishingScope.php
37+
38+
-
39+
message: "#^Method Lemaur\\\\Publishing\\\\Database\\\\Eloquent\\\\PublishingScope\\:\\:addOldestPublished\\(\\) has parameter \\$builder with generic class Illuminate\\\\Database\\\\Eloquent\\\\Builder but does not specify its types\\: TModel$#"
40+
count: 1
41+
path: src/Database/Eloquent/PublishingScope.php
42+
43+
-
44+
message: "#^Method Lemaur\\\\Publishing\\\\Database\\\\Eloquent\\\\PublishingScope\\:\\:addOnlyPlanned\\(\\) has parameter \\$builder with generic class Illuminate\\\\Database\\\\Eloquent\\\\Builder but does not specify its types\\: TModel$#"
45+
count: 1
46+
path: src/Database/Eloquent/PublishingScope.php
47+
48+
-
49+
message: "#^Method Lemaur\\\\Publishing\\\\Database\\\\Eloquent\\\\PublishingScope\\:\\:addOnlyPlannedAndPublished\\(\\) has parameter \\$builder with generic class Illuminate\\\\Database\\\\Eloquent\\\\Builder but does not specify its types\\: TModel$#"
50+
count: 1
51+
path: src/Database/Eloquent/PublishingScope.php
52+
53+
-
54+
message: "#^Method Lemaur\\\\Publishing\\\\Database\\\\Eloquent\\\\PublishingScope\\:\\:addOnlyPublished\\(\\) has parameter \\$builder with generic class Illuminate\\\\Database\\\\Eloquent\\\\Builder but does not specify its types\\: TModel$#"
55+
count: 1
56+
path: src/Database/Eloquent/PublishingScope.php
57+
58+
-
59+
message: "#^Method Lemaur\\\\Publishing\\\\Database\\\\Eloquent\\\\PublishingScope\\:\\:addWithoutPlannedAndPublished\\(\\) has parameter \\$builder with generic class Illuminate\\\\Database\\\\Eloquent\\\\Builder but does not specify its types\\: TModel$#"
60+
count: 1
61+
path: src/Database/Eloquent/PublishingScope.php
62+
63+
-
64+
message: "#^Method Lemaur\\\\Publishing\\\\Database\\\\Eloquent\\\\PublishingScope\\:\\:apply\\(\\) has parameter \\$builder with generic class Illuminate\\\\Database\\\\Eloquent\\\\Builder but does not specify its types\\: TModel$#"
65+
count: 1
66+
path: src/Database/Eloquent/PublishingScope.php
67+
68+
-
69+
message: "#^Method Lemaur\\\\Publishing\\\\Database\\\\Eloquent\\\\PublishingScope\\:\\:extend\\(\\) has parameter \\$builder with generic class Illuminate\\\\Database\\\\Eloquent\\\\Builder but does not specify its types\\: TModel$#"
70+
count: 1
71+
path: src/Database/Eloquent/PublishingScope.php
72+
73+
-
74+
message: "#^Method Lemaur\\\\Publishing\\\\Database\\\\Eloquent\\\\PublishingScope\\:\\:getPublishedAtColumn\\(\\) has parameter \\$builder with generic class Illuminate\\\\Database\\\\Eloquent\\\\Builder but does not specify its types\\: TModel$#"
75+
count: 1
76+
path: src/Database/Eloquent/PublishingScope.php

phpstan.neon.dist

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
includes:
22
- phpstan-baseline.neon
3+
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
34

45
parameters:
5-
level: 4
6+
level: 8
67
paths:
78
- src
89
excludePaths:

phpunit.xml.dist

-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
<directory>tests</directory>
66
</testsuite>
77
</testsuites>
8-
<coverage>
9-
<report>
10-
<html outputDirectory="build/coverage"/>
11-
<text outputFile="build/coverage.txt"/>
12-
<clover outputFile="build/logs/clover.xml"/>
13-
</report>
14-
</coverage>
158
<logging>
169
<junit outputFile="build/report.junit.xml"/>
1710
</logging>

0 commit comments

Comments
 (0)