Booter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 1
cbo 3
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A beforeBooting() 0 6 3
1
<?php namespace Mascame\Artificer\Extension;
2
3
use Illuminate\Support\Str;
4
use Mascame\Extender\Booter\BooterInterface;
5
6
class Booter extends \Mascame\Extender\Booter\Booter implements BooterInterface {
7
8
    /**
9
     * @var \Mascame\Artificer\Extension\PluginManager
10
     */
11
    protected $manager;
12
13
    public function boot($instance, $name)
14
    {
15
        $this->beforeBooting($instance, $name);
16
17
        return parent::boot($instance, $name);
18
    }
19
20
    /**
21
     * @param $instance
22
     * @param $name
23
     */
24
    public function beforeBooting($instance, $name) {
25
        if (! $instance->namespace) $instance->namespace = $name;
26
        if (! $instance->slug) $instance->slug = Str::slug($name);
27
28
        $this->manager->setSlug($instance->slug, $instance->namespace);
29
    }
30
}
31