| 1 | <?php namespace Mascame\Artificer\Extension; |
||
| 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() { |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @return Manager |
||
| 78 | */ |
||
| 79 | abstract function getManager(); |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @return bool |
||
| 83 | */ |
||
| 84 | public final function isInstalled() |
||
| 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) |
||
| 101 | |||
| 102 | |||
| 103 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.