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

AbstractPlugin   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getManager() 0 3 1
A getRoutes() 0 3 1
A getMenu() 0 3 1
1
<?php namespace Mascame\Artificer\Plugin;
2
3
use App;
4
use Mascame\Artificer\Artificer;
5
use Mascame\Artificer\Extension\AbstractExtension;
6
7
abstract class AbstractPlugin extends AbstractExtension implements PluginInterface
8
{
9
10
    /**
11
     * @return \Mascame\Artificer\Extension\PluginManager
12
     */
13
    public function getManager() {
14
        return App::make('ArtificerPluginManager');
15
    }
16
17
    /**
18
     * Return your plugin routes.
19
     *
20
     * @return \Closure|null
21
     */
22
    public function getRoutes() {
23
        return null;
24
    }
25
26
    /**
27
     * Return your plugin menu entries.
28
     * 
29
     * @return array|null
30
     */
31
    public function getMenu() {
32
        return null;
33
    }
34
35
    // TODO: this should be done in boot! getting array from getMenu
36
//    public function addMenu($menu) {
37
//        if (! $this->isInstalled()) {
38
//            throw new \Exception('Artificer menus can\'t be added unless plugin is installed. Don\'t call this method in constructor.');
39
//        }
40
//
41
//        Artificer::addMenu($menu);
42
//    }
43
44
}