Webhook   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 8
c 2
b 1
f 0
dl 0
loc 40
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A url() 0 3 1
A context() 0 3 1
A type() 0 3 1
1
<?php
2
3
4
namespace SirSova\Webhooks;
5
6
class Webhook
7
{
8
9
    /**
10
     * @var Message
11
     */
12
    private $message;
13
    /**
14
     * @var string
15
     */
16
    private $url;
17
18
    public function __construct(Message $message, string $url)
19
    {
20
        $this->message = $message;
21
        $this->url = $url;
22
    }
23
24
    /**
25
     * @return array|\JsonSerializable
26
     */
27
    public function context()
28
    {
29
        return $this->message->context();
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function type(): string
36
    {
37
        return $this->message->type();
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function url(): string
44
    {
45
        return $this->url;
46
    }
47
}
48