angell-co /
Spoon
| 1 | <?php |
||||||
| 2 | /** |
||||||
| 3 | * Spoon plugin for Craft CMS 3.x |
||||||
| 4 | * |
||||||
| 5 | * Enhance Matrix |
||||||
| 6 | * |
||||||
| 7 | * @link https://angell.io |
||||||
| 8 | * @copyright Copyright (c) 2018 Angell & Co |
||||||
| 9 | */ |
||||||
| 10 | |||||||
| 11 | namespace angellco\spoon\base; |
||||||
| 12 | |||||||
| 13 | use angellco\spoon\services\BlockTypes; |
||||||
| 14 | use angellco\spoon\services\Fields; |
||||||
| 15 | use angellco\spoon\services\Loader; |
||||||
| 16 | use angellco\spoon\Spoon; |
||||||
| 17 | |||||||
| 18 | /** |
||||||
| 19 | * Trait PluginTrait |
||||||
| 20 | * |
||||||
| 21 | * @property-read BlockTypes $blockTypes The block types service |
||||||
| 22 | * @property-read Fields $fields The fields service |
||||||
| 23 | * @property-read Loader $loader The loader service |
||||||
| 24 | * @package angellco\spoon\base |
||||||
| 25 | */ |
||||||
| 26 | trait PluginTrait |
||||||
| 27 | { |
||||||
| 28 | // Static Properties |
||||||
| 29 | // ========================================================================= |
||||||
| 30 | |||||||
| 31 | /** |
||||||
| 32 | * @var Spoon |
||||||
| 33 | */ |
||||||
| 34 | public static $plugin; |
||||||
| 35 | |||||||
| 36 | // Public Methods |
||||||
| 37 | // ========================================================================= |
||||||
| 38 | |||||||
| 39 | /** |
||||||
| 40 | * @return BlockTypes |
||||||
| 41 | */ |
||||||
| 42 | public function getBlockTypes(): BlockTypes |
||||||
| 43 | { |
||||||
| 44 | return $this->get('blockTypes'); |
||||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||||
| 45 | } |
||||||
| 46 | |||||||
| 47 | /** |
||||||
| 48 | * @return Loader |
||||||
| 49 | */ |
||||||
| 50 | public function getLoader(): Loader |
||||||
| 51 | { |
||||||
| 52 | return $this->get('loader'); |
||||||
| 53 | } |
||||||
| 54 | |||||||
| 55 | /** |
||||||
| 56 | * @return Fields |
||||||
| 57 | */ |
||||||
| 58 | public function getFields(): Fields |
||||||
| 59 | { |
||||||
| 60 | return $this->get('fields'); |
||||||
| 61 | } |
||||||
| 62 | |||||||
| 63 | // Private Methods |
||||||
| 64 | // ========================================================================= |
||||||
| 65 | |||||||
| 66 | private function _setPluginComponents() |
||||||
| 67 | { |
||||||
| 68 | $this->setComponents([ |
||||||
|
0 ignored issues
–
show
It seems like
setComponents() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 69 | 'blockTypes' => BlockTypes::class, |
||||||
| 70 | 'loader' => Loader::class, |
||||||
| 71 | 'fields' => Fields::class, |
||||||
| 72 | ]); |
||||||
| 73 | } |
||||||
| 74 | } |