The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Events\LoanTableUpdated: $id, $relations, $class, $connection, $keyBy
Loading history...
18
19
/**
20
* Action to highlight
21
*
22
* @var string
23
*/
24
public $action;
25
26
/**
27
* Loan to highlight
28
*
29
* @var string
30
*/
31
public $loan;
32
33
/**
34
* Sender window
35
*
36
* @var string
37
*/
38
public $sender;
39
40
/**
41
* Create a new event instance.
42
*
43
* @param string $action
44
* @param Request $request
45
* @param Loan|null $loan
46
*/
47
public function __construct(string $action, Request $request, Loan $loan = null)
It seems like $loan ? $loan->toArray() : null can also be of type array. However, the property $loan is declared as type string. Maybe add an additional type check?
Our type inference engine has found a suspicous assignment of a value to a property.
This check raises an issue when a value that can be of a mixed type is assigned to
a property that is type hinted more strictly.
For example, imagine you have a variable $accountId that can either hold an
Id object or false (if there is no account id yet). Your code now assigns that
value to the id property of an instance of the Account class. This class
holds a proper account, so the id value must no longer be false.
Either this assignment is in error or a type check should be added for that assignment.
classId{public$id;publicfunction__construct($id){$this->id=$id;}}classAccount{/** @var Id $id */public$id;}$account_id=false;if(starsAreRight()){$account_id=newId(42);}$account=newAccount();if($accountinstanceofId){$account->id=$account_id;}
Loading history...
52
}
53
54
/**
55
* Get the channels the event should broadcast on.
56
*
57
* @return \Illuminate\Broadcasting\Channel|array
58
*/
59
public function broadcastOn()
60
{
61
$library = \Auth::user();
62
return new PrivateChannel('loans.' . $library->id);