Skip to content

Commit 48cff13

Browse files
authored
[1.x] PHP 8.5 Compatibility (#148)
* [1.x] PHP 8.5 Compatibility Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> --------- Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent a8e80c8 commit 48cff13

File tree

4 files changed

+53
-8
lines changed

4 files changed

+53
-8
lines changed

.github/workflows/tests.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: true
2121
matrix:
22-
php: [8.1, 8.2, 8.3, 8.4]
22+
php: [8.1, 8.2, 8.3, 8.4, 8.5]
2323
laravel: [10, 11, 12]
2424
exclude:
2525
- php: 8.1
@@ -28,6 +28,10 @@ jobs:
2828
laravel: 12
2929
- php: 8.4
3030
laravel: 10
31+
- php: 8.5
32+
laravel: 10
33+
- php: 8.5
34+
laravel: 11
3135

3236
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
3337

@@ -52,12 +56,12 @@ jobs:
5256
run: vendor/bin/pest
5357

5458
windows_tests:
55-
runs-on: windows-2019
59+
runs-on: windows-2022
5660

5761
strategy:
5862
fail-fast: true
5963
matrix:
60-
php: [8.1, 8.2, 8.3, 8.4]
64+
php: [8.1, 8.2, 8.3, 8.4, 8.5]
6165
laravel: [10, 11, 12]
6266
exclude:
6367
- php: 8.1
@@ -66,6 +70,10 @@ jobs:
6670
laravel: 12
6771
- php: 8.4
6872
laravel: 10
73+
- php: 8.5
74+
laravel: 10
75+
- php: 8.5
76+
laravel: 11
6977

7078
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} Windows
7179

composer.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@
2525
},
2626
"require-dev": {
2727
"laravel/folio": "^1.1",
28-
"mockery/mockery": "^1.6",
29-
"orchestra/testbench": "^8.15.0|^9.0|^10.0",
30-
"pestphp/pest": "^2.9.5|^3.0",
28+
"orchestra/testbench": "^8.36|^9.15|^10.8",
29+
"pestphp/pest": "^2.9.5|^3.0|^4.0",
3130
"phpstan/phpstan": "^1.10"
3231
},
3332
"autoload": {
@@ -56,10 +55,13 @@
5655
}
5756
},
5857
"config": {
59-
"sort-packages": true,
6058
"allow-plugins": {
6159
"pestphp/pest-plugin": true
62-
}
60+
},
61+
"audit": {
62+
"block-insecure": false
63+
},
64+
"sort-packages": true
6365
},
6466
"scripts": {
6567
"post-autoload-dump": "@composer run prepare",

src/VoltServiceProvider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Support\ServiceProvider;
88
use Illuminate\Testing\TestResponse;
99
use Livewire\Livewire;
10+
use Livewire\LivewireManager as BaseLivewireManager;
1011
use Livewire\LivewireServiceProvider;
1112
use Livewire\Volt\Precompilers\ExtractFragments;
1213
use Livewire\Volt\Precompilers\ExtractTemplate;
@@ -61,8 +62,10 @@ protected function bindLivewireManager(): void
6162
{
6263
$this->app->singleton(LivewireManager::class);
6364
$this->app->alias(LivewireManager::class, 'livewire');
65+
$this->app->alias(LivewireManager::class, BaseLivewireManager::class);
6466

6567
Facade::clearResolvedInstance('livewire');
68+
Facade::clearResolvedInstance(BaseLivewireManager::class);
6669

6770
$this->app->get(LivewireManager::class)->setProvider(
6871
$this->app->getProvider(LivewireServiceProvider::class),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Livewire\Volt\Actions;
4+
use Livewire\Volt\CompileContext;
5+
use Livewire\Volt\Contracts\Compiled;
6+
use Livewire\Volt\Component;
7+
8+
new class extends Component implements Livewire\Volt\Contracts\FunctionalComponent
9+
{
10+
public static CompileContext $__context;
11+
12+
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
13+
14+
#[\Livewire\Attributes\Session()]
15+
public $tab;
16+
17+
public function mount()
18+
{
19+
(new Actions\InitializeState)->execute(static::$__context, $this, get_defined_vars());
20+
21+
(new Actions\CallHook('mount'))->execute(static::$__context, $this, get_defined_vars());
22+
}
23+
24+
#[\Livewire\Attributes\Computed()]
25+
public function tags()
26+
{
27+
$arguments = [static::$__context, $this, func_get_args()];
28+
29+
return (new Actions\CallMethod('tags'))->execute(...$arguments);
30+
}
31+
32+
};

0 commit comments

Comments
 (0)