]> BookStack Code Mirror - bookstack/commitdiff
PHPStan and StyleCI fixes
authorDan Brown <redacted>
Mon, 28 Mar 2022 10:31:06 +0000 (11:31 +0100)
committerDan Brown <redacted>
Mon, 28 Mar 2022 10:31:06 +0000 (11:31 +0100)
- 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.

app/Actions/WebhookFormatter.php
app/Http/Controllers/SettingController.php
phpstan.neon.dist
resources/views/settings/customization.blade.php
resources/views/settings/registration.blade.php
tests/Settings/SettingsTest.php

index 5b64a747ac21a827ea281bf16ca033048783af33..bd0b6853ab62ec6b475b3fca9a40688f7acc3740 100644 (file)
@@ -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;
index 3d1c184cdcebe0acac5ac0ad441b8ef9c00aeb0d..598058ef4822afd80a66a0e445e2bdc8ded2654d 100644 (file)
@@ -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');
         }
index f3aa47e12f3e06f8e39aa48c4c3bcac280106f84..ff184f7cd5de90a253e5b8ef5adc673df866fbed 100644 (file)
@@ -9,7 +9,7 @@ parameters:
     # The level 8 is the highest level
     level: 1
 
-    phpVersion: 70300
+    phpVersion: 70400
 
     bootstrapFiles:
       - bootstrap/phpstan.php
index 5c6841be2a07550a1f3b18258a5e582ed57dcd42..2bc3531d75c762ecb2c5c882d6c396348349b0a0 100644 (file)
@@ -1,7 +1,7 @@
 @extends('settings.layout')
 
 @section('card')
-    <h1 id="customization" class="list-heading">{{ trans('settings.app_customization') }}</h2>
+    <h1 id="customization" class="list-heading">{{ trans('settings.app_customization') }}</h1>
     <form action="{{ url("/settings/customization") }}" method="POST" enctype="multipart/form-data">
         {!! csrf_field() !!}
         <input type="hidden" name="section" value="customization">
index 721839b9be75c521ff0f51c33556475a42c47b09..e60704aeb3c6aee14b85046c9b77590323fd9b82 100644 (file)
@@ -1,7 +1,7 @@
 @extends('settings.layout')
 
 @section('card')
-    <h1 id="registration" class="list-heading">{{ trans('settings.reg_settings') }}</h2>
+    <h1 id="registration" class="list-heading">{{ trans('settings.reg_settings') }}</h1>
     <form action="{{ url("/settings/registration") }}" method="POST">
         {!! csrf_field() !!}
         <input type="hidden" name="section" value="registration">
index 5d8c36996c7fd0c09eeced990c6e5b803a74952e..bef354dacc79763d480c85d49e83ed06ac3a2bdb 100644 (file)
@@ -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
+}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.