EventServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 9 2
1
<?php
2
3
namespace PHPHub\Providers;
4
5
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
6
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
7
use PHPHub\Listeners\NotificationListener;
8
use PHPHub\Listeners\TopicListener;
9
10
class EventServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * The event listener mappings for the application.
14
     *
15
     * @var array
16
     */
17
    protected $listen = [
18
        'PHPHub\Events\SomeEvent' => [
19
            'PHPHub\Listeners\EventListener',
20
        ],
21
    ];
22
23
    /**
24
     * Register any other events for your application.
25
     *
26
     * @param \Illuminate\Contracts\Events\Dispatcher $events
27
     */
28
    public function boot(DispatcherContract $events)
29
    {
30
        parent::boot($events);
31
32
        if (! \Request::isMethod('GET')) {
33
            $events->subscribe(NotificationListener::class);
34
            $events->subscribe(TopicListener::class);
35
        }
36
    }
37
}
38