Completed
Push — master ( 07b006...66391b )
by Pulkit
03:51
created

Webhook::send()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 8
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
crap 2
1
<?php
2
namespace Kevincobain2000\LaravelAlertNotifications\Dispatcher;
3
4
use GuzzleHttp\Client;
5
6
class Webhook
7
{
8
    public static function send(string $url, array $body, $proxy, string $method = 'POST')
9
    {
10
        $client = new Client();
11
        $result = $client->request($method, $url, [
12
            'proxy' => $proxy,
13
            'body' => json_encode($body)
14
        ]);
15
        return $result;
16
    }
17
}
18