Apply Pint 1.29 formatting

The Laravel 13 upgrade pulled Pint 1.27.1 to 1.29.3, which changed the
laravel preset's default rules. composer lint and the CI lint job fail
without this, so it is required rather than cosmetic.

Formatting only, applied by `vendor/bin/pint`. The rules that fired were
fully_qualified_strict_types, ordered_imports, single_blank_line_at_eof,
unary_operator_spaces, not_operator_with_successor_space, braces_position,
single_line_empty_body, single_line_after_imports and no_extra_blank_lines.

Kept separate from the upgrade commit to keep that diff reviewable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Andreas Reinhold / reini
2026-07-23 11:16:59 +02:00
co-authored by Claude Opus 4.8
parent 1ebd51248e
commit 9f929c7a78
29 changed files with 84 additions and 58 deletions
+3 -2
View File
@@ -2,6 +2,7 @@
namespace App\Concerns;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Validation\Rules\Password;
trait PasswordValidationRules
@@ -9,7 +10,7 @@ trait PasswordValidationRules
/**
* Get the validation rules used to validate passwords.
*
* @return array<int, \Illuminate\Contracts\Validation\Rule|array<mixed>|string>
* @return array<int, Rule|array<mixed>|string>
*/
protected function passwordRules(): array
{
@@ -19,7 +20,7 @@ trait PasswordValidationRules
/**
* Get the validation rules used to validate the current password.
*
* @return array<int, \Illuminate\Contracts\Validation\Rule|array<mixed>|string>
* @return array<int, Rule|array<mixed>|string>
*/
protected function currentPasswordRules(): array
{
+2 -1
View File
@@ -8,6 +8,7 @@ use App\Services\FileEncryptionService;
use App\Services\ShareService;
use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\HeaderUtils;
use Symfony\Component\HttpFoundation\StreamedResponse;
use ZipArchive;
@@ -71,7 +72,7 @@ class DownloadController extends Controller
$headers = [
'Content-Type' => $mimeType,
'Content-Disposition' => \Symfony\Component\HttpFoundation\HeaderUtils::makeDisposition(
'Content-Disposition' => HeaderUtils::makeDisposition(
'attachment',
$shareFile->original_name,
'download',
+1 -1
View File
@@ -11,7 +11,7 @@ class SecurityHeaders
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
* @param Closure(Request): (Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
+2 -1
View File
@@ -7,6 +7,7 @@ use App\Services\ShareService;
use Illuminate\Validation\ValidationException;
use Livewire\Attributes\Layout;
use Livewire\Component;
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
use Livewire\WithFileUploads;
#[Layout('layouts.app')]
@@ -14,7 +15,7 @@ class FileUploader extends Component
{
use WithFileUploads;
/** @var array<int, \Livewire\Features\SupportFileUploads\TemporaryUploadedFile> */
/** @var array<int, TemporaryUploadedFile> */
public array $files = [];
/** @var array<int, string|null> */
+2 -1
View File
@@ -3,6 +3,7 @@
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Database\Factories\UserFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
@@ -11,7 +12,7 @@ use Laravel\Fortify\TwoFactorAuthenticatable;
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
/** @use HasFactory<UserFactory> */
use HasFactory, Notifiable, TwoFactorAuthenticatable;
/**
+1 -1
View File
@@ -114,7 +114,7 @@ class ShareService
{
if ($share->isPasswordProtected()) {
if (! $password) {
throw new \RuntimeException('Password required for this share');
throw new RuntimeException('Password required for this share');
}
return bin2hex($this->encryptionService->deriveKey($password, $share->encryption_salt));
+5 -2
View File
@@ -1,6 +1,9 @@
<?php
use App\Providers\AppServiceProvider;
use App\Providers\FortifyServiceProvider;
return [
App\Providers\AppServiceProvider::class,
App\Providers\FortifyServiceProvider::class,
AppServiceProvider::class,
FortifyServiceProvider::class,
];
+3 -1
View File
@@ -1,5 +1,7 @@
<?php
use App\Models\User;
return [
/*
@@ -62,7 +64,7 @@ return [
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => env('AUTH_MODEL', App\Models\User::class),
'model' => env('AUTH_MODEL', User::class),
],
// 'users' => [
+3 -2
View File
@@ -1,6 +1,7 @@
<?php
use Illuminate\Support\Str;
use Pdo\Mysql;
return [
@@ -59,7 +60,7 @@ return [
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
(PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
(PHP_VERSION_ID >= 80500 ? Mysql::ATTR_SSL_CA : PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
@@ -79,7 +80,7 @@ return [
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
(PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
(PHP_VERSION_ID >= 80500 ? Mysql::ATTR_SSL_CA : PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
+2 -1
View File
@@ -2,12 +2,13 @@
namespace Database\Factories;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
* @extends Factory<User>
*/
class UserFactory extends Factory
{
+2 -1
View File
@@ -1,5 +1,6 @@
<?php
use App\Livewire\Admin\AdminDashboard;
use App\Models\Share;
use App\Models\ShareFile;
use App\Models\User;
@@ -52,7 +53,7 @@ test('admin can delete share', function () {
$shareId = $share->id;
Livewire::actingAs($admin)
->test(\App\Livewire\Admin\AdminDashboard::class)
->test(AdminDashboard::class)
->call('deleteShare', $shareId);
expect(Share::query()->find($shareId))->toBeNull();
+11 -9
View File
@@ -1,7 +1,9 @@
<?php
use App\Livewire\Admin\AdminSettings;
use App\Models\Setting;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Livewire\Livewire;
test('admin settings requires authentication', function () {
@@ -29,10 +31,10 @@ test('admin can access settings page', function () {
test('admin can save settings', function () {
$admin = User::query()->where('is_admin', true)->first();
$phpMaxMb = \App\Livewire\Admin\AdminSettings::phpMaxUploadMb();
$phpMaxMb = AdminSettings::phpMaxUploadMb();
Livewire::actingAs($admin)
->test(\App\Livewire\Admin\AdminSettings::class)
->test(AdminSettings::class)
->set('maxFileSize', min(200, $phpMaxMb))
->set('maxStorageQuota', 50)
->set('maxFilesPerShare', 100)
@@ -50,10 +52,10 @@ test('admin can save settings', function () {
test('admin can set system password', function () {
$admin = User::query()->where('is_admin', true)->first();
$phpMaxMb = \App\Livewire\Admin\AdminSettings::phpMaxUploadMb();
$phpMaxMb = AdminSettings::phpMaxUploadMb();
Livewire::actingAs($admin)
->test(\App\Livewire\Admin\AdminSettings::class)
->test(AdminSettings::class)
->set('maxFileSize', $phpMaxMb)
->set('systemPassword', 'new-system-password')
->call('saveSettings')
@@ -61,7 +63,7 @@ test('admin can set system password', function () {
$storedPassword = Setting::get('system_password');
expect($storedPassword)->not->toBeNull();
expect(\Illuminate\Support\Facades\Hash::check('new-system-password', $storedPassword))->toBeTrue();
expect(Hash::check('new-system-password', $storedPassword))->toBeTrue();
});
test('admin can clear system password', function () {
@@ -70,7 +72,7 @@ test('admin can clear system password', function () {
Setting::set('system_password', bcrypt('existing-password'));
Livewire::actingAs($admin)
->test(\App\Livewire\Admin\AdminSettings::class)
->test(AdminSettings::class)
->call('clearSystemPassword')
->assertHasNoErrors();
@@ -79,14 +81,14 @@ test('admin can clear system password', function () {
test('settings page loads existing values', function () {
$admin = User::query()->where('is_admin', true)->first();
$phpMaxMb = \App\Livewire\Admin\AdminSettings::phpMaxUploadMb();
$phpMaxMb = AdminSettings::phpMaxUploadMb();
$testSize = min(40, $phpMaxMb);
Setting::set('max_file_size', $testSize * 1024 * 1024);
Setting::set('max_files_per_share', 75);
Livewire::actingAs($admin)
->test(\App\Livewire\Admin\AdminSettings::class)
->test(AdminSettings::class)
->assertSet('maxFileSize', $testSize)
->assertSet('maxFilesPerShare', 75);
});
@@ -95,7 +97,7 @@ test('settings validation rejects invalid values', function () {
$admin = User::query()->where('is_admin', true)->first();
Livewire::actingAs($admin)
->test(\App\Livewire\Admin\AdminSettings::class)
->test(AdminSettings::class)
->set('maxFileSize', 0)
->set('maxStorageQuota', 0)
->call('saveSettings')
+1 -1
View File
@@ -66,4 +66,4 @@ test('users can logout', function () {
$response->assertRedirect(route('home'));
$this->assertGuest();
});
});
+1 -1
View File
@@ -64,4 +64,4 @@ test('already verified user visiting verification link is redirected without fir
expect($user->fresh()->hasVerifiedEmail())->toBeTrue();
Event::assertNotDispatched(Verified::class);
});
});
@@ -8,4 +8,4 @@ test('confirm password screen can be rendered', function () {
$response = $this->actingAs($user)->get(route('password.confirm'));
$response->assertOk();
});
});
+1 -1
View File
@@ -57,4 +57,4 @@ test('password can be reset with valid token', function () {
return true;
});
});
});
@@ -29,4 +29,4 @@ test('two factor challenge can be rendered', function () {
'email' => $user->email,
'password' => 'password',
])->assertRedirect(route('two-factor.login'));
});
});
+1 -1
View File
@@ -13,4 +13,4 @@ test('authenticated users can visit the dashboard', function () {
$response = $this->get(route('dashboard'));
$response->assertOk();
});
});
+10 -8
View File
@@ -1,5 +1,7 @@
<?php
use App\Livewire\FileUploader;
use App\Livewire\SystemPasswordPrompt;
use App\Models\Setting;
use App\Models\Share;
use Illuminate\Http\UploadedFile;
@@ -34,7 +36,7 @@ test('file upload creates share', function () {
$file = UploadedFile::fake()->create('document.pdf', 1024);
Livewire::test(\App\Livewire\FileUploader::class)
Livewire::test(FileUploader::class)
->set('files', [$file])
->call('createShare')
->assertRedirectContains('/share/');
@@ -51,7 +53,7 @@ test('file upload with password creates password-protected share', function () {
$file = UploadedFile::fake()->create('secret.txt', 512);
Livewire::test(\App\Livewire\FileUploader::class)
Livewire::test(FileUploader::class)
->set('files', [$file])
->set('usePassword', true)
->set('password', 'my-password')
@@ -67,7 +69,7 @@ test('file upload with expiration sets expires_at', function () {
$file = UploadedFile::fake()->create('file.txt', 256);
Livewire::test(\App\Livewire\FileUploader::class)
Livewire::test(FileUploader::class)
->set('files', [$file])
->set('expiration', '24h')
->call('createShare')
@@ -82,7 +84,7 @@ test('file upload with max downloads sets limit', function () {
$file = UploadedFile::fake()->create('file.txt', 256);
Livewire::test(\App\Livewire\FileUploader::class)
Livewire::test(FileUploader::class)
->set('files', [$file])
->set('maxDownloads', 5)
->call('createShare')
@@ -93,7 +95,7 @@ test('file upload with max downloads sets limit', function () {
});
test('file upload requires at least one file', function () {
Livewire::test(\App\Livewire\FileUploader::class)
Livewire::test(FileUploader::class)
->set('files', [])
->call('createShare')
->assertHasErrors(['files']);
@@ -106,7 +108,7 @@ test('file upload blocks when storage is full', function () {
$file = UploadedFile::fake()->create('file.txt', 1);
Livewire::test(\App\Livewire\FileUploader::class)
Livewire::test(FileUploader::class)
->set('files', [$file])
->call('createShare')
->assertHasErrors(['files']);
@@ -115,7 +117,7 @@ test('file upload blocks when storage is full', function () {
test('system password prompt verifies correct password', function () {
Setting::set('system_password', bcrypt('system-secret'));
Livewire::test(\App\Livewire\SystemPasswordPrompt::class)
Livewire::test(SystemPasswordPrompt::class)
->set('password', 'system-secret')
->call('verify')
->assertRedirect(route('upload'));
@@ -124,7 +126,7 @@ test('system password prompt verifies correct password', function () {
test('system password prompt rejects incorrect password', function () {
Setting::set('system_password', bcrypt('system-secret'));
Livewire::test(\App\Livewire\SystemPasswordPrompt::class)
Livewire::test(SystemPasswordPrompt::class)
->set('password', 'wrong')
->call('verify')
->assertHasErrors(['password']);
+3 -2
View File
@@ -1,5 +1,6 @@
<?php
use App\Livewire\Admin\AdminSettings;
use App\Livewire\FileUploader;
use App\Livewire\ShareDownload;
use App\Models\Share;
@@ -193,10 +194,10 @@ test('content disposition handles special characters in filename', function () {
test('svg upload is rejected for site logo', function () {
$admin = User::query()->where('is_admin', true)->first();
$phpMaxMb = \App\Livewire\Admin\AdminSettings::phpMaxUploadMb();
$phpMaxMb = AdminSettings::phpMaxUploadMb();
Livewire::actingAs($admin)
->test(\App\Livewire\Admin\AdminSettings::class)
->test(AdminSettings::class)
->set('maxFileSize', $phpMaxMb)
->set('siteLogo', UploadedFile::fake()->create('logo.svg', 100, 'image/svg+xml'))
->call('saveSettings')
@@ -36,4 +36,4 @@ test('correct password must be provided to update password', function () {
->call('updatePassword');
$response->assertHasErrors(['current_password']);
});
});
+1 -1
View File
@@ -72,4 +72,4 @@ test('correct password must be provided to delete account', function () {
$response->assertHasErrors(['password']);
expect($user->fresh())->not->toBeNull();
});
});
@@ -67,4 +67,4 @@ test('two factor authentication disabled when confirmation abandoned between req
'two_factor_secret' => null,
'two_factor_recovery_codes' => null,
]);
});
});
+4 -3
View File
@@ -1,5 +1,6 @@
<?php
use App\Livewire\SetupWizard;
use App\Models\User;
use Livewire\Livewire;
@@ -12,14 +13,14 @@ test('setup wizard renders when no admin exists', function () {
});
test('setup wizard redirects to upload when admin already exists', function () {
Livewire::test(\App\Livewire\SetupWizard::class)
Livewire::test(SetupWizard::class)
->assertRedirect(route('upload'));
});
test('setup wizard creates admin user', function () {
User::query()->where('is_admin', true)->delete();
Livewire::test(\App\Livewire\SetupWizard::class)
Livewire::test(SetupWizard::class)
->set('name', 'Admin User')
->set('email', 'admin@example.com')
->set('password', 'password123')
@@ -40,7 +41,7 @@ test('setup wizard creates admin user', function () {
test('setup wizard validates required fields', function () {
User::query()->where('is_admin', true)->delete();
Livewire::test(\App\Livewire\SetupWizard::class)
Livewire::test(SetupWizard::class)
->set('name', '')
->set('email', '')
->set('password', '')
+5 -4
View File
@@ -1,5 +1,6 @@
<?php
use App\Livewire\ShareDownload;
use App\Models\Share;
use App\Services\FileEncryptionService;
use App\Services\ShareService;
@@ -49,7 +50,7 @@ test('password verification works for protected share', function () {
$share = createShareWithFile('my-password');
Livewire::test(\App\Livewire\ShareDownload::class, ['share' => $share])
Livewire::test(ShareDownload::class, ['share' => $share])
->assertSet('authenticated', false)
->set('password', 'my-password')
->call('verifyPassword')
@@ -62,7 +63,7 @@ test('wrong password is rejected', function () {
$share = createShareWithFile('my-password');
Livewire::test(\App\Livewire\ShareDownload::class, ['share' => $share])
Livewire::test(ShareDownload::class, ['share' => $share])
->set('password', 'wrong-password')
->call('verifyPassword')
->assertSet('authenticated', false)
@@ -74,7 +75,7 @@ test('non-password share shows files directly', function () {
$share = createShareWithFile();
Livewire::test(\App\Livewire\ShareDownload::class, ['share' => $share])
Livewire::test(ShareDownload::class, ['share' => $share])
->assertSet('authenticated', true);
});
@@ -137,7 +138,7 @@ test('zip download produces a valid archive', function () {
$zipPath = $response->getFile()->getPathname();
$zip = new \ZipArchive;
$zip = new ZipArchive;
$result = $zip->open($zipPath);
expect($result)->toBe(true);
+7 -3
View File
@@ -1,5 +1,9 @@
<?php
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
/*
|--------------------------------------------------------------------------
| Test Case
@@ -11,11 +15,11 @@
|
*/
pest()->extend(Tests\TestCase::class)
->use(Illuminate\Foundation\Testing\RefreshDatabase::class)
pest()->extend(TestCase::class)
->use(RefreshDatabase::class)
->beforeEach(function () {
// EnsureSetupComplete middleware redirects to /setup unless an admin exists.
\App\Models\User::factory()->admin()->create(['email' => 'admin-setup@test.com']);
User::factory()->admin()->create(['email' => 'admin-setup@test.com']);
})
->in('Feature');
+1 -1
View File
@@ -2,4 +2,4 @@
test('that true is true', function () {
expect(true)->toBeTrue();
});
});
+2 -2
View File
@@ -1,6 +1,7 @@
<?php
use App\Services\FileEncryptionService;
use Symfony\Component\HttpFoundation\StreamedResponse;
beforeEach(function () {
$this->service = new FileEncryptionService;
@@ -119,7 +120,7 @@ test('decrypt file stream returns streamed response', function () {
$response = $this->service->decryptFileStream($encryptedPath, $key, 'test.txt', 'text/plain');
expect($response)->toBeInstanceOf(Symfony\Component\HttpFoundation\StreamedResponse::class);
expect($response)->toBeInstanceOf(StreamedResponse::class);
expect($response->headers->get('Content-Type'))->toBe('text/plain');
expect($response->headers->get('Content-Disposition'))->toContain('test.txt');
});
@@ -219,7 +220,6 @@ test('wrong key on chunked file throws exception', function () {
$this->service->decryptFile($encryptedPath, $wrongKey);
})->throws(RuntimeException::class, 'Decryption failed');
test('decrypt file stream with file size sets content-length header', function () {
$sourcePath = $this->tempDir.'/source.txt';
$encryptedPath = $this->tempDir.'/encrypted.enc';
+6 -3
View File
@@ -4,11 +4,14 @@ use App\Models\Setting;
use App\Models\Share;
use App\Models\ShareFile;
use App\Services\ShareService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Storage;
use Tests\TestCase;
pest()->extend(Tests\TestCase::class)
->use(Illuminate\Foundation\Testing\RefreshDatabase::class);
pest()->extend(TestCase::class)
->use(RefreshDatabase::class);
beforeEach(function () {
Storage::fake('shares');
@@ -42,7 +45,7 @@ test('create share with password does not store encryption key', function () {
expect($share->password)->not->toBeNull();
expect($share->encryption_key)->toBeNull();
expect(\Illuminate\Support\Facades\Hash::check('my-password', $share->password))->toBeTrue();
expect(Hash::check('my-password', $share->password))->toBeTrue();
});
test('create share with options sets expiration and max downloads', function () {