faithgen /
laravel-sdk
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace FaithGen\SDK\Http\Controllers; |
||||
| 4 | |||||
| 5 | use FaithGen\SDK\Events\Commenter\TypingRegistered; |
||||
| 6 | use FaithGen\SDK\Events\Commenter\UserPresent; |
||||
| 7 | use FaithGen\SDK\Http\Requests\PresenceRegistryRequest; |
||||
| 8 | use Illuminate\Routing\Controller; |
||||
| 9 | |||||
| 10 | class CommentController extends Controller |
||||
| 11 | { |
||||
| 12 | /** |
||||
| 13 | * Shows other users when one is joining or leaving the discussion. |
||||
| 14 | * |
||||
| 15 | * @param PresenceRegistryRequest $request |
||||
| 16 | */ |
||||
| 17 | public function presenceRegister(PresenceRegistryRequest $request) |
||||
| 18 | { |
||||
| 19 | if (! config('faithgen-sdk.source')) { |
||||
| 20 | event(new UserPresent(auth('web')->user(), $request->validated())); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 21 | } |
||||
| 22 | } |
||||
| 23 | |||||
| 24 | /** |
||||
| 25 | * Registers to other users when one is typing a comment. |
||||
| 26 | * |
||||
| 27 | * @param PresenceRegistryRequest $request |
||||
| 28 | */ |
||||
| 29 | public function showTyping(PresenceRegistryRequest $request) |
||||
| 30 | { |
||||
| 31 | if (! config('faithgen-sdk.source')) { |
||||
| 32 | event(new TypingRegistered(auth('web')->user(), $request->validated())); |
||||
|
0 ignored issues
–
show
It seems like
auth('web')->user() can also be of type null; however, parameter $user of FaithGen\SDK\Events\Comm...gistered::__construct() does only seem to accept FaithGen\SDK\Models\User, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 33 | } |
||||
| 34 | } |
||||
| 35 | } |
||||
| 36 |