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

WebhookController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 3 1
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
}