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 replacing collections in return types #751

Merged
merged 3 commits into from
Mar 9, 2021
Merged

fix replacing collections in return types #751

merged 3 commits into from
Mar 9, 2021

Conversation

Josh-G
Copy link
Contributor

@Josh-G Josh-G commented Jan 5, 2021

  • Added or updated tests
  • Documented user facing changes
  • Updated CHANGELOG.md

resolves #747

Changes
This PR restricts the methods that ModelExtension will change the return type. Instead of replacing any return type containing a collection, it will now only replace the return type of the methods that can return a custom collection.
Additionally, GenericEloquentCollectionTypeNodeResolverExtension would inadvertently resolve Collection|static[] to a class with the name static. I have updated this to resolve the inner array type, such that static is now correctly interpreted as a StaticType.

This is the first time I've looked into the internals, please let me know if this is not the correct approach (apologies if so).

The test failure is unrelated and is currently affecting master, the tests passed on my fork with the unrelated failure ignored.

Breaking changes
I believe this was the intended behaviour.

@szepeviktor
Copy link
Collaborator

Please merge master to get #775

@szepeviktor szepeviktor merged commit c6898e3 into larastan:master Mar 9, 2021
szepeviktor added a commit that referenced this pull request Mar 9, 2021
@Josh-G Josh-G mentioned this pull request Mar 9, 2021
@Josh-G Josh-G deleted the fix-replacing-collections branch March 9, 2021 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Static method on model has return type signature replaced incorrectly when containing a collection
2 participants