Completed
Push — dev ( 7f5445...3006be )
by Marc
02:44
created

AbstractExtension::boot()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 1
nc 1
1
<?php namespace Mascame\Artificer\Extension;
2
3
use Mascame\Artificer\Options\PluginOption;
4
use Stolz\Assets\Manager as AssetsManager;
5
6
abstract class AbstractExtension
7
{
8
9
    /**
10
     * Automatically filled
11
     *
12
     * Namespace will automatically be set if empty (will usually be the class itself).
13
     * Example: "Mascame\Artificer\Extension\Extension"
14
     *
15
     * @var string
16
     */
17
    public $namespace;
18
19
    /**
20
     * Automatically filled
21
     *
22
     * Which package is this part of.
23
     * Example: "mascame/artificer-widgets"
24
     *
25
     * @var string
26
     */
27
    public $package = null;
28
29
    /**
30
     * Automatically filled
31
     *
32
     * @var array
33
     */
34
    public $authors = [];
35
36
    /**
37
     * Automatically filled
38
     *
39
     * @var string
40
     */
41
    public $slug;
42
43
    /**
44
     * Name that will be shown on extensions page. Example: "My great extension"
45
     *
46
     * @var string
47
     */
48
    public $name = null;
49
50
    /**
51
     * @var string
52
     */
53
    public $description = 'No description provided';
54
55
    /**
56
     * @var string
57
     */
58
    public $thumbnail = null;
59
60
    /**
61
     * @var string
62
     */
63
    public $configFile = null;
64
65
    /**
66
     * @var PluginOption
67
     */
68
    protected $option;
69
70
    abstract public function boot();
71
72
    public function getSlug() {
73
        return $this->slug;
74
    }
75
    
76
    /**
77
     * @return Manager
78
     */
79
    abstract function getManager();
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
80
81
    /**
82
     * @return bool
83
     */
84
    public final function isInstalled()
85
    {
86
        return $this->getManager()->isInstalled($this->namespace);
87
    }
88
89
    /**
90
     * Plugins: Will output the assets when the extension is installed directly to the vendor
91
     * Widgets: Will output the assets when necessary
92
     *
93
     * Example: [ $this->assetsPath . 'css/my-style.css' ]
94
     *
95
     * @return array
96
     */
97
    public function assets(AssetsManager $manager)
0 ignored issues
show
Unused Code introduced by
The parameter $manager is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
98
    {
99
        return [];
100
    }
101
102
103
}