Skip to content

Commit fb0e089

Browse files
authored
Fix notice during DI compilation
If an interface has a constructor on it, `getConstructor()` for a ReflectionClass object of it will be null and cause this: ``` [Exception] Notice: Trying to get property of non-object in /Users/cristianquiroz/src/magento2/vendor/magento/framework/Code/Reader/ArgumentsReader.php on line 30 ``` Magento shouldn't pull any dependencies from interface constructors anyway, they will need to be properly implemented before they can be used.
1 parent 424c113 commit fb0e089

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/Magento/Framework/Code/Reader/ArgumentsReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function getConstructorArguments(\ReflectionClass $class, $groupByPositio
2525
/**
2626
* Skip native PHP types, classes without constructor
2727
*/
28-
if (!$class->getFileName() || false == $class->hasMethod(
28+
if ($class->isInterface() || !$class->getFileName() || false == $class->hasMethod(
2929
'__construct'
3030
) || !$inherited && $class->getConstructor()->class != $class->getName()
3131
) {

0 commit comments

Comments
 (0)