HorizonServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 40%

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 15
ccs 2
cts 5
cp 0.4
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A registrationCondition() 0 3 1
A register() 0 3 1
1
<?php
2
3
namespace Modules\Horizon\Providers;
4
5
use Foundation\Contracts\ConditionalAutoRegistration;
6
use Illuminate\Support\ServiceProvider;
7
8
class HorizonServiceProvider extends ServiceProvider implements ConditionalAutoRegistration
9
{
10
    /**
11
     * Register any application services.
12
     *
13
     * @return void
14
     */
15
    public function register()
16
    {
17
        $this->app->register(\Laravel\Horizon\HorizonServiceProvider::class);
18
    }
19
20 43
    public function registrationCondition(): bool
21
    {
22 43
        return ! app()->environment('testing');
0 ignored issues
show
introduced by
The method environment() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
        return ! app()->/** @scrutinizer ignore-call */ environment('testing');
Loading history...
23
    }
24
}
25