WebhookEvent::getEvent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Fenerum\Webhooks\Events;
6
7
use Illuminate\Foundation\Events\Dispatchable;
8
use Illuminate\Queue\SerializesModels;
9
10
trait WebhookEvent
11
{
12
    use Dispatchable, SerializesModels;
13
14
    /** @var string */
15
    protected $event;
16
17
    /** @var array */
18
    protected $data;
19
20
    /**
21
     * WebhookEvent constructor.
22
     * @param string $event
23
     * @param array $data
24
     */
25
    public function __construct(string $event, array $data)
26
    {
27
        $this->event = $event;
28
        $this->data = $data;
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getEvent(): string
35
    {
36
        return $this->event;
37
    }
38
39
    /**
40
     * @return array
41
     */
42
    public function getData(): array
43
    {
44
        return $this->data;
45
    }
46
}
47