EventServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 16
c 1
b 0
f 0
dl 0
loc 39
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
1
<?php
2
3
namespace App\Providers;
4
5
use App\Events\AlbumInformationFetched;
6
use App\Events\ArtistInformationFetched;
7
use App\Events\LibraryChanged;
8
use App\Events\SongLikeToggled;
9
use App\Events\SongStartedPlaying;
10
use App\Listeners\ClearMediaCache;
11
use App\Listeners\DownloadAlbumCover;
12
use App\Listeners\DownloadArtistImage;
13
use App\Listeners\LoveTrackOnLastfm;
14
use App\Listeners\TidyLibrary;
15
use App\Listeners\UpdateLastfmNowPlaying;
16
use App\Models\Album;
17
use App\Models\Song;
18
use App\Observers\AlbumObserver;
19
use App\Observers\SongObserver;
20
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
21
22
class EventServiceProvider extends ServiceProvider
23
{
24
    /**
25
     * The event listener mappings for the application.
26
     *
27
     * @var array
28
     */
29
    protected $listen = [
30
        SongLikeToggled::class => [
31
            LoveTrackOnLastfm::class,
32
        ],
33
34
        SongStartedPlaying::class => [
35
            UpdateLastfmNowPlaying::class,
36
        ],
37
38
        LibraryChanged::class => [
39
            TidyLibrary::class,
40
            ClearMediaCache::class,
41
        ],
42
43
        AlbumInformationFetched::class => [
44
            DownloadAlbumCover::class,
45
        ],
46
47
        ArtistInformationFetched::class => [
48
            DownloadArtistImage::class,
49
        ],
50
    ];
51
52
    /**
53
     * Register any other events for your application.
54
     */
55 132
    public function boot()
56
    {
57 132
        parent::boot();
58
59 132
        Song::observe(SongObserver::class);
60 132
        Album::observe(AlbumObserver::class);
61 132
    }
62
}
63