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
App
Request
HttpMethodMap.php
Go to the documentation of this file.
1
<?php
7
declare(strict_types=1);
8
9
namespace
Magento\Framework\App\Request
;
10
14
class
HttpMethodMap
15
{
19
private
$map;
20
24
public
function
__construct
(array $map)
25
{
26
$this->map = $this->processMap(
$map
);
27
}
28
37
private
function
processMap(array $map): array
38
{
39
$filtered = [];
40
foreach
($map as
$method
=> $interface) {
41
$interface = trim(preg_replace(
'/^\\\+/'
,
''
, $interface));
42
if
(!(interface_exists($interface) ||
class_exists
($interface))) {
43
throw
new \InvalidArgumentException(
44
"Interface '$interface' does not exist"
45
);
46
}
47
if
(!
$method
) {
48
throw
new \InvalidArgumentException(
'Invalid method given'
);
49
}
50
51
$filtered[
$method
] = $interface;
52
}
53
54
return
$filtered;
55
}
56
64
public
function
getMap
(): array
65
{
66
return
$this->map;
67
}
68
}
$map
$map
Definition:
classmap_generator.php:167
Magento\Framework\App\Request\HttpMethodMap\__construct
__construct(array $map)
Definition:
HttpMethodMap.php:24
$method
$method
Definition:
info.phtml:13
Magento\Framework\Code\Generator\class_exists
class_exists($className)
Definition:
DefinedClassesTest.php:15
Magento\Framework\App\Request\HttpMethodMap\getMap
getMap()
Definition:
HttpMethodMap.php:64
Magento\Framework\App\Request
Definition:
CompositeValidator.php:9
Magento\Framework\App\Request\HttpMethodMap
Definition:
HttpMethodMap.php:14