| 1 | <?php |
||
| 8 | class WeChatUserAuthorized |
||
| 9 | { |
||
| 10 | use SerializesModels; |
||
| 11 | |||
| 12 | public $user; |
||
| 13 | public $isNewSession; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Create a new event instance. |
||
| 17 | * |
||
| 18 | * @param \EntWeChat\Support\Collection $user |
||
| 19 | * @param bool $isNewSession |
||
| 20 | * |
||
| 21 | * @return void |
||
|
|
|||
| 22 | */ |
||
| 23 | public function __construct(Collection $user, $isNewSession = false) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Retrieve the authorized user. |
||
| 31 | * |
||
| 32 | * @return \EntWeChat\Support\Collection |
||
| 33 | */ |
||
| 34 | public function getUser() |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Check the user session is first created. |
||
| 41 | * |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | public function isNewSession() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Get the channels the event should be broadcast on. |
||
| 51 | * |
||
| 52 | * @return array |
||
| 53 | */ |
||
| 54 | public function broadcastOn() |
||
| 58 | } |
||
| 59 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.