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
Utility
ClassNameExtractor.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\TestFramework\Utility
;
7
8
class
ClassNameExtractor
9
{
16
public
function
getNameWithNamespace
($fileContent)
17
{
18
$namespace = $this->
getNamespace
($fileContent);
19
$name
= $this->
getName
($fileContent);
20
if
(
$name
) {
21
return
$namespace ? $namespace .
'\\'
.
$name
:
$name
;
22
}
23
return
false
;
24
}
25
32
public
function
getName
($fileContent)
33
{
34
$namespace = $this->
getNamespace
($fileContent);
35
if
(isset($namespace)) {
36
preg_match_all(
37
'/^\s*(class|abstract\sclass|interface)\s+([a-z0-9]+)(\s+(extends|implements)|\s*$)/im'
,
38
$fileContent,
39
$classMatches
40
);
41
if
(isset($classMatches[2][0])) {
42
return
$classMatches[2][0];
43
}
44
}
45
return
false
;
46
}
47
54
public
function
getNamespace
($fileContent)
55
{
56
preg_match_all(
57
'/namespace\s([a-z0-9\\\\]+);/im'
,
58
$fileContent,
59
$namespaceMatches
60
);
61
if
(isset($namespaceMatches[1][0])) {
62
return
$namespaceMatches[1][0];
63
}
64
return
false
;
65
}
66
}
Magento\TestFramework\Utility
Definition:
AutogeneratedClassNotInConstructorFinder.php:6
Magento\TestFramework\Utility\ClassNameExtractor\getNamespace
getNamespace($fileContent)
Definition:
ClassNameExtractor.php:54
Magento\TestFramework\Utility\ClassNameExtractor\getName
getName($fileContent)
Definition:
ClassNameExtractor.php:32
Magento\TestFramework\Utility\ClassNameExtractor\getNameWithNamespace
getNameWithNamespace($fileContent)
Definition:
ClassNameExtractor.php:16
Magento\TestFramework\Utility\ClassNameExtractor
Definition:
ClassNameExtractor.php:8
$name
if(!isset($_GET['name'])) $name
Definition:
log.php:14