Webhook::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Groove\Api;
4
5
use Groove\Api;
6
use Groove\Models\Webhook as Model;
7
8
class Webhook extends Api
9
{
10
    /**
11
     * Create a webhook.
12
     *
13
     * @param  string $event
14
     * @param  string $url
15
     * @return Model
16
     */
17
    public function create($event, $url)
18
    {
19
        $response = $this->client->post('webhooks', ['event' => $event, 'url' => $url]);
20
21
        return new Model($response->webhook, $this->client);
22
    }
23
}
24