Skip to content

Commit c6df37b

Browse files
committed
allow null in Auth::$user
1 parent 8e3333b commit c6df37b

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

phpstan-baseline.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ parameters:
258258
count: 5
259259
path: tests/table.test.php
260260

261+
-
262+
rawMessage: Cannot access offset 'user' on bool.
263+
identifier: offsetAccess.nonOffsetAccessible
264+
count: 3
265+
path: tests/table.test.php
266+
261267
-
262268
rawMessage: Function createUsersTable not found.
263269
identifier: function.notFound

phpstan.dist.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ includes:
33
- phpstan-baseline.neon
44

55
parameters:
6-
level: 2
6+
level: 3
77
paths:
88
- src
99
- tests

src/Auth.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class Auth
2222
{
2323
/**
2424
* The currently authenticated user
25-
* @var User
25+
* @var ?User
2626
*/
27-
protected $user;
27+
protected $user = null;
2828

2929
/**
3030
* Internal instance of Leaf DB

0 commit comments

Comments
 (0)