AppLicenseChecker   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 2
1
<?php
2
3
namespace Irfa\AppLicenseClient\Middleware;
4
5
use Closure;
6
use Irfa\AppLicenseClient\Facades\AppLicenseClient as AppLicense;
7
8
class AppLicenseChecker
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param  \Illuminate\Http\Request  $request
14
     * @param  \Closure  $next
15
     * @return mixed
16
     */
17
    public function handle($request, Closure $next)
18
    {
19
        if(AppLicense::check()){
20
            return $next($request);
21
        }
22
        $license = AppLicense::get();
23
        return abort(503,$license->message);
0 ignored issues
show
Bug introduced by
Are you sure the usage of abort(503, $license->message) is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
24
25
    }
26
}
27