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
framework
Shell
ComplexParameter.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Shell
;
8
14
class
ComplexParameter
15
{
19
const
DEFAULT_PATTERN
=
'/^\-\-%s=(.+)$/'
;
20
26
private
$name;
27
33
private
$pcre;
34
41
public
function
__construct
($name,
$pattern
= self::DEFAULT_PATTERN)
42
{
43
$this->
name
= $name;
44
$this->pcre = sprintf(
$pattern
, preg_quote($name,
'/'
));
45
}
46
53
public
function
getFromArray
($input)
54
{
55
foreach
($input as
$row
) {
56
$result
= $this->
getFromString
($row);
57
if
(
$result
) {
58
return
$result
;
59
}
60
}
61
return
[];
62
}
63
70
public
function
getFromString
($string)
71
{
72
if
(preg_match($this->pcre, $string, $matches)) {
73
parse_str($matches[1],
$result
);
74
return
$result
;
75
}
76
return
[];
77
}
78
86
public
function
mergeFromArgv
($server, array $into = [])
87
{
88
$result
= $into;
89
if
(isset($server[
'argv'
])) {
90
$value
= $this->
getFromArray
($server[
'argv'
]);
91
$result
= array_replace_recursive($into,
$value
);
92
}
93
return
$result
;
94
}
95
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
$pattern
$pattern
Definition:
website.php:22
Magento\Framework\Shell\ComplexParameter\mergeFromArgv
mergeFromArgv($server, array $into=[])
Definition:
ComplexParameter.php:86
Magento\Framework\Shell\ComplexParameter\__construct
__construct($name, $pattern=self::DEFAULT_PATTERN)
Definition:
ComplexParameter.php:41
Magento\Framework\Shell
Definition:
CommandRenderer.php:6
Magento\Framework\Shell\ComplexParameter\getFromArray
getFromArray($input)
Definition:
ComplexParameter.php:53
Magento\Framework\Shell\ComplexParameter
Definition:
ComplexParameter.php:14
name
$value
$value
Definition:
gender.phtml:16
Magento\Framework\Shell\ComplexParameter\getFromString
getFromString($string)
Definition:
ComplexParameter.php:70
Magento\Framework\Shell\ComplexParameter\DEFAULT_PATTERN
const DEFAULT_PATTERN
Definition:
ComplexParameter.php:19
$row
$row
Definition:
cart_rule_free_shipping.php:12