Passed
Push — master ( 42264c...07b006 )
by Pulkit
03:47
created

Webhook::send()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1.0046

Importance

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