]> BookStack Code Mirror - bookstack/commitdiff
Maintenance: Updated larastan target level, fixed issues from tests 5785/head
authorDan Brown <redacted>
Wed, 3 Sep 2025 14:42:50 +0000 (15:42 +0100)
committerDan Brown <redacted>
Wed, 3 Sep 2025 14:42:50 +0000 (15:42 +0100)
app/Access/Guards/ExternalBaseSessionGuard.php
app/Console/Commands/UpdateUrlCommand.php
app/Entities/Controllers/RecycleBinApiController.php
phpstan.neon.dist
tests/Entity/CommentStoreTest.php

index 899e93c3670f7ff76a209c5659d73cd6c44eca8f..91239599ba993c7467c710ecbf9f821fdf6d1f91 100644 (file)
@@ -30,7 +30,7 @@ class ExternalBaseSessionGuard implements StatefulGuard
     /**
      * The user we last attempted to retrieve.
      */
-    protected Authenticatable $lastAttempted;
+    protected Authenticatable|null $lastAttempted;
 
     /**
      * The session used by the guard.
index e155878d331b8a5f3661603dfa1994c4007e9e51..71f0b92fe4199e29a7992d0e632a640b593d2170 100644 (file)
@@ -52,7 +52,7 @@ class UpdateUrlCommand extends Command
             'page_revisions' => ['html', 'text', 'markdown'],
             'images'      => ['url'],
             'settings'    => ['value'],
-            'comments'    => ['html', 'text'],
+            'comments'    => ['html'],
         ];
 
         foreach ($columnsToUpdateByTable as $table => $columns) {
index fdc24ddf8e2a59924094f5448e49fe6067726beb..89bd3f41ad5dd5d33a705b62f39b3e4cfd7d806e 100644 (file)
@@ -9,6 +9,7 @@ use BookStack\Entities\Models\Deletion;
 use BookStack\Entities\Models\Page;
 use BookStack\Entities\Repos\DeletionRepo;
 use BookStack\Http\ApiController;
+use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Database\Eloquent\Relations\HasMany;
 
 class RecycleBinApiController extends ApiController
@@ -69,7 +70,7 @@ class RecycleBinApiController extends ApiController
     /**
      * Load some related details for the deletion listing.
      */
-    protected function listFormatter(Deletion $deletion)
+    protected function listFormatter(Deletion $deletion): void
     {
         $deletable = $deletion->deletable;
 
@@ -89,9 +90,9 @@ class RecycleBinApiController extends ApiController
     }
 
     /**
-     * @param HasMany<Chapter|Page, Book|Chapter> $query
+     * @param Builder<Chapter|Page> $query
      */
-    protected static function withTrashedQuery(HasMany $query): void
+    protected static function withTrashedQuery(Builder $query): void
     {
         $query->withTrashed();
     }
index 9dfd9d29e7c2c59b7000d1a48382d66a2ecc0d7e..72189222fcf415643eb26613f2afd559e8e1a64d 100644 (file)
@@ -7,7 +7,7 @@ parameters:
         - app
 
     # The level 8 is the highest level
-    level: 2
+    level: 3
 
     phpVersion:
         min: 80200
index c5fe4ce5064a600bbfa0fd427f780468e6482c8c..de093a3a6e94c242d8da68187659ebeb5afe1075 100644 (file)
@@ -27,7 +27,6 @@ class CommentStoreTest extends TestCase
             'local_id'    => 1,
             'entity_id'   => $page->id,
             'entity_type' => Page::newModelInstance()->getMorphClass(),
-            'text'        => null,
             'parent_id'   => 2,
         ]);