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

Fixed a bug with inherited properties being null #250

Merged
merged 1 commit into from
Oct 18, 2015
Merged

Fixed a bug with inherited properties being null #250

merged 1 commit into from
Oct 18, 2015

Conversation

thekonz
Copy link
Contributor

@thekonz thekonz commented Sep 25, 2015

If a class inherits from another class without docblocks, swagger-php throws an error, because it is trying to loop through null.

I encountered this problem today. My models inherited from a class without a docblock.
When i tried to run Swagger\scan('/path/to/app'), it greeted me with Invalid argument supplied for foreach(). Not having DocBlocks in a class is certainly not the best thing to do, but it should not stop me from seeing the swagger generated docs.

I included a unit test with fixtures. If you comment out the if statement in InheritProperties, you will see, that the unit test fails with said error.

if a class inherited from another class without docblocks,
swagger-php would throw an error, because it was trying to
loop through null.
@lucasmezencio
Copy link

👍

@ovr
Copy link
Contributor

ovr commented Oct 14, 2015

👍
ping @zircote

@bfanger bfanger merged commit fac0f54 into zircote:master Oct 18, 2015
@bfanger
Copy link
Collaborator

bfanger commented Oct 18, 2015

Thanks!

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.

4 participants