FetchChannelController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 10 2
1
<?php
2
3
namespace BeyondCode\LaravelWebSockets\HttpApi\Controllers;
4
5
use Illuminate\Http\Request;
6
use Symfony\Component\HttpKernel\Exception\HttpException;
7
8
class FetchChannelController extends Controller
9
{
10
    public function __invoke(Request $request)
11
    {
12
        $channel = $this->channelManager->find($request->appId, $request->channelName);
13
14
        if (is_null($channel)) {
15
            throw new HttpException(404, "Unknown channel `{$request->channelName}`.");
16
        }
17
18
        return $channel->toArray();
19
    }
20
}
21