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

Error with trying to Define Trait #230

Closed
Arilas opened this issue Jul 20, 2015 · 1 comment
Closed

Error with trying to Define Trait #230

Arilas opened this issue Jul 20, 2015 · 1 comment

Comments

@Arilas
Copy link

Arilas commented Jul 20, 2015

I've use v2.0 Swagger-php
When you have trait, that you want to annotate, you receive error:

Trying to get property of non-object
        // Merge unmerged @SWG\Property annotations into the @SWG\Definition of the class
        $unmergedProperties = $analysis->unmerged()->getAnnotationsOfType('\Swagger\Annotations\Property');
        foreach ($unmergedProperties as $property) {
            $classContext = $property->_context->with('class'); 
            if ($classContext->annotations) { // <------- This line
                $definition = false;

Is there's ability to Define trait?

@bfanger
Copy link
Collaborator

bfanger commented Jul 24, 2015

Thanks for reporting the bug.
I've fixed the error, and added minimal support for traits.

For better trait support you could take a look at the fork based on reflection by @mpajunen

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

No branches or pull requests

2 participants