Skip to content

Commit

Permalink
Fix notice during DI compilation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
qrz-io authored Jan 23, 2017
1 parent 424c113 commit fb0e089
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getConstructorArguments(\ReflectionClass $class, $groupByPositio
/**
* Skip native PHP types, classes without constructor
*/
if (!$class->getFileName() || false == $class->hasMethod(
if ($class->isInterface() || !$class->getFileName() || false == $class->hasMethod(
'__construct'
) || !$inherited && $class->getConstructor()->class != $class->getName()
) {
Expand Down

0 comments on commit fb0e089

Please sign in to comment.