Completed
Push — master ( f8221d...6a1ba8 )
by Vladimir
09:15
created

ChannelController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A webhook() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Controllers;
6
7
use Illuminate\Http\Request;
8
use FondBot\Channels\ChannelManager;
9
use FondBot\Foundation\RequestHandler;
10
11
class ChannelController
12
{
13
    private $manager;
14
15
    public function __construct(ChannelManager $manager)
16
    {
17
        $this->manager = $manager;
18
    }
19
20
    public function webhook($channel, RequestHandler $handler, Request $request)
21
    {
22
        if (is_string($channel)) {
23
            $channel = $this->manager->create($channel);
24
        }
25
26
        return $handler->handle($channel, $request);
27
    }
28
}
29