Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
setup
src
Magento
Setup
Module
Di
Compiler
Config
Chain
PreferencesResolving.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Setup\Module\Di\Compiler\Config\Chain
;
8
9
use
Magento\Setup\Module\Di\Compiler\Config\ModificationInterface
;
10
11
class
PreferencesResolving
implements
ModificationInterface
12
{
19
public
function
modify
(array
$config
)
20
{
21
if
(!isset(
$config
[
'arguments'
],
$config
[
'preferences'
])) {
22
return
$config
;
23
}
24
25
$this->resolvePreferences(
$config
[
'arguments'
],
$config
[
'preferences'
]);
26
27
return
$config
;
28
}
29
37
private
function
resolvePreferences(&$argument, &$preferences)
38
{
39
if
(!is_array($argument)) {
40
return
;
41
}
42
43
foreach
($argument as $key => &
$value
) {
44
if
(in_array($key, [
'_i_'
,
'_ins_'
],
true
)) {
45
$value
= $this->resolvePreferenceRecursive(
$value
, $preferences);
46
continue
;
47
}
48
49
if
(is_array(
$value
)) {
50
$this->resolvePreferences(
$value
, $preferences);
51
}
52
}
53
}
54
63
private
function
resolvePreferenceRecursive(&
$value
, &$preferences)
64
{
65
return
isset($preferences[
$value
])
66
? $this->resolvePreferenceRecursive($preferences[
$value
], $preferences)
67
:
$value
;
68
}
69
}
Magento\Setup\Module\Di\Compiler\Config\Chain\PreferencesResolving\modify
modify(array $config)
Definition:
PreferencesResolving.php:19
$config
$config
Definition:
fraud_order.php:17
Magento\Setup\Module\Di\Compiler\Config\Chain
Definition:
ArgumentsSerialization.php:7
$value
$value
Definition:
gender.phtml:16
Magento\Setup\Module\Di\Compiler\Config\Chain\PreferencesResolving
Definition:
PreferencesResolving.php:11
Magento\Setup\Module\Di\Compiler\Config\ModificationInterface
Definition:
ModificationInterface.php:13