Completed
Push — dev ( 55c06c...b6e84d )
by Darko
07:43
created

HorizonServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Providers;
4
5
use Laravel\Horizon\Horizon;
6
use Illuminate\Support\Facades\Gate;
7
use Laravel\Horizon\HorizonApplicationServiceProvider;
8
9
class HorizonServiceProvider extends HorizonApplicationServiceProvider
10
{
11
    /**
12
     * Bootstrap any application services.
13
     *
14
     * @return void
15
     */
16
    public function boot()
17
    {
18
        parent::boot();
19
20
        // Horizon::routeSmsNotificationsTo('15556667777');
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
21
        // Horizon::routeMailNotificationsTo('[email protected]');
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
22
        // Horizon::routeSlackNotificationsTo('slack-webhook-url', '#channel');
0 ignored issues
show
Unused Code Comprehensibility introduced by
64% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
23
    }
24
25
    /**
26
     * Register the Horizon gate.
27
     *
28
     * This gate determines who can access Horizon in non-local environments.
29
     *
30
     * @return void
31
     */
32
    protected function gate()
33
    {
34
        Gate::define('viewHorizon', function ($user) {
35
            return in_array($user->email, [
36
                config('nntmux.admin_email'),
37
            ], true);
38
        });
39
    }
40
41
    /**
42
     * Register any application services.
43
     *
44
     * @return void
45
     */
46
    public function register()
47
    {
48
        //
49
    }
50
}
51