File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
lib/internal/Magento/Framework Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 7
7
8
8
class ClassReader implements ClassReaderInterface
9
9
{
10
+ private $ parentsCache = [];
11
+
10
12
/**
11
13
* Read class constructor signature
12
14
*
@@ -54,6 +56,10 @@ public function getConstructor($className)
54
56
*/
55
57
public function getParents ($ className )
56
58
{
59
+ if (isset ($ this ->parentsCache [$ className ])) {
60
+ return $ this ->parentsCache [$ className ];
61
+ }
62
+
57
63
$ parentClass = get_parent_class ($ className );
58
64
if ($ parentClass ) {
59
65
$ result = [];
@@ -75,6 +81,9 @@ public function getParents($className)
75
81
$ result = [];
76
82
}
77
83
}
84
+
85
+ $ this ->parentsCache [$ className ] = $ result ;
86
+
78
87
return $ result ;
79
88
}
80
89
}
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ public function __construct(
138
138
protected function _inheritPlugins ($ type )
139
139
{
140
140
$ type = ltrim ($ type , '\\' );
141
- if (!array_key_exists ( $ type , $ this ->_inherited )) {
141
+ if (!isset ( $ this ->_inherited [ $ type ] )) {
142
142
$ realType = $ this ->_omConfig ->getOriginalInstanceType ($ type );
143
143
144
144
if ($ realType !== $ type ) {
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public function __construct(\Magento\Framework\Code\Reader\ClassReaderInterface
45
45
*/
46
46
public function getParameters ($ className )
47
47
{
48
- if (!array_key_exists ( $ className , $ this ->_definitions )) {
48
+ if (!isset ( $ this ->_definitions [ $ className ] )) {
49
49
$ this ->_definitions [$ className ] = $ this ->_reader ->getConstructor ($ className );
50
50
}
51
51
return $ this ->_definitions [$ className ];
You can’t perform that action at this time.
0 commit comments