Skip to content

Commit ea1d3fe

Browse files
Merge pull request #22 from aarondfrancis/update2
Modernize PHP codebase with strict typing
2 parents 2e1152a + d9f4e0a commit ea1d3fe

20 files changed

+90
-225
lines changed

.github/workflows/style.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Fix Code Styling
22

3-
on: [ push ]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- '*.x'
48

59
jobs:
610
lint:
@@ -18,7 +22,7 @@ jobs:
1822
- name: Setup PHP
1923
uses: shivammathur/setup-php@v2
2024
with:
21-
php-version: "8.4"
25+
php-version: 8.4
2226
extensions: json, dom, curl, libxml, mbstring
2327
coverage: none
2428

.github/workflows/tests.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,10 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
php: [ 8.1, 8.2, 8.3, 8.4 ]
20+
php: [ 8.2, 8.3, 8.4 ]
2121
laravel: [ '10.*', '11.*', '12.*' ]
2222
dependency-version: [ prefer-lowest, prefer-stable ]
2323

24-
exclude:
25-
- laravel: 11.*
26-
php: 8.1
27-
- laravel: 12.*
28-
php: 8.1
29-
3024
name: P${{ matrix.php }} / L${{ matrix.laravel }} / ${{ matrix.dependency-version }}
3125

3226
steps:

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 1.1.0 - 2025-11-27
4+
5+
### Added
6+
- PHP 8.4 support
7+
8+
### Changed
9+
- Default config now uses Vite instead of Laravel Mix (`vite.config.js`, `build/manifest.json`, `build/assets`)
10+
- Modernized codebase with strict PHP typing (return types, parameter types, property types)
11+
12+
### Removed
13+
- PHP 8.1 support (EOL November 2024)
14+
315
## 0.2.3 - 2022-02-15
416
- Added: Support for Laravel 9
517

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^8.1",
13+
"php": "^8.2",
1414
"illuminate/support": "^10.0|^11.0|^12.0",
1515
"illuminate/filesystem": "^10.0|^11.0|^12.0",
1616
"illuminate/console": "^10.0|^11.0|^12.0"

config/airdrop.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
// this makes the most sense and doesn't need to be changed.
7474
resource_path(),
7575

76-
// Any time the webpack.mix.js file is changed, it could affect the
76+
// Any time the vite.config.js file is changed, it could affect
7777
// the build steps, and therefore the built files.
78-
base_path('webpack.mix.js'),
78+
base_path('vite.config.js'),
7979

8080
// Depending on your package manager, you'll want to uncomment one
8181
// of the following lines. Whenever JS packages are updated or
@@ -120,14 +120,11 @@
120120
* Files or folders that should be included.
121121
*/
122122
'include' => [
123-
// The mix-manifest file tells Laravel how to get your versioned assets.
124-
public_path('mix-manifest.json'),
123+
// The Vite manifest file tells Laravel how to get your versioned assets.
124+
public_path('build/manifest.json'),
125125

126-
// Compiled CSS.
127-
public_path('css'),
128-
129-
// Compiled JS.
130-
public_path('js'),
126+
// Compiled assets from Vite.
127+
public_path('build/assets'),
131128
],
132129

133130
/*

src/AirdropServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class AirdropServiceProvider extends ServiceProvider
1717
{
18-
public function boot()
18+
public function boot(): void
1919
{
2020
if ($this->app->runningInConsole()) {
2121
$this->commands([
@@ -32,7 +32,7 @@ public function boot()
3232
], 'config');
3333
}
3434

35-
public function register()
35+
public function register(): void
3636
{
3737
$this->mergeConfigFrom(__DIR__ . '/../config/airdrop.php', 'airdrop');
3838
}

src/Commands/Debug.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
namespace AaronFrancis\Airdrop\Commands;
88

99
use AaronFrancis\Airdrop\HashGenerator;
10-
use Arr;
1110
use Illuminate\Console\Command;
11+
use Illuminate\Support\Arr;
1212

1313
class Debug extends Command
1414
{
1515
protected $signature = 'airdrop:debug {--trigger=}';
1616

1717
protected $description = 'Output the array of all triggers, or a specific trigger.';
1818

19-
public function handle()
19+
public function handle(): void
2020
{
2121
$output = HashGenerator::make()->asArray();
2222

src/Commands/Download.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Download extends Command
1717

1818
protected $description = 'Run as a part of your deploy pipeline *before* assets are built.';
1919

20-
public function handle()
20+
public function handle(): void
2121
{
2222
config([
2323
'airdrop.verbose' => $this->option('verbose')

src/Commands/Hash.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Hash extends Command
1515

1616
protected $description = 'Output the calculated hash.';
1717

18-
public function handle()
18+
public function handle(): void
1919
{
2020
$hash = HashGenerator::make()->generate();
2121

src/Commands/Install.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,8 @@
1212

1313
class Install extends Command
1414
{
15-
/**
16-
* The name and signature of the console command.
17-
*
18-
* @var string
19-
*/
2015
protected $signature = 'airdrop:install';
2116

22-
/**
23-
* The console command description.
24-
*
25-
* @var string
26-
*/
2717
protected $description = 'Install the Airdrop config file into your app.';
2818

2919
public function __construct()
@@ -35,10 +25,7 @@ public function __construct()
3525
}
3626
}
3727

38-
/**
39-
* @throws Exception
40-
*/
41-
public function handle()
28+
public function handle(): void
4229
{
4330
Artisan::call('vendor:publish', [
4431
'--provider' => AirdropServiceProvider::class

0 commit comments

Comments
 (0)