Completed
Push — dev ( cb64be...f9231c )
by Marc
02:52
created

Booter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

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