SubscribersConfigured   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of Gitamin.
5
 *
6
 * Copyright (C) 2015-2016 The Gitamin Team
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Gitamin\Http\Middleware;
13
14
use Closure;
15
use Illuminate\Support\Facades\Redirect;
16
17
class SubscribersConfigured
18
{
19
    /**
20
     * We're verifying that subscribers is both enabled and configured.
21
     *
22
     * @param \Illuminate\Http\Request $request
23
     * @param \Closure                 $next
24
     *
25
     * @return mixed
26
     */
27
    public function handle($request, Closure $next)
28
    {
29
        if (! subscribers_enabled()) {
30
            return Redirect::route('explore');
31
        }
32
33
        return $next($request);
34
    }
35
}
36