Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix notice during DI compilation #8232

Merged
merged 1 commit into from
Feb 1, 2017
Merged

Conversation

qrz-io
Copy link
Contributor

@qrz-io qrz-io commented Jan 23, 2017

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.

Steps to reproduce

  1. Add any interface to a Magento2 module or library with a contructor on it.
  2. run php bin/magento setup:di:compile

Expected results

Success

Actual results

 [Exception]
  Notice: Trying to get property of non-object in /Users/cristianquiroz/src/magento2/vendor/magento/framework/Code/Reader/ArgumentsReader.php on line 30

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.
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Jan 23, 2017

CLA assistant check
All committers have signed the CLA.

qrz-io added a commit to AmpersandHQ/web-service-common-php that referenced this pull request Jan 23, 2017
We do this to make this package compatible with M2 DI compile.
See magento/magento2#8232
@ishakhsuvarov ishakhsuvarov self-assigned this Jan 31, 2017
@ishakhsuvarov ishakhsuvarov requested review from maghamed and removed request for antonkril January 31, 2017 14:02
@mmansoor-magento mmansoor-magento merged commit fb0e089 into magento:develop Feb 1, 2017
@ishakhsuvarov
Copy link
Contributor

@qrz-io Pull Request had been delivered to the develop branch. Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants