NewReply::__construct()   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
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PHPHub\Events;
4
5
use Illuminate\Queue\SerializesModels;
6
use PHPHub\Reply;
7
8
class NewReply extends Event
9
{
10
    use SerializesModels, ShouldNotifyTrait;
11
12
    /**
13
     * 设置生成的通知类型.
14
     *
15
     * @var string
16
     */
17
    protected $notification_type = 'new_reply';
18
19
    /**
20
     * Create a new event instance.
21
     *
22
     * @param Reply $reply
23
     * @param $from_user
24
     * @param $user_id
25
     */
26
    public function __construct(Reply $reply, $from_user, $user_id)
27
    {
28
        $this->setNotificationInfoFromReply($reply, $from_user, $user_id);
29
    }
30
}
31