PolymorphicServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 2 1
1
<?php
2
3
namespace Yeelight\Providers;
4
5
use Illuminate\Database\Eloquent\Relations\Relation;
6
use Illuminate\Support\ServiceProvider;
7
use Yeelight\Models\Foundation\User;
8
9
/**
10
 * Class PolymorphicServiceProvider
11
 *
12
 * @category Yeelight
13
 *
14
 * @package Yeelight\Providers
15
 *
16
 * @author Sheldon Lee <[email protected]>
17
 *
18
 * @license https://opensource.org/licenses/MIT MIT
19
 *
20
 * @link https://www.yeelight.com
21
 */
22
class PolymorphicServiceProvider extends ServiceProvider
23
{
24
    /**
25
     * Bootstrap the application services.
26
     *
27
     * @return void
28
     */
29
    public function boot()
30
    {
31
        Relation::morphMap([
32
            User::MORPH_NAME => User::class,
33
            //'Comment' => Comment::class,
34
            //'Friend' => Friend::class,
35
        ]);
36
    }
37
38
    /**
39
     * Register the application services.
40
     *
41
     * @return void
42
     */
43
    public function register()
44
    {
45
        //
46
    }
47
}
48