File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
lib/internal/Magento/Framework/ObjectManager/Definition Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,18 @@ abstract class Compiled implements \Magento\Framework\ObjectManager\DefinitionIn
16
16
*/
17
17
protected $ _definitions ;
18
18
19
+ /**
20
+ * @var \Magento\Framework\Code\Reader\ClassReader
21
+ */
22
+ protected $ reader ;
23
+
19
24
/**
20
25
* @param array $definitions
21
26
*/
22
- public function __construct (array $ definitions )
27
+ public function __construct (array $ definitions, \ Magento \ Framework \ Code \ Reader \ ClassReader $ reader = null )
23
28
{
24
29
list ($ this ->_signatures , $ this ->_definitions ) = $ definitions ;
30
+ $ this ->reader = $ reader ?: new \Magento \Framework \Code \Reader \ClassReader ();
25
31
}
26
32
27
33
/**
@@ -50,6 +56,11 @@ abstract protected function _unpack($signature);
50
56
*/
51
57
public function getParameters ($ className )
52
58
{
59
+ // if the definition isn't found in the list gathered from the compiled file using reflection to find it
60
+ if (!isset ($ this ->_definitions [$ className ])) {
61
+ return $ this ->reader ->getConstructor ($ className );
62
+ }
63
+
53
64
$ definition = $ this ->_definitions [$ className ];
54
65
if ($ definition !== null ) {
55
66
if (is_string ($ this ->_signatures [$ definition ])) {
You can’t perform that action at this time.
0 commit comments