Skip to content

Commit 6fe770b

Browse files
authored
Update for v12 support (#2217)
* Update for v12 support * Add L12 Tests * Fix for PHPStan Run * update phpstan ignores * Restore larastan 2.x for pre-11
1 parent 3ecfb1d commit 6fe770b

File tree

7 files changed

+249
-36
lines changed

7 files changed

+249
-36
lines changed

.github/workflows/run-phpstan-pull.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
strategy:
1313
fail-fast: true
1414
matrix:
15-
os: [ubuntu-24.04]
16-
php: [8.3]
17-
laravel: [11]
15+
os: [ubuntu-latest]
16+
php: [8.4]
17+
laravel: [12]
1818
stability: [prefer-dist]
1919

2020
name: PHPStan - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
@@ -77,10 +77,10 @@ jobs:
7777

7878
- name: Update dependencies
7979
if: steps.composer-cache.outputs.cache-hit != 'true'
80-
run: composer update --${{ matrix.stability }} --no-interaction
80+
run: composer update --${{ matrix.stability }} --no-interaction -W
8181

8282
- name: Install PHPStan
83-
run: composer require larastan/larastan:^2.0 --no-interaction
83+
run: composer require larastan/larastan:^3.0 --no-interaction -W
8484

8585
- uses: actions/cache@v4
8686
with:

.github/workflows/run-phpstan.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
strategy:
1616
fail-fast: true
1717
matrix:
18-
os: [ubuntu-24.04]
19-
php: [8.3]
20-
laravel: [11]
18+
os: [ubuntu-latest]
19+
php: [8.4]
20+
laravel: [12]
2121
stability: [prefer-dist]
2222

2323
name: PHPStan - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
@@ -80,10 +80,10 @@ jobs:
8080

8181
- name: Update dependencies
8282
if: steps.composer-cache.outputs.cache-hit != 'true'
83-
run: composer update --${{ matrix.stability }} --no-interaction
83+
run: composer update --${{ matrix.stability }} --no-interaction -W
8484

8585
- name: Install PHPStan
86-
run: composer require larastan/larastan:^2.0 --dev --no-interaction
86+
run: composer require larastan/larastan:^3.0 --dev --no-interaction -W
8787

8888
- uses: actions/cache@v4
8989
with:

.github/workflows/run-tests-pull.yml

+84-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
max-parallel: 2
1515
matrix:
1616
os: [ubuntu-latest]
17-
php: [8.2, 8.3, 8.4]
17+
php: [8.2, 8.3]
1818
laravel: [10.*]
1919
stability: [prefer-dist]
2020

@@ -172,3 +172,86 @@ jobs:
172172

173173
- name: Run Visuals Tests
174174
run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage
175+
176+
test-laravel12:
177+
runs-on: ${{ matrix.os }}
178+
strategy:
179+
fail-fast: false
180+
max-parallel: 2
181+
matrix:
182+
os: [ubuntu-latest]
183+
php: [8.2, 8.3, 8.4]
184+
laravel: [12.*]
185+
stability: [prefer-dist]
186+
187+
name: PULL PHP-${{ matrix.php }} - Laravel-12
188+
env:
189+
extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }}
190+
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr
191+
192+
steps:
193+
- name: Checkout code
194+
uses: actions/checkout@v4
195+
196+
- name: Setup cache environment
197+
id: extcache
198+
uses: shivammathur/cache-extensions@v1
199+
with:
200+
php-version: ${{ matrix.php }}
201+
extensions: ${{ env.extensions }}
202+
key: ${{ env.extensionKey }}
203+
204+
- name: Cache extensions
205+
uses: actions/cache@v4
206+
with:
207+
path: ${{ steps.extcache.outputs.dir }}
208+
key: ${{ matrix.os }}-${{ steps.extcache.outputs.key }}
209+
restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }}
210+
211+
- name: Setup PHP
212+
uses: shivammathur/setup-php@v2
213+
with:
214+
php-version: ${{ matrix.php }}
215+
extensions: ${{ env.extensions }}
216+
tools: phpunit:latest
217+
ini-values: memory_limit=512M
218+
coverage: none
219+
env:
220+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
221+
222+
- name: Setup problem matchers for PHP
223+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
224+
225+
- name: Get composer cache directory
226+
id: composer-cache
227+
run: |
228+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
229+
230+
- uses: actions/cache@v4
231+
with:
232+
path: ${{ steps.composer-cache.outputs.dir }}
233+
key: ${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
234+
restore-keys: ${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }}-composer-
235+
236+
- name: Add token
237+
env:
238+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
239+
run: |
240+
composer config github-oauth.github.com $GITHUB_TOKEN
241+
242+
- name: Install dependencies
243+
if: steps.composer-cache.outputs.cache-hit != 'true'
244+
run: composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update
245+
246+
- name: Update dependencies
247+
if: steps.composer-cache.outputs.cache-hit != 'true'
248+
run: composer update --${{ matrix.stability }} --no-interaction
249+
250+
- name: Setup problem matchers for PHPUnit
251+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
252+
253+
- name: Run Unit Tests
254+
run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage
255+
256+
- name: Run Visuals Tests
257+
run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage

.github/workflows/run-tests.yml

+84-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
max-parallel: 2
1717
matrix:
1818
os: [ubuntu-24.04]
19-
php: [8.2, 8.3, 8.4]
19+
php: [8.2, 8.3]
2020
laravel: [10.*]
2121
stability: [prefer-dist]
2222

@@ -174,3 +174,86 @@ jobs:
174174

175175
- name: Run Visuals Tests
176176
run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage
177+
178+
test-laravel12:
179+
runs-on: ${{ matrix.os }}
180+
strategy:
181+
fail-fast: false
182+
max-parallel: 2
183+
matrix:
184+
os: [ubuntu-24.04]
185+
php: [8.2, 8.3, 8.4]
186+
laravel: [12.*]
187+
stability: [prefer-dist]
188+
189+
name: PHP-${{ matrix.php }} - Laravel-12
190+
env:
191+
extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}
192+
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr
193+
194+
steps:
195+
- name: Checkout code
196+
uses: actions/checkout@v4
197+
198+
- name: Setup cache environment
199+
id: extcache
200+
uses: shivammathur/cache-extensions@v1
201+
with:
202+
php-version: ${{ matrix.php }}
203+
extensions: ${{ env.extensions }}
204+
key: ${{ env.extensionKey }}
205+
206+
- name: Cache extensions
207+
uses: actions/cache@v4
208+
with:
209+
path: ${{ steps.extcache.outputs.dir }}
210+
key: ${{ matrix.os }}-${{ steps.extcache.outputs.key }}
211+
restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }}
212+
213+
- name: Setup PHP
214+
uses: shivammathur/setup-php@v2
215+
with:
216+
php-version: ${{ matrix.php }}
217+
extensions: ${{ env.extensions }}
218+
tools: phpunit:latest
219+
ini-values: memory_limit=512M
220+
coverage: none
221+
env:
222+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
223+
224+
- name: Setup problem matchers for PHP
225+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
226+
227+
- name: Get composer cache directory
228+
id: composer-cache
229+
run: |
230+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
231+
232+
- uses: actions/cache@v4
233+
with:
234+
path: ${{ steps.composer-cache.outputs.dir }}
235+
key: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
236+
restore-keys: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-
237+
238+
- name: Add token
239+
env:
240+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
241+
run: |
242+
composer config github-oauth.github.com $GITHUB_TOKEN
243+
244+
- name: Install dependencies
245+
if: steps.composer-cache.outputs.cache-hit != 'true'
246+
run: composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update
247+
248+
- name: Update dependencies
249+
if: steps.composer-cache.outputs.cache-hit != 'true'
250+
run: composer update --${{ matrix.stability }} --no-interaction
251+
252+
- name: Setup problem matchers for PHPUnit
253+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
254+
255+
- name: Run Unit Tests
256+
run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage
257+
258+
- name: Run Visuals Tests
259+
run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage

composer.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@
2323
}
2424
],
2525
"require": {
26-
"php": "^8.1|^8.2|^8.3",
26+
"php": "^8.1|^8.2|^8.3|^8.4",
2727
"blade-ui-kit/blade-heroicons": "^2.1",
28-
"illuminate/contracts": "^10.0|^11.0",
29-
"illuminate/support": "^10.0|^11.0",
28+
"illuminate/contracts": "^10.0|^11.0|^12.0",
29+
"illuminate/support": "^10.0|^11.0|^12.0",
3030
"livewire/livewire": "^3.0|dev-main"
3131
},
3232
"require-dev": {
3333
"ext-sqlite3": "*",
34-
"brianium/paratest": "^5.0|^6.0|^7.0|^8.0",
34+
"brianium/paratest": "^5.0|^6.0|^7.0|^8.0|^9.0",
35+
"larastan/larastan": "^2.6|^3.0",
3536
"laravel/pint": "^1.10",
3637
"monolog/monolog": "*",
37-
"nunomaduro/collision": "^6.0|^7.0|^8.0",
38-
"larastan/larastan": "^2.6",
39-
"orchestra/testbench": "^7.0|^8.0|^9.0",
40-
"phpunit/phpunit": "^9.0|^10.0|^11.0"
38+
"nunomaduro/collision": "^6.0|^7.0|^8.0|^9.0",
39+
"orchestra/testbench": "^7.0|^8.0|^9.0|^10.0",
40+
"phpunit/phpunit": "^9.0|^10.0|^11.0|^12.0"
4141
},
4242
"autoload": {
4343
"psr-4": {

phpstan-baseline.neon

+36-15
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,97 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Offset '1' on array\\<string, non\\-empty\\-array\\<int\\<0, max\\>, mixed\\>\\> in empty\\(\\) does not exist\\.$#"
4+
message: '#^Offset ''1'' on array\<string, non\-empty\-list\> in empty\(\) does not exist\.$#'
5+
identifier: empty.offset
56
count: 1
67
path: src/DataTableComponent.php
78

89
-
9-
message: "#^Offset '99' on array\\<string, non\\-empty\\-array\\<int\\<0, max\\>, mixed\\>\\> in isset\\(\\) does not exist\\.$#"
10+
message: '#^Offset ''99'' on array\<string, non\-empty\-list\> in isset\(\) does not exist\.$#'
11+
identifier: isset.offset
1012
count: 1
1113
path: src/DataTableComponent.php
1214

1315
-
14-
message: "#^Offset '99' on non\\-empty\\-array\\<1\\|string, array\\<int\\<0, max\\>, mixed\\>\\> in isset\\(\\) does not exist\\.$#"
16+
message: '#^Offset ''99'' on non\-empty\-array\<1\|string, list\> in isset\(\) does not exist\.$#'
17+
identifier: isset.offset
1518
count: 1
1619
path: src/DataTableComponent.php
1720

1821
-
19-
message: "#^Property Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:\\$joins \\(array\\) on left side of \\?\\? is not nullable\\.$#"
22+
message: '#^Parameter \#1 \$view of function view expects view\-string\|null, string given\.$#'
23+
identifier: argument.type
2024
count: 1
2125
path: src/DataTableComponent.php
2226

2327
-
24-
message: "#^Property Rappasoft\\\\LaravelLivewireTables\\\\DataTableComponent\\:\\:\\$model has no type specified\\.$#"
28+
message: '#^Property Rappasoft\\LaravelLivewireTables\\DataTableComponent\:\:\$model has no type specified\.$#'
29+
identifier: missingType.property
2530
count: 1
2631
path: src/DataTableComponent.php
2732

2833
-
29-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
34+
message: '#^Parameter \#1 \$view of function view expects view\-string\|null, string given\.$#'
35+
identifier: argument.type
36+
count: 1
37+
path: src/View/Components/FilterPill.php
38+
39+
-
40+
message: '#^Unsafe usage of new static\(\)\.$#'
41+
identifier: new.static
3042
count: 1
3143
path: src/Views/Action.php
3244

3345
-
34-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
46+
message: '#^Unsafe usage of new static\(\)\.$#'
47+
identifier: new.static
3548
count: 1
3649
path: src/Views/Column.php
3750

3851
-
39-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
52+
message: '#^Unsafe usage of new static\(\)\.$#'
53+
identifier: new.static
4054
count: 1
4155
path: src/Views/Filter.php
4256

4357
-
44-
message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\<int,string\\>\\:\\:filter\\(\\) expects \\(callable\\(string, int\\)\\: bool\\)\\|null, Closure\\(mixed\\)\\: int\\<0, max\\> given\\.$#"
58+
message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\<int,string\>\:\:filter\(\) expects \(callable\(string, int\)\: bool\)\|null, Closure\(mixed\)\: int\<0, max\> given\.$#'
59+
identifier: argument.type
4560
count: 1
4661
path: src/Views/Filters/MultiSelectDropdownFilter.php
4762

4863
-
49-
message: "#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:mapWithKeys\\(\\)$#"
64+
message: '#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#'
65+
identifier: argument.templateType
5066
count: 1
5167
path: src/Views/Filters/MultiSelectDropdownFilter.php
5268

5369
-
54-
message: "#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:mapWithKeys\\(\\)$#"
70+
message: '#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#'
71+
identifier: argument.templateType
5572
count: 1
5673
path: src/Views/Filters/MultiSelectDropdownFilter.php
5774

5875
-
59-
message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\<int,string\\>\\:\\:filter\\(\\) expects \\(callable\\(string, int\\)\\: bool\\)\\|null, Closure\\(mixed\\)\\: int\\<0, max\\> given\\.$#"
76+
message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\<int,string\>\:\:filter\(\) expects \(callable\(string, int\)\: bool\)\|null, Closure\(mixed\)\: int\<0, max\> given\.$#'
77+
identifier: argument.type
6078
count: 1
6179
path: src/Views/Filters/MultiSelectFilter.php
6280

6381
-
64-
message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\<int,string\\>\\:\\:filter\\(\\) expects \\(callable\\(string, int\\)\\: bool\\)\\|null, Closure\\(mixed\\)\\: int\\<0, max\\> given\\.$#"
82+
message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\<int,string\>\:\:filter\(\) expects \(callable\(string, int\)\: bool\)\|null, Closure\(mixed\)\: int\<0, max\> given\.$#'
83+
identifier: argument.type
6584
count: 1
6685
path: src/Views/Filters/NumberRangeFilter.php
6786

6887
-
69-
message: "#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:mapWithKeys\\(\\)$#"
88+
message: '#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#'
89+
identifier: argument.templateType
7090
count: 1
7191
path: src/Views/Filters/SelectFilter.php
7292

7393
-
74-
message: "#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:mapWithKeys\\(\\)$#"
94+
message: '#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#'
95+
identifier: argument.templateType
7596
count: 1
7697
path: src/Views/Filters/SelectFilter.php

0 commit comments

Comments
 (0)