@@ -42,6 +42,7 @@ public function __construct(
4242
4343 /**
4444 * Change value from theme_full_path (Ex. "frontend/Magento/blank") to theme_id field for every existed scope.
45+ *
4546 * All other values leave without changes.
4647 *
4748 * @param array $config
@@ -51,10 +52,10 @@ public function process(array $config)
5152 {
5253 foreach ($ config as $ scope => &$ item ) {
5354 if ($ scope === \Magento \Framework \App \Config \ScopeConfigInterface::SCOPE_TYPE_DEFAULT ) {
54- $ item = $ this ->changeThemeFullPathToIdentifier ($ item );
55+ $ item = $ this ->changeThemeFullPathToIdentifier ($ item ?? [] );
5556 } else {
5657 foreach ($ item as &$ scopeItems ) {
57- $ scopeItems = $ this ->changeThemeFullPathToIdentifier ($ scopeItems );
58+ $ scopeItems = $ this ->changeThemeFullPathToIdentifier ($ scopeItems ?? [] );
5859 }
5960 }
6061 }
@@ -63,13 +64,12 @@ public function process(array $config)
6364 }
6465
6566 /**
66- * Check \Magento\Framework\View\DesignInterface::XML_PATH_THEME_ID config path
67- * and convert theme_full_path (Ex. "frontend/Magento/blank") to theme_id
67+ * Convert theme_full_path from config (Ex. "frontend/Magento/blank") to theme_id.
6868 *
69- * @param array $configItems
70- * @return array
69+ * @see \Magento\Framework\View\DesignInterface::XML_PATH_THEME_ID
70+ * @param array $configItems complete store configuration for a single scope as nested array
7171 */
72- private function changeThemeFullPathToIdentifier ($ configItems )
72+ private function changeThemeFullPathToIdentifier (array $ configItems ): array
7373 {
7474 $ theme = null ;
7575 $ themeIdentifier = $ this ->arrayManager ->get (DesignInterface::XML_PATH_THEME_ID , $ configItems );
0 commit comments