-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support for extension attributes #162
Support for extension attributes #162
Conversation
Thanks a lot for your hard work on this. Very much appreciated! It'll take some time until I can check your PR, I am quite busy these days. One thing we should do is to add Is this PR blocked by #161 or could we treat that independently? |
@sprankhub can you help out testing the changes, please? Since you seem to have some projects that make use of extension attributes, it would be lovely to get some real world feedback. I'd need to build a quick module myself to test things. |
Good point. I'll check it out.
Not blocked, I only noticed it because in my own Magento environment I've configured PHPStan's cache to be project-local. |
Well, actually it was not me, but my colleague :D I'll see what we can do regarding testing :) |
@mattwellss will take a deeper dive in this next week. Need to finish a few projects at work before my holiday next week. Should have a bit more time then. I try to get the next release including this PR done before Christmas in the best case. |
@mattwellss quick question: If I would add the phpstan-extension to a Magento module project, where would I have to point the magentoRoot parameter? In the case of this repo https://github.com/bitExpert/magento2-force-login structure what would be the correct configuration? |
Great question, @shochdoerfer. I'll take a look tomorrow... I can see better now your concerns about the extension being able to find extension attributes for "non-application" usage. |
|
||
$autoloader->autoload($interfaceName); | ||
static::assertTrue(interface_exists($interfaceName)); | ||
$interfaceReflection = new \ReflectionClass($interfaceName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure how to resolve this error (outside of suppressing it). PHPStan definitely cannot find this class using static analysis!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine if we ignore the error. I mean me have to make some magic here, that's fine then :)
@mattwellss did a quick check and things look good. Works even for stand-alone modules, it seems. Tested it against The only thing that we need to change is the |
That's great! I've been a bit inundated with time-sensitive tasks, so I haven't been able to complete a test. I was planning to test the efficacy of both core extension attributes and custom ones, which I imagine might fail. If you were able to verify that both are fine then I can skip it. I'll correct the version requirement for laminas code this week. |
Would be cool if you could check that. I haven't done much so far with extension attributes, I don't want to miss something important :)
Not needed, I am currently running some tests and have fixed it locally. Will commit it once I manually merge the PR. |
I was hoping that it would be possible to install |
Resolves #112