Skip to content

Commit 7d1c316

Browse files
committed
Maintenance: Updated larastan target level, fixed issues from tests
1 parent 318b486 commit 7d1c316

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

app/Access/Guards/ExternalBaseSessionGuard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ExternalBaseSessionGuard implements StatefulGuard
3030
/**
3131
* The user we last attempted to retrieve.
3232
*/
33-
protected Authenticatable $lastAttempted;
33+
protected Authenticatable|null $lastAttempted;
3434

3535
/**
3636
* The session used by the guard.

app/Console/Commands/UpdateUrlCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function handle(Connection $db): int
5252
'page_revisions' => ['html', 'text', 'markdown'],
5353
'images' => ['url'],
5454
'settings' => ['value'],
55-
'comments' => ['html', 'text'],
55+
'comments' => ['html'],
5656
];
5757

5858
foreach ($columnsToUpdateByTable as $table => $columns) {

app/Entities/Controllers/RecycleBinApiController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use BookStack\Entities\Models\Page;
1010
use BookStack\Entities\Repos\DeletionRepo;
1111
use BookStack\Http\ApiController;
12+
use Illuminate\Database\Eloquent\Builder;
1213
use Illuminate\Database\Eloquent\Relations\HasMany;
1314

1415
class RecycleBinApiController extends ApiController
@@ -69,7 +70,7 @@ public function destroy(DeletionRepo $deletionRepo, string $deletionId)
6970
/**
7071
* Load some related details for the deletion listing.
7172
*/
72-
protected function listFormatter(Deletion $deletion)
73+
protected function listFormatter(Deletion $deletion): void
7374
{
7475
$deletable = $deletion->deletable;
7576

@@ -89,9 +90,9 @@ protected function listFormatter(Deletion $deletion)
8990
}
9091

9192
/**
92-
* @param HasMany<Chapter|Page, Book|Chapter> $query
93+
* @param Builder<Chapter|Page> $query
9394
*/
94-
protected static function withTrashedQuery(HasMany $query): void
95+
protected static function withTrashedQuery(Builder $query): void
9596
{
9697
$query->withTrashed();
9798
}

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ parameters:
77
- app
88

99
# The level 8 is the highest level
10-
level: 2
10+
level: 3
1111

1212
phpVersion:
1313
min: 80200

tests/Entity/CommentStoreTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public function test_add_comment()
2727
'local_id' => 1,
2828
'entity_id' => $page->id,
2929
'entity_type' => Page::newModelInstance()->getMorphClass(),
30-
'text' => null,
3130
'parent_id' => 2,
3231
]);
3332

0 commit comments

Comments
 (0)