WebhookEventsController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A all() 0 9 1
1
<?php
2
3
namespace Mpociot\CaptainHook\Http;
4
5
use Illuminate\Http\Request;
6
use Laravel\Spark\Http\Controllers\Controller;
7
8
class WebhookEventsController extends Controller
9
{
10
    /**
11
     * Create a new controller instance.
12
     *
13
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
14
     */
15
    public function __construct()
16
    {
17
        $this->middleware('auth');
18
    }
19
20
    /**
21
     * Get all of the available webhook events.
22
     *
23
     * @return Response
24
     */
25
    public function all(Request $request)
26
    {
27
        return collect(config('captain_hook.listeners', []))->transform(function ($key, $value) {
28
            return [
29
                'name' => $value,
30
                'event' => $key,
31
            ];
32
        })->values();
33
    }
34
}
35