Total Complexity | 2 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
24 | trait ServicesTrait |
||
25 | { |
||
26 | // Public Methods |
||
27 | // ========================================================================= |
||
28 | |||
29 | /** |
||
30 | * @inheritdoc |
||
31 | */ |
||
32 | public function __construct($id, $parent = null, array $config = []) |
||
33 | { |
||
34 | // Merge in the passed config, so it our config can be overridden by Plugins::pluginConfigs['vite'] |
||
35 | // ref: https://github.com/craftcms/cms/issues/1989 |
||
36 | $config = ArrayHelper::merge([ |
||
37 | 'components' => [ |
||
38 | 'embed' => EmbedService::class, |
||
39 | ], |
||
40 | ], $config); |
||
41 | |||
42 | parent::__construct($id, $parent, $config); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * Returns the embed service |
||
47 | * |
||
48 | * @return EmbedService The embed service |
||
49 | * @throws InvalidConfigException |
||
50 | */ |
||
51 | public function getEmbed(): EmbedService |
||
54 | } |
||
55 | } |
||
56 |