From: Dan Brown Date: Mon, 28 Mar 2022 10:31:06 +0000 (+0100) Subject: PHPStan and StyleCI fixes X-Git-Tag: v22.03~1^2~4 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/078e8e7dc3ee80ac57474a9185bba2b460a740f0 PHPStan and StyleCI fixes - Updated PhpStan PHP version option to match project. - Applied StyleCI changes. - Updated static to self in WebhookFormatter, following static analysis guidance. - Fixed mis-matched header tags. --- diff --git a/app/Actions/WebhookFormatter.php b/app/Actions/WebhookFormatter.php index 5b64a747a..bd0b6853a 100644 --- a/app/Actions/WebhookFormatter.php +++ b/app/Actions/WebhookFormatter.php @@ -116,7 +116,7 @@ class WebhookFormatter public static function getDefault(string $event, Webhook $webhook, $detail, User $initiator, int $initiatedTime): self { - $instance = new static($event, $webhook, $detail, $initiator, $initiatedTime); + $instance = new self($event, $webhook, $detail, $initiator, $initiatedTime); $instance->addDefaultModelFormatters(); return $instance; diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 3d1c184cd..598058ef4 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -67,7 +67,7 @@ class SettingController extends Controller } // Clear logo image if requested - if ($category === 'customization' && $request->get('app_logo_reset', null)) { + if ($category === 'customization' && $request->get('app_logo_reset', null)) { $this->imageRepo->destroyByType('system'); setting()->remove('app-logo'); } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index f3aa47e12..ff184f7cd 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -9,7 +9,7 @@ parameters: # The level 8 is the highest level level: 1 - phpVersion: 70300 + phpVersion: 70400 bootstrapFiles: - bootstrap/phpstan.php diff --git a/resources/views/settings/customization.blade.php b/resources/views/settings/customization.blade.php index 5c6841be2..2bc3531d7 100644 --- a/resources/views/settings/customization.blade.php +++ b/resources/views/settings/customization.blade.php @@ -1,7 +1,7 @@ @extends('settings.layout') @section('card') -

{{ trans('settings.app_customization') }}

+

{{ trans('settings.app_customization') }}

{!! csrf_field() !!} diff --git a/resources/views/settings/registration.blade.php b/resources/views/settings/registration.blade.php index 721839b9b..e60704aeb 100644 --- a/resources/views/settings/registration.blade.php +++ b/resources/views/settings/registration.blade.php @@ -1,7 +1,7 @@ @extends('settings.layout') @section('card') -

{{ trans('settings.reg_settings') }}

+

{{ trans('settings.reg_settings') }}

{!! csrf_field() !!} diff --git a/tests/Settings/SettingsTest.php b/tests/Settings/SettingsTest.php index 5d8c36996..bef354dac 100644 --- a/tests/Settings/SettingsTest.php +++ b/tests/Settings/SettingsTest.php @@ -17,9 +17,9 @@ class SettingsTest extends TestCase { $this->asAdmin(); $categories = [ - 'features' => 'Features & Security', + 'features' => 'Features & Security', 'customization' => 'Customization', - 'registration' => 'Registration', + 'registration' => 'Registration', ]; foreach ($categories as $category => $title) { @@ -36,4 +36,4 @@ class SettingsTest extends TestCase $resp->assertStatus(404); $resp->assertSee('Page Not Found'); } -} \ No newline at end of file +}