-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add support of types from vendor packages #657
Comments
@fogrye Can you not just include the namespace for these classes in the SchemaFactory:: addTypeNamespace('Vendor\\Namespace'); |
@oojacoboo I wish so, but as readme in class explorer says - it just goes through project files but not also vendor files. Thats why I want to suggest this feature here and in class-explorer project. |
@fogrye I think it's reasonable to assume types might exist as vendor files and I agree that's something that should be optionally supported. That said, I'm assuming there are some performance considerations - that needs to be taken into account somehow. I'm not a maintainer for |
@oojacoboo so seems to me that |
I'm wondering if there might be a better lib for handling all of this? Have you looked? Swapping out that lib might be a better option in the long term. |
@oojacoboo I found a couple but not that good:
I'm personally more for 1st option, what do you think? |
@fogrye @oprypkhantc suggested looking at https://github.com/alekitto/class-finder/ as well. Looks like it supports Composer, which would be PSR0/4, etc. |
Main issue is to let type mappers find types in vendor packages which class-explorer and maintainer is not updating the project. Symfony and Laravel bundles have to be updated too. Fixes: thecodingmachine#657
@oojacoboo so could you pls check the PR, I believe we can have it merged |
…664) * feat: replace thecodingmachine/class-explorer with kcs/class-finder Main issue is to let type mappers find types in vendor packages which class-explorer and maintainer is not updating the project. Symfony and Laravel bundles have to be updated too. Fixes: #657 * test: check that incorrect classes don't trigger autoloading errors Thanks @oprypkhantc * fix: stop caching reflections * fix: static checks * fix: stop using cached classes if restoring fails * test: improve coverage * fix: prevent possible issue with long-running apps As each condition applied to finder stays there each place it is applied should be done on cloned instance to avoid accumulation. Main instance of finder is kept with all the conditions provided during configuring. NS is created only from NSFctory where it's cloned so no need to add same clone inside NS.
Thanks again - merged. |
This is mainly for input types but could be considered for output also.
While you can use classes from various libraries you are limited to only current project folders in case you moved some input types to external package. In my case I have some where/sort classes + logic moved as shared library and want to have them used as types, I have added all attributes but SchemaFactory will ignore them as GlobClassExplorer only looks into project src.
I'm happily contribute to this one + https://github.com/thecodingmachine/class-explorer but that is a big change for class explorer and maintainers of that lib may not be happy about it.
I hope my request to support vendor packages types will find supporters as IMHO it's must have for complex projects.
Happily receive any feedback on this, thx.
The text was updated successfully, but these errors were encountered: