@@ -42,6 +42,7 @@ public function __construct(
42
42
43
43
/**
44
44
* Change value from theme_full_path (Ex. "frontend/Magento/blank") to theme_id field for every existed scope.
45
+ *
45
46
* All other values leave without changes.
46
47
*
47
48
* @param array $config
@@ -51,10 +52,10 @@ public function process(array $config)
51
52
{
52
53
foreach ($ config as $ scope => &$ item ) {
53
54
if ($ scope === \Magento \Framework \App \Config \ScopeConfigInterface::SCOPE_TYPE_DEFAULT ) {
54
- $ item = $ this ->changeThemeFullPathToIdentifier ($ item );
55
+ $ item = $ this ->changeThemeFullPathToIdentifier ($ item ?? [] );
55
56
} else {
56
57
foreach ($ item as &$ scopeItems ) {
57
- $ scopeItems = $ this ->changeThemeFullPathToIdentifier ($ scopeItems );
58
+ $ scopeItems = $ this ->changeThemeFullPathToIdentifier ($ scopeItems ?? [] );
58
59
}
59
60
}
60
61
}
@@ -63,13 +64,12 @@ public function process(array $config)
63
64
}
64
65
65
66
/**
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.
68
68
*
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
71
71
*/
72
- private function changeThemeFullPathToIdentifier ($ configItems )
72
+ private function changeThemeFullPathToIdentifier (array $ configItems ): array
73
73
{
74
74
$ theme = null ;
75
75
$ themeIdentifier = $ this ->arrayManager ->get (DesignInterface::XML_PATH_THEME_ID , $ configItems );
0 commit comments