getSuperClasses() public method

public getSuperClasses ( $class )
Ejemplo n.º 1
0
 public function __invoke(Analysis $analysis)
 {
     $schemas = $analysis->getAnnotationsOfType('\\Swagger\\Annotations\\Schema');
     foreach ($schemas as $schema) {
         if ($schema->_context->is('class')) {
             $existing = [];
             foreach ($schema->properties as $property) {
                 if ($property->property) {
                     $existing[] = $property->property;
                 }
             }
             $classes = $analysis->getSuperClasses($schema->_context->fullyQualifiedName($schema->_context->class));
             foreach ($classes as $class) {
                 foreach ($class['properties'] as $property) {
                     foreach ($property->annotations as $annotation) {
                         if ($annotation instanceof Property && in_array($annotation->property, $existing) === false) {
                             $existing[] = $annotation->property;
                             $schema->merge([$annotation], true);
                         }
                     }
                 }
             }
         }
     }
 }