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