GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Webhook   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 24
ccs 4
cts 6
cp 0.6667
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A Send() 0 4 1
1
<?php
2
namespace Datatrics\API\Modules;
3
4
use Datatrics\API\Client;
5
6
class Webhook extends Base
7
{
8
    /**
9
     * Private constructor so only the client can create this
10
     * @param Client $client
11
     */
12 16
    public function __construct($client)
13
    {
14 16
        parent::__construct($client);
15 16
        $this->setUrl("/project/" . $client->GetProjectId() . "/webhook");
16 16
    }
17
18
    /**
19
     * Trigger a Datatrics webhooke
20
     * @param string $channel   The webhook channel
21
     * @param string $type      The webhook type
22
     * @param array $webhook    The payload data
23
     * @return object Result of the request
24
     */
25
    public function Send($channel, $type, $webhook)
26
    {
27
        return $this->GetClient()->Post($this->getUrl()."/".$channel."/".$type, $webhook);
28
    }
29
}
30