WeChatUserAuthorized::broadcastOn()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Freyo\LaravelEntWechat\Events;
4
5
use EntWeChat\Support\Collection;
6
use Illuminate\Queue\SerializesModels;
7
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
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation 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.

Loading history...
22
     */
23
    public function __construct(Collection $user, $isNewSession = false)
24
    {
25
        $this->user = $user;
26
        $this->isNewSession = $isNewSession;
27
    }
28
29
    /**
30
     * Retrieve the authorized user.
31
     *
32
     * @return \EntWeChat\Support\Collection
33
     */
34
    public function getUser()
35
    {
36
        return $this->user;
37
    }
38
39
    /**
40
     * Check the user session is first created.
41
     *
42
     * @return bool
43
     */
44
    public function isNewSession()
45
    {
46
        return $this->isNewSession;
47
    }
48
49
    /**
50
     * Get the channels the event should be broadcast on.
51
     *
52
     * @return array
53
     */
54
    public function broadcastOn()
55
    {
56
        return [];
57
    }
58
}
59