Completed
Push — master ( d7e260...fc7aea )
by Artem
10:19
created

WebhookController::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Slides\Connector\Auth\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
use Slides\Connector\Auth\Webhooks\Dispatcher;
7
8
/**
9
 * Class WebhookController
10
 *
11
 * @package Slides\Connector\Auth\Http\Controllers
12
 */
13
class WebhookController extends \Illuminate\Routing\Controller
14
{
15
    /**
16
     * The webhook dispatcher.
17
     *
18
     * @var Dispatcher
19
     */
20
    protected $dispatcher;
21
22
    /**
23
     * WebhookController constructor.
24
     *
25
     * @param Dispatcher $dispatcher
26
     */
27
    public function __construct(Dispatcher $dispatcher)
28
    {
29
        $this->dispatcher = $dispatcher;
30
    }
31
32
    /**
33
     * Handle the incoming webhook.
34
     *
35
     * @param string $key
36
     * @param Request $request
37
     */
38
    public function __invoke(string $key, Request $request)
39
    {
40
        $this->dispatcher->handle($key, $request->all());
41
    }
42
}