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
dev
tests
static
framework
Magento
TestFramework
Integrity
Library
PhpParser
Throws.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\TestFramework\Integrity\Library\PhpParser
;
7
12
class
Throws
implements
ParserInterface
,
DependenciesCollectorInterface
13
{
17
protected
$tokens
;
18
24
protected
$dependencies
= [];
25
31
protected
$throws
= [];
32
36
public
function
__construct
(
Tokens
$tokens
)
37
{
38
$this->tokens =
$tokens
;
39
}
40
44
public
function
parse
(
$token
, $key)
45
{
46
if
(is_array(
$token
) &&
$token
[0] == T_THROW) {
47
$this->
throws
[] = $key;
48
}
49
}
50
54
public
function
getDependencies
(
Uses
$uses)
55
{
56
foreach
($this->
throws
as $throw) {
57
$class
=
''
;
58
if
($this->tokens->getTokenCodeByKey($throw + 2) == T_NEW) {
59
$step = 4;
60
while
($this->tokens->getTokenCodeByKey(
61
$throw + $step
62
) == T_STRING || $this->tokens->getTokenCodeByKey(
63
$throw + $step
64
) == T_NS_SEPARATOR) {
65
$class
.= trim($this->tokens->getTokenValueByKey($throw + $step));
66
$step++;
67
}
68
if
($uses->
hasUses
()) {
69
$class
= $uses->
getClassNameWithNamespace
(
$class
);
70
}
71
$this->dependencies[] =
$class
;
72
}
73
}
74
75
return
$this->dependencies
;
76
}
77
}
Magento\TestFramework\Integrity\Library\PhpParser\Throws\$throws
$throws
Definition:
Throws.php:31
Magento\TestFramework\Integrity\Library\PhpParser
Definition:
DependenciesCollectorInterface.php:6
Magento\TestFramework\Integrity\Library\PhpParser\Throws\getDependencies
getDependencies(Uses $uses)
Definition:
Throws.php:54
Magento\TestFramework\Integrity\Library\PhpParser\ParserInterface
Definition:
ParserInterface.php:12
$token
$token
Definition:
fake_payment_token.php:14
$class
$_option $_optionId $class
Definition:
date.phtml:13
Magento\TestFramework\Integrity\Library\PhpParser\Throws\$dependencies
$dependencies
Definition:
Throws.php:24
Magento\TestFramework\Integrity\Library\PhpParser\Uses
Definition:
Uses.php:12
Magento\TestFramework\Integrity\Library\PhpParser\Throws\__construct
__construct(Tokens $tokens)
Definition:
Throws.php:36
Magento\TestFramework\Integrity\Library\PhpParser\Throws\parse
parse($token, $key)
Definition:
Throws.php:44
Magento\TestFramework\Integrity\Library\PhpParser\Tokens
Definition:
Tokens.php:12
Magento\TestFramework\Integrity\Library\PhpParser\DependenciesCollectorInterface
Definition:
DependenciesCollectorInterface.php:12
Magento\TestFramework\Integrity\Library\PhpParser\Throws\$tokens
$tokens
Definition:
Throws.php:17
Magento\TestFramework\Integrity\Library\PhpParser\Uses\hasUses
hasUses()
Definition:
Uses.php:33
Magento\TestFramework\Integrity\Library\PhpParser\Throws
Definition:
Throws.php:12
Magento\TestFramework\Integrity\Library\PhpParser\Uses\getClassNameWithNamespace
getClassNameWithNamespace($class)
Definition:
Uses.php:52